Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Additions #2

Merged
merged 5 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .dockerignore

This file was deleted.

11 changes: 9 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
node_modules
.eslintrc.cjs
global.css

node_modules
pnpm-lock.yaml
package.json
package.json

*.md
*.mdx
*.svg
*.yaml
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Ion Prodan
Copyright (c) 2024 Eduardo Escoto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
89 changes: 7 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,9 @@
![img.png](img.png)
This site started with the tailwind astro started blog and has diverged in many places.

# Tailwind Astro Starter Project
## TODO:

[![GitHub Repo stars](https://img.shields.io/github/stars/wanoo21/tailwind-astro-starting-blog?style=social)](https://GitHub.com/wanoo21/tailwind-astro-starting-blog/stargazers/)
[![GitHub forks](https://img.shields.io/github/forks/wanoo21/tailwind-astro-starting-blog?style=social)](https://GitHub.com/wanoo21/tailwind-astro-starting-blog/network/)
[![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Fipwanciu)](https://twitter.com/ipwanciu)

[//]: # '[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/timlrx)](https://github.com/sponsors/timlrx)'

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/wanoo21/tailwind-astro-starting-blog)

This template is perfect for those who want to use Tailwind CSS and Astro to build a blog.

It is inspired by the [Tailwind Next.js Starter Blog](https://github.com/timlrx/tailwind-nextjs-starter-blog) - one of the most popular Next.js blogging templates.

Feature request or Facing issue? Check the [discussion page](https://github.com/wanoo21/tailwind-astro-starting-blog/discussions) to see if it has been brought up previously. Otherwise, feel free to start a new discussion thread. All ideas are welcomed!

## Demo

[Live Demo](https://tasb.yon.fun/) - Deployed on Vercel.

## Features

- Astro with Typescript
- Astro MDX support
- Easy styling customization with [Tailwind 3.3](https://tailwindcss.com/blog/tailwindcss-v3-3) and primary color attribute
- Mobile-friendly view
- Light and dark theme
- ~~Font optimization~~ - Not yet implemented
- Automatic image optimization via Astro image component
- Support for tags - each unique tag will be its own page
- Support for multiple authors
- ~~3 different blog layouts~~ - Only 2 for now
- ~~2 different blog listing layouts~~ - Only 1 for now
- Support for nested routing of blog posts
- Projects page
- ~~SEO friendly~~ still working on this, but already supports RSS feed, sitemaps and more!

Even thought these features looks the same as the original template, they are implemented in a different way, and there are more to come.

However, there are some features that are not in the original template, like:

- Support for multiple authors pages - **each author will have** its own page, with a list of all the posts written by him/her.
- Support for multiple tags pages - **each tag has its own page with custom description**, that can be customized with markdown.
- Related posts - **each post has** a list of related posts, provided by the author inside the markdown file.
- Pagination inside blog/tags pages - **each blog/tags page has** a pagination.
- Cool animations provided by Astro.
- And many more that would come in the future.

## Extend / Customize

`src/consts.ts` contains a list of constants that you can customize to your liking, including the blog title, description, author, social media links, etc.

`src/functions.ts` contains a list of functions that changes the default behavior of the template, including default post sorting and exclude draft posts.

`src/content/authors/default.mdx` contains the default author information. You can add more authors by adding more `.mdx` files in the `src/content/authors` folder.

`src/content/tags/default.mdx` contains the default tag information. You can add more tags by adding more `.mdx` files in the `src/content/tags` folder.

`src/content/config.ts` contains all fields for author, blog and tags pages. Check what's required and what's not. You can also add more fields if you want to.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

### 🐳 Docker Commands

All Docker commands are run from the root of the project, from a terminal:

| Command | Action |
| :-------------------------------- | :------------------------------------------------------- |
| `docker build -t app:1.0.0 .` | Build the Docker image for the Astro application. |
| `docker run -p 80:4321 app:1.0.0` | Run a Docker container with the built Astro application. |
| `docker pull edwardb11/app:2.0.0` | Download the Docker image from Docker Hub. |
- [ ] Dark mode and light mode logo
- [ ] Actions for notebooks and obsidian markdown to automatically be pulled into repo
- [ ] Add content config for obsidian and notebooks separatey?
- [ ] Add reading time
- [x] change from prism to shikiji
18 changes: 17 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
import rehypeShikiji from 'rehype-shikiji'
import { transformerNotationDiff } from 'shikiji-transformers'

import { SITE_METADATA } from './src/consts.ts'

Expand All @@ -13,7 +15,21 @@ export default defineConfig({
site: SITE_METADATA.siteUrl,
integrations: [mdx(), sitemap(), tailwind()],
markdown: {
rehypePlugins: [rehypeKatex],
syntaxHighlight: false,
rehypePlugins: [
rehypeKatex,
[
rehypeShikiji,
{
themes: {
light: 'catppuccin-latte',
dark: 'catppuccin-mocha',
},
transformers: [transformerNotationDiff()],
wrap: true,
},
],
],
remarkPlugins: [remarkMath],
},
})
Binary file removed img.png
Binary file not shown.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"prettier:format": "prettier --write \"**/*.{ts,tsx,js,md,mdx,css,yaml,astro,cjs,mjs,json}\"",
"prettier:check:ci": "prettier --check \"**/*.{ts,tsx,js,md,mdx,css,yaml,astro,cjs,mjs,json}\"",
"prettier:format": "prettier --write \"**/*.{ts,tsx,js,md,mdx,css,yaml,astro,cjs,mjs,json}\" --plugin=prettier-plugin-astro",
"prettier:check:ci": "prettier --check \"**/*.{ts,tsx,js,md,mdx,css,yaml,astro,cjs,mjs,json}\" --plugin=prettier-plugin-astro",
"prepare": "husky install"
},
"dependencies": {
Expand Down Expand Up @@ -40,6 +40,9 @@
"prettier": "^3.2.2",
"prettier-plugin-astro": "^0.12.3",
"prettier-plugin-tailwindcss": "^0.5.11",
"rehype-shikiji": "0.10.0-beta.3",
"shikiji": "0.10.0-beta.3",
"shikiji-transformers": "0.10.0-beta.3",
"tailwindcss": "^3.4.1"
}
}
71 changes: 57 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading