Skip to content

Commit 0cb5a5b

Browse files
committed
docs: update blog posts and readme (#459)
* docs: update astro-paper theme config docs * docs: update adding-new-post blog post * docs: remove outdated posts and update featured posts * fix: update broken image link in astro-paper-4 blog * docs: add a blog post for astro-paper-v5 * docs: update README for AstroPaper v5 * fix: update blog post formatting
1 parent b4ae4cd commit 0cb5a5b

10 files changed

Lines changed: 232 additions & 716 deletions

README.md

Lines changed: 32 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
AstroPaper is a minimal, responsive, accessible and SEO-friendly Astro blog theme. This theme is designed and crafted based on [my personal blog](https://satnaing.dev/blog).
1111

12-
This theme follows best practices and provides accessibility out of the box. Light and dark mode are supported by default. Moreover, additional color schemes can also be configured.
13-
14-
This theme is self-documented \_ which means articles/posts in this theme can also be considered as documentations. Read [the blog posts](https://astro-paper.pages.dev/posts/) or check [the README Documentation Section](#-documentation) for more info.
12+
Read [the blog posts](https://astro-paper.pages.dev/posts/) or check [the README Documentation Section](#-documentation) for more info.
1513

1614
## 🔥 Features
1715

@@ -46,55 +44,52 @@ Inside of AstroPaper, you'll see the following folders and files:
4644
/
4745
├── public/
4846
│ ├── assets/
49-
│ │ └── logo.svg
50-
│ │ └── logo.png
47+
| ├── pagefind/ # auto-generated when build
5148
│ └── favicon.svg
5249
│ └── astropaper-og.jpg
53-
│ └── robots.txt
50+
│ └── favicon.svg
5451
│ └── toggle-theme.js
5552
├── src/
5653
│ ├── assets/
57-
│ │ └── socialIcons.ts
54+
│ │ └── icons/
55+
│ │ └── images/
5856
│ ├── components/
59-
│ ├── content/
60-
│ │ | blog/
61-
│ │ | └── some-blog-posts.md
62-
│ │ └── config.ts
57+
│ ├── data/
58+
│ │ └── blog/
59+
│ │ └── some-blog-posts.md
6360
│ ├── layouts/
6461
│ └── pages/
6562
│ └── styles/
6663
│ └── utils/
6764
│ └── config.ts
68-
│ └── types.ts
69-
└── package.json
65+
│ └── constants.ts
66+
│ └── content.config.ts
67+
└── astro.config.ts
7068
```
7169

7270
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
7371

7472
Any static assets, like images, can be placed in the `public/` directory.
7573

76-
All blog posts are stored in `src/content/blog` directory.
74+
All blog posts are stored in `src/data/blog` directory.
7775

7876
## 📖 Documentation
7977

8078
Documentation can be read in two formats\_ _markdown_ & _blog post_.
8179

82-
- Configuration - [markdown](src/content/blog/how-to-configure-astropaper-theme.md) | [blog post](https://astro-paper.pages.dev/posts/how-to-configure-astropaper-theme/)
83-
- Add Posts - [markdown](src/content/blog/adding-new-post.md) | [blog post](https://astro-paper.pages.dev/posts/adding-new-posts-in-astropaper-theme/)
84-
- Customize Color Schemes - [markdown](src/content/blog/customizing-astropaper-theme-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/customizing-astropaper-theme-color-schemes/)
85-
- Predefined Color Schemes - [markdown](src/content/blog/predefined-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/predefined-color-schemes/)
86-
87-
> For AstroPaper v1, check out [this branch](https://github.com/satnaing/astro-paper/tree/astro-paper-v1) and this [live URL](https://astro-paper-v1.astro-paper.pages.dev/)
80+
- Configuration - [markdown](src/data/blog/how-to-configure-astropaper-theme.md) | [blog post](https://astro-paper.pages.dev/posts/how-to-configure-astropaper-theme/)
81+
- Add Posts - [markdown](src/data/blog/adding-new-post.md) | [blog post](https://astro-paper.pages.dev/posts/adding-new-posts-in-astropaper-theme/)
82+
- Customize Color Schemes - [markdown](src/data/blog/customizing-astropaper-theme-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/customizing-astropaper-theme-color-schemes/)
83+
- Predefined Color Schemes - [markdown](src/data/blog/predefined-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/predefined-color-schemes/)
8884

8985
## 💻 Tech Stack
9086

9187
**Main Framework** - [Astro](https://astro.build/)
9288
**Type Checking** - [TypeScript](https://www.typescriptlang.org/)
93-
**Component Framework** - [ReactJS](https://reactjs.org/)
9489
**Styling** - [TailwindCSS](https://tailwindcss.com/)
9590
**UI/UX** - [Figma Design File](https://www.figma.com/community/file/1356898632249991861)
96-
**Fuzzy Search** - [FuseJS](https://fusejs.io/)
97-
**Icons** - [Boxicons](https://boxicons.com/) | [Tablers](https://tabler-icons.io/)
91+
**Static Search** - [FuseJS](https://pagefind.app/)
92+
**Icons** - [Tablers](https://tabler-icons.io/)
9893
**Code Formatting** - [Prettier](https://prettier.io/)
9994
**Deployment** - [Cloudflare Pages](https://pages.cloudflare.com/)
10095
**Illustration in About Page** - [https://freesvgillustration.com](https://freesvgillustration.com/)
@@ -105,29 +100,24 @@ Documentation can be read in two formats\_ _markdown_ & _blog post_.
105100
You can start using this project locally by running the following command in your desired directory:
106101

107102
```bash
108-
# npm 6.x
109-
npm create astro@latest --template satnaing/astro-paper
103+
# pnpm
104+
pnpm create astro@latest --template satnaing/astro-paper
110105

111-
# npm 7+, extra double-dash is needed:
106+
# npm
112107
npm create astro@latest -- --template satnaing/astro-paper
113108

114109
# yarn
115110
yarn create astro --template satnaing/astro-paper
116-
117-
# pnpm
118-
pnpm dlx create-astro --template satnaing/astro-paper
119111
```
120112

121-
> **_Warning!_** If you're using `yarn 1`, you might need to [install `sharp`](https://sharp.pixelplumbing.com/install) as a dependency.
122-
123113
Then start the project by running the following commands:
124114

125115
```bash
126-
# install dependencies
127-
npm run install
116+
# install dependencies if you haven't done so in the previous step.
117+
pnpm install
128118

129119
# start running the project
130-
npm run dev
120+
pnpm run dev
131121
```
132122

133123
As an alternative approach, if you have Docker installed, you can use Docker to run this project locally. Here's how:
@@ -159,14 +149,14 @@ All commands are run from the root of the project, from a terminal:
159149
160150
| Command | Action |
161151
| :----------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
162-
| `npm install` | Installs dependencies |
163-
| `npm run dev` | Starts local dev server at `localhost:4321` |
164-
| `npm run build` | Build your production site to `./dist/` |
165-
| `npm run preview` | Preview your build locally, before deploying |
166-
| `npm run format:check` | Check code format with Prettier |
167-
| `npm run format` | Format codes with Prettier |
168-
| `npm run sync` | Generates TypeScript types for all Astro modules. [Learn more](https://docs.astro.build/en/reference/cli-reference/#astro-sync). |
169-
| `npm run lint` | Lint with ESLint |
152+
| `pnpm install` | Installs dependencies |
153+
| `pnpm run dev` | Starts local dev server at `localhost:4321` |
154+
| `pnpm run build` | Build your production site to `./dist/` |
155+
| `pnpm run preview` | Preview your build locally, before deploying |
156+
| `pnpm run format:check` | Check code format with Prettier |
157+
| `pnpm run format` | Format codes with Prettier |
158+
| `pnpm run sync` | Generates TypeScript types for all Astro modules. [Learn more](https://docs.astro.build/en/reference/cli-reference/#astro-sync). |
159+
| `pnpm run lint` | Lint with ESLint |
170160
| `docker compose up -d` | Run AstroPaper on docker, You can access with the same hostname and port informed on `dev` command. |
171161
| `docker compose run app npm install` | You can run any command above into the docker container. |
172162
| `docker build -t astropaper .` | Build Docker image for AstroPaper. |
174 KB
Loading

src/data/blog/adding-new-post.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
author: Sat Naing
33
pubDatetime: 2022-09-23T15:22:00Z
4-
modDatetime: 2023-12-21T09:12:47.400Z
4+
modDatetime: 2025-03-08T07:46:00.619Z
55
title: Adding new posts in AstroPaper theme
66
slug: adding-new-posts-in-astropaper-theme
77
featured: true
@@ -30,7 +30,7 @@ Here is the list of frontmatter property for each post.
3030
| **_pubDatetime_** | Published datetime in ISO 8601 format. | required<sup>\*</sup> |
3131
| **_modDatetime_** | Modified datetime in ISO 8601 format. (only add this property when a blog post is modified) | optional |
3232
| **_author_** | Author of the post. | default = SITE.author |
33-
| **_slug_** | Slug for the post. This field is optional but cannot be an empty string. (slug: ""❌) | default = slugified file name |
33+
| **_slug_** | Slug for the post. This field is optional. | default = slugified file name |
3434
| **_featured_** | Whether or not display this post in featured section of home page | default = false |
3535
| **_draft_** | Mark this post 'unpublished'. | default = false |
3636
| **_tags_** | Related keywords for this post. Written in array yaml format. | default = others |

src/data/blog/astro-paper-4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ author: Sat Naing
33
pubDatetime: 2024-01-04T09:30:41.816Z
44
title: AstroPaper 4.0
55
slug: "astro-paper-v4"
6-
featured: true
6+
featured: false
77
ogImage: ../../assets/images/AstroPaper-v4.png
88
tags:
99
- release
@@ -22,7 +22,7 @@ Hello everyone! Wishing you a happy New Year 🎉 and all the best for 2024! We'
2222

2323
AstroPaper now leverages the power and capabilities of Astro v4. However, it’s a subtle upgrade and won’t break most Astro users.
2424

25-
![Astro v4](https://astro.build/_astro/header-astro-4.GLp8HjfV.webp)
25+
![Astro v4](https://astro.build/_astro/header-astro-4.YunweN9V_OmV0l.webp)
2626

2727
### Replace `postSlug` with Astro Content `slug` [#197](https://github.com/satnaing/astro-paper/pull/197)
2828

src/data/blog/astro-paper-5.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
pubDatetime: 2025-03-08T08:18:19.693Z
3+
title: AstroPaper 5.0
4+
slug: astro-paper-v5
5+
featured: true
6+
ogImage: ../../assets/images/AstroPaper-v5.png
7+
tags:
8+
- release
9+
description: "AstroPaper v5: keep the clean look, updates under the hood."
10+
---
11+
12+
At last, the long-awaited AstroPaper v5 is finally here. AstroPaper v5 keeps the same minimal & clean look, but comes with significant updates under the hood.
13+
14+
![AstroPaper v5](@/assets/images/AstroPaper-v5.png)
15+
16+
## Table of contents
17+
18+
## Major Changes
19+
20+
### Upgrade to Astro v5 [#455](https://github.com/satnaing/astro-paper/pull/455)
21+
22+
AstroPaper now comes with Astro v5, bringing all the new features and improvements that come with it.
23+
24+
### Tailwind v4
25+
26+
AstroPaper has been upgraded to Tailwind v4, which includes many style changes under the hood. The `tailwind.config.js` file has been removed, and now all the configuration is located within the `src/styles/global.css` file. Typography-related styles have been extracted and moved to `src/styles/typography.css`.
27+
28+
Due to the new behavior in TailwindCSS v4, styles inside `<style>` blocks within components have been removed and replaced with inline Tailwind classes.
29+
30+
Additionally, the color palette across the UI has been updated. The new palette now consists of only five colors:
31+
32+
```css
33+
:root,
34+
html[data-theme="light"] {
35+
--background: #fdfdfd;
36+
--foreground: #282728;
37+
--accent: #006cac;
38+
--muted: #e6e6e6;
39+
--border: #ece9e9;
40+
}
41+
42+
html[data-theme="dark"] {
43+
--background: #212737;
44+
--foreground: #eaedf3;
45+
--accent: #ff6b01;
46+
--muted: #343f60bf;
47+
--border: #ab4b08;
48+
}
49+
```
50+
51+
### Remove React + Fuse.js in favor of Pagefind search
52+
53+
In previous versions, React.js and Fuse.js were used for search functionality and OG image generation. In AstroPaper v5, React.js has been removed and replaced with [Pagefind](https://pagefind.app/), a static site search tool.
54+
55+
The search experience is almost identical to previous versions, but now all contents, not just titles and descriptions, are indexed and searchable, thanks to Pagefind.
56+
57+
The idea of using Pagefind in dev mode was inspired by [this blog post](https://chrispennington.blog/blog/pagefind-static-search-for-astro-sites/).
58+
59+
### Updated import alias
60+
61+
The import alias has been updated from `@directory` to `@/directory`, which means you now have to import like this:
62+
63+
```astro
64+
---
65+
import { slugifyStr } from "@/utils/slugify";
66+
import IconHash from "@/assets/icons/IconHash.svg";
67+
---
68+
```
69+
70+
### Move to `pnpm`
71+
72+
AstroPaper has switched from `npm` to `pnpm`, which offers faster and more efficient package management.
73+
74+
### Replace icons/svg with Astro's Svg Component
75+
76+
AstroPaper v5 replaces inline SVGs with Astro’s experimental [SVG Component](https://docs.astro.build/en/reference/experimental-flags/svg/). This update reduces the need for predefined SVG code in the `socialIcons` object, making the codebase cleaner and more maintainable.
77+
78+
### Separate Constants and Config
79+
80+
The project structure has been reorganized. The `src/config.ts` file now only contains the `SITE` object, which holds the main configuration for the project. All constants, such as `LOCALE`, `SOCIALS`, and `SHARE_LINKS`, have been moved to the `src/constants.ts` file.
81+
82+
## Other notable changes
83+
84+
- The blog posts directory has been updated from `src/content/blog/` to `src/data/blog/`.
85+
- Conllection definitions file (`src/content/config.ts`) is now replaced with `src/content.config.ts`.
86+
- Various dependencies have been upgraded for improved performance and security.
87+
- Removed `IBM Plex Mono` font and switched to the default system mono font.
88+
- The `Go back` button logic has been updated. Now, instead of triggering the browser's history API, AstroPaper v5 uses the browser session to temporarily store the back URL. If no back URL exists in the session, it will redirect to the homepage.
89+
- There are some minor styles and layout changes as well.
90+
91+
## Outtro
92+
93+
AstroPaper v5 brings many changes, but the core experience remains the same. Enjoy a smoother, more efficient blogging platform while keeping the clean and minimal design that AstroPaper is known for!
94+
95+
Feel free to explore the changes and share your thoughts. As always, thank you for your support!
96+
97+
If you enjoy this theme, please consider starring the repo. You can also support me via GitHub Sponsors or you can buy me a coffee if you'd like. However, of course, these actions are entirely optional and not required.
98+
99+
Enjoy!
100+
101+
[Sat Naing](https://satnaing.dev/)

0 commit comments

Comments
 (0)