@jet-w/astro-blog 0.1.6 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-6D3XRDNY.js +145 -0
- package/dist/chunk-A2E2VSAQ.js +246 -0
- package/dist/{chunk-GYLSY3OJ.js → chunk-TJTPX2WP.js} +1 -1
- package/dist/config/index.d.ts +3 -47
- package/dist/config/index.js +18 -2
- package/dist/i18n-PgMCFBw0.d.ts +222 -0
- package/dist/index.d.ts +204 -7
- package/dist/index.js +255 -3
- package/dist/integration.d.ts +9 -1
- package/dist/integration.js +2 -1
- package/dist/{sidebar-DNdiCKBw.d.ts → sidebar-Da-W_4Lr.d.ts} +1 -1
- package/dist/utils/sidebar.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/blog/FloatingToc.vue +11 -3
- package/src/components/blog/Hero.astro +17 -2
- package/src/components/blog/NavigationTabs.vue +46 -15
- package/src/components/blog/PostCard.astro +28 -10
- package/src/components/blog/RelatedPosts.astro +23 -7
- package/src/components/blog/TableOfContents.astro +10 -4
- package/src/components/blog/TagCloud.astro +4 -3
- package/src/components/home/FeaturedPostsSection.astro +22 -6
- package/src/components/home/QuickNavSection.astro +33 -4
- package/src/components/home/RecentPostsSection.astro +22 -6
- package/src/components/home/StatsSection.astro +24 -6
- package/src/components/layout/Footer.astro +36 -20
- package/src/components/layout/Header.astro +75 -17
- package/src/components/layout/Sidebar.astro +40 -25
- package/src/components/ui/LanguageSwitcher.vue +183 -0
- package/src/components/ui/SearchBox.vue +13 -5
- package/src/components/ui/SearchInterface.vue +49 -25
- package/src/layouts/BaseLayout.astro +77 -52
- package/src/layouts/PageLayout.astro +22 -27
- package/src/layouts/SlidesLayout.astro +14 -2
- package/src/pages/archives/[year]/[month].astro +36 -17
- package/src/pages/archives/index.astro +36 -20
- package/src/pages/categories/[category].astro +33 -16
- package/src/pages/categories/index.astro +37 -14
- package/src/pages/posts/[...slug].astro +125 -18
- package/src/pages/posts/index.astro +59 -37
- package/src/pages/posts/page/[page].astro +65 -27
- package/src/pages/rss.xml.ts +18 -6
- package/src/pages/search.astro +50 -14
- package/src/pages/slides/index.astro +25 -6
- package/src/pages/tags/[tag].astro +32 -15
- package/src/pages/tags/index.astro +39 -16
- package/src/plugins/remark-containers.mjs +351 -322
- package/src/plugins/remark-protect-code.mjs +69 -0
- package/src/styles/global.css +35 -1
- package/templates/default/.claude/ralph-loop.local.md +48 -0
- package/templates/default/astro.config.mjs +33 -4
- package/templates/default/content/posts/blog_docs_en/01.get-started/01-intro.md +81 -0
- package/templates/default/content/posts/blog_docs_en/01.get-started/02-install.md +137 -0
- package/templates/default/content/posts/blog_docs_en/01.get-started/03-create-post.md +176 -0
- package/templates/default/content/posts/blog_docs_en/01.get-started/04-structure.md +173 -0
- package/templates/default/content/posts/blog_docs_en/01.get-started/05-deploy.md +208 -0
- package/templates/default/content/posts/blog_docs_en/01.get-started/README.md +52 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/02-containers.md +245 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/03-code-blocks.md +207 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/03-mermaid.md +194 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/04-icons.md +229 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/06-latex.md +233 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/07-video.md +184 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/08-slides.md +359 -0
- package/templates/default/content/posts/blog_docs_en/02.guide/README.md +213 -0
- package/templates/default/content/posts/blog_docs_en/03.config/01-site.md +208 -0
- package/templates/default/content/posts/blog_docs_en/03.config/02-sidebar.md +240 -0
- package/templates/default/content/posts/blog_docs_en/03.config/03-i18n.md +349 -0
- package/templates/default/content/posts/blog_docs_en/03.config/README.md +85 -0
- package/templates/default/content/posts/blog_docs_en/README.md +79 -0
- package/templates/default/content/posts/blog_docs_zh/01.get-started/01-intro.md +81 -0
- package/templates/default/content/posts/blog_docs_zh/01.get-started/02-install.md +137 -0
- package/templates/default/content/posts/blog_docs_zh/01.get-started/03-create-post.md +176 -0
- package/templates/default/content/posts/blog_docs_zh/01.get-started/04-structure.md +173 -0
- package/templates/default/content/posts/blog_docs_zh/01.get-started/05-deploy.md +208 -0
- package/templates/default/content/posts/blog_docs_zh/01.get-started/README.md +52 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/02-containers.md +245 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/03-code-blocks.md +206 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/03-mermaid.md +194 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/04-icons.md +229 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/06-latex.md +233 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/07-video.md +184 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/08-slides.md +359 -0
- package/templates/default/content/posts/blog_docs_zh/02.guide/README.md +213 -0
- package/templates/default/content/posts/blog_docs_zh/03.config/01-site.md +208 -0
- package/templates/default/content/posts/blog_docs_zh/03.config/02-sidebar.md +240 -0
- package/templates/default/content/posts/blog_docs_zh/03.config/03-i18n.md +348 -0
- package/templates/default/content/posts/blog_docs_zh/03.config/README.md +85 -0
- package/templates/default/content/posts/blog_docs_zh/README.md +78 -0
- package/templates/default/package-lock.json +9667 -0
- package/templates/default/package.json +1 -1
- package/templates/default/src/config/footer.ts +14 -11
- package/templates/default/src/config/locales/en/footer.ts +17 -0
- package/templates/default/src/config/locales/en/index.ts +20 -0
- package/templates/default/src/config/locales/en/menu.ts +14 -0
- package/templates/default/src/config/locales/en/sidebar.ts +34 -0
- package/templates/default/src/config/locales/en/site.ts +7 -0
- package/templates/default/src/config/locales/en/ui.ts +29 -0
- package/templates/default/src/config/locales/index.ts +7 -0
- package/templates/default/src/config/locales/zh-CN/footer.ts +17 -0
- package/templates/default/src/config/locales/zh-CN/index.ts +20 -0
- package/templates/default/src/config/locales/zh-CN/menu.ts +14 -0
- package/templates/default/src/config/locales/zh-CN/sidebar.ts +34 -0
- package/templates/default/src/config/locales/zh-CN/site.ts +7 -0
- package/templates/default/src/config/locales/zh-CN/ui.ts +29 -0
- package/templates/default/src/config/sidebar.ts +10 -12
- package/templates/default/src/config/site.ts +2 -2
- package/templates/default/src/content.config.ts +15 -3
- package/templates/default/src/env.d.ts +7 -0
- package/dist/chunk-MQXPSOYB.js +0 -124
- package/templates/default/content/posts/blog_docs/01-quick-start.md +0 -162
- package/templates/default/content/posts/blog_docs/02-frontmatter.md +0 -277
- package/templates/default/content/posts/blog_docs/03-markdown-basic.md +0 -350
- package/templates/default/content/posts/blog_docs/04-containers.md +0 -331
- package/templates/default/content/posts/blog_docs/05-code-blocks.md +0 -388
- package/templates/default/content/posts/blog_docs/06-mermaid.md +0 -431
- package/templates/default/content/posts/blog_docs/07-video.md +0 -243
- package/templates/default/content/posts/blog_docs/08-latex.md +0 -382
- package/templates/default/content/posts/blog_docs/09-icons.md +0 -326
- package/templates/default/content/posts/blog_docs/10-sidebar.md +0 -445
- package/templates/default/content/posts/blog_docs/11-config.md +0 -334
- package/templates/default/content/posts/blog_docs/12-slides.mdx +0 -552
- package/templates/default/content/posts/blog_docs/README.md +0 -151
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Project Structure
|
|
3
|
+
description: Understand how files and folders are organized
|
|
4
|
+
pubDate: 2025-01-01
|
|
5
|
+
author: jet-w
|
|
6
|
+
categories:
|
|
7
|
+
- Documentation
|
|
8
|
+
tags:
|
|
9
|
+
- Getting Started
|
|
10
|
+
- Structure
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Project Structure
|
|
14
|
+
|
|
15
|
+
Understanding the project structure helps you know where to find and place files.
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
your-blog/
|
|
21
|
+
├── content/ # Your content
|
|
22
|
+
│ ├── posts/ # Blog posts
|
|
23
|
+
│ └── pages/ # Standalone pages
|
|
24
|
+
├── public/ # Static assets
|
|
25
|
+
│ ├── images/ # Images
|
|
26
|
+
│ └── videos/ # Videos
|
|
27
|
+
├── src/
|
|
28
|
+
│ ├── config/ # Configuration files
|
|
29
|
+
│ │ ├── locales/ # Language configs
|
|
30
|
+
│ │ ├── site.ts # Site settings
|
|
31
|
+
│ │ └── ...
|
|
32
|
+
│ └── ...
|
|
33
|
+
├── astro.config.mjs # Astro configuration
|
|
34
|
+
└── package.json # Dependencies
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Content Directory
|
|
38
|
+
|
|
39
|
+
This is where your content lives:
|
|
40
|
+
|
|
41
|
+
### posts/
|
|
42
|
+
|
|
43
|
+
Blog posts in Markdown or MDX format:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
content/posts/
|
|
47
|
+
├── hello-world.md # Individual post
|
|
48
|
+
├── tutorials/ # Category folder
|
|
49
|
+
│ ├── README.md # Category index
|
|
50
|
+
│ └── getting-started.md
|
|
51
|
+
└── blog_docs_en/ # Documentation
|
|
52
|
+
└── ...
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### pages/
|
|
56
|
+
|
|
57
|
+
Standalone pages like About, Contact:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
content/pages/
|
|
61
|
+
├── about.md # /about
|
|
62
|
+
└── contact.md # /contact
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Public Directory
|
|
66
|
+
|
|
67
|
+
Static files served directly:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
public/
|
|
71
|
+
├── images/ # Images
|
|
72
|
+
│ ├── avatar.jpg # /images/avatar.jpg
|
|
73
|
+
│ └── posts/ # Post images
|
|
74
|
+
├── videos/ # Videos
|
|
75
|
+
├── favicon.svg # Site favicon
|
|
76
|
+
└── robots.txt # SEO file
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
::: tip Direct Access
|
|
80
|
+
Files in `public/` are served at the root URL.
|
|
81
|
+
`public/images/cat.jpg` → `https://yoursite.com/images/cat.jpg`
|
|
82
|
+
:::
|
|
83
|
+
|
|
84
|
+
## Configuration Directory
|
|
85
|
+
|
|
86
|
+
Site configuration files:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
src/config/
|
|
90
|
+
├── locales/ # Language-specific configs
|
|
91
|
+
│ ├── en/ # English
|
|
92
|
+
│ │ ├── index.ts
|
|
93
|
+
│ │ ├── site.ts
|
|
94
|
+
│ │ ├── menu.ts
|
|
95
|
+
│ │ ├── footer.ts
|
|
96
|
+
│ │ └── sidebar.ts
|
|
97
|
+
│ └── zh-CN/ # Chinese
|
|
98
|
+
│ └── ...
|
|
99
|
+
├── site.ts # Default site config
|
|
100
|
+
├── menu.ts # Default menu
|
|
101
|
+
├── sidebar.ts # Sidebar settings
|
|
102
|
+
├── footer.ts # Footer settings
|
|
103
|
+
└── social.ts # Social links
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Key Configuration Files
|
|
107
|
+
|
|
108
|
+
### astro.config.mjs
|
|
109
|
+
|
|
110
|
+
Main Astro configuration:
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
export default defineConfig({
|
|
114
|
+
integrations: [
|
|
115
|
+
astroBlog({ i18n: i18nConfig }),
|
|
116
|
+
vue(),
|
|
117
|
+
tailwind(),
|
|
118
|
+
],
|
|
119
|
+
site: 'https://yourdomain.com',
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### src/config/site.ts
|
|
124
|
+
|
|
125
|
+
Site metadata:
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
export const siteConfig = {
|
|
129
|
+
title: 'My Blog',
|
|
130
|
+
description: 'A blog about...',
|
|
131
|
+
author: 'Your Name',
|
|
132
|
+
avatar: '/images/avatar.jpg',
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### src/config/menu.ts
|
|
137
|
+
|
|
138
|
+
Navigation links:
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
export const menu = [
|
|
142
|
+
{ name: 'Home', href: '/', icon: 'home' },
|
|
143
|
+
{ name: 'Posts', href: '/posts', icon: 'posts' },
|
|
144
|
+
{ name: 'About', href: '/about', icon: 'about' },
|
|
145
|
+
];
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## File Naming Conventions
|
|
149
|
+
|
|
150
|
+
| Type | Convention | Example |
|
|
151
|
+
|------|------------|---------|
|
|
152
|
+
| Posts | lowercase with dashes | `my-first-post.md` |
|
|
153
|
+
| Config | camelCase or kebab | `site.ts`, `menu.ts` |
|
|
154
|
+
| Images | descriptive names | `hero-banner.jpg` |
|
|
155
|
+
|
|
156
|
+
::: warning Avoid Spaces
|
|
157
|
+
Don't use spaces in filenames. Use dashes instead:
|
|
158
|
+
- ❌ `my first post.md`
|
|
159
|
+
- ✅ `my-first-post.md`
|
|
160
|
+
:::
|
|
161
|
+
|
|
162
|
+
## What Each Folder Does
|
|
163
|
+
|
|
164
|
+
| Folder | Purpose | You Should... |
|
|
165
|
+
|--------|---------|---------------|
|
|
166
|
+
| `content/posts/` | Blog posts | Add your articles here |
|
|
167
|
+
| `content/pages/` | Static pages | Add about, contact pages |
|
|
168
|
+
| `public/` | Static assets | Put images, files |
|
|
169
|
+
| `src/config/` | Settings | Customize your site |
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
Now you understand the structure! Let's learn how to [deploy your blog](./05-deploy).
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Deployment
|
|
3
|
+
description: Build and deploy your blog to GitHub Pages
|
|
4
|
+
pubDate: 2025-01-01
|
|
5
|
+
author: jet-w
|
|
6
|
+
categories:
|
|
7
|
+
- Documentation
|
|
8
|
+
tags:
|
|
9
|
+
- Getting Started
|
|
10
|
+
- Deployment
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Deployment
|
|
14
|
+
|
|
15
|
+
Time to share your blog with the world! This guide covers deploying to GitHub Pages.
|
|
16
|
+
|
|
17
|
+
## Build for Production
|
|
18
|
+
|
|
19
|
+
First, create a production build:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm run build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This creates a `dist/` folder with static files:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
dist/
|
|
29
|
+
├── index.html
|
|
30
|
+
├── posts/
|
|
31
|
+
│ └── hello-world/
|
|
32
|
+
│ └── index.html
|
|
33
|
+
├── assets/
|
|
34
|
+
│ ├── styles.css
|
|
35
|
+
│ └── scripts.js
|
|
36
|
+
└── ...
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Preview Locally
|
|
40
|
+
|
|
41
|
+
Test the build before deploying:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm run preview
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Visit `http://localhost:4321` to verify everything works.
|
|
48
|
+
|
|
49
|
+
## Deploy to GitHub Pages
|
|
50
|
+
|
|
51
|
+
### Step 1: Configure Astro
|
|
52
|
+
|
|
53
|
+
Update your `astro.config.mjs`:
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
import { defineConfig } from 'astro/config';
|
|
57
|
+
|
|
58
|
+
export default defineConfig({
|
|
59
|
+
site: 'https://username.github.io',
|
|
60
|
+
base: '/repo-name/', // Only if NOT using custom domain
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
::: tip Custom Domain
|
|
65
|
+
If using a custom domain (e.g., `myblog.com`), set `base: '/'` or remove it entirely.
|
|
66
|
+
:::
|
|
67
|
+
|
|
68
|
+
### Step 2: Create GitHub Actions Workflow
|
|
69
|
+
|
|
70
|
+
Create `.github/workflows/deploy.yml`:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
name: Deploy to GitHub Pages
|
|
74
|
+
|
|
75
|
+
on:
|
|
76
|
+
push:
|
|
77
|
+
branches: [main]
|
|
78
|
+
workflow_dispatch:
|
|
79
|
+
|
|
80
|
+
permissions:
|
|
81
|
+
contents: read
|
|
82
|
+
pages: write
|
|
83
|
+
id-token: write
|
|
84
|
+
|
|
85
|
+
concurrency:
|
|
86
|
+
group: "pages"
|
|
87
|
+
cancel-in-progress: false
|
|
88
|
+
|
|
89
|
+
jobs:
|
|
90
|
+
build:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
steps:
|
|
93
|
+
- name: Checkout
|
|
94
|
+
uses: actions/checkout@v4
|
|
95
|
+
|
|
96
|
+
- name: Setup Node
|
|
97
|
+
uses: actions/setup-node@v4
|
|
98
|
+
with:
|
|
99
|
+
node-version: 20
|
|
100
|
+
cache: 'npm'
|
|
101
|
+
|
|
102
|
+
- name: Install dependencies
|
|
103
|
+
run: npm ci
|
|
104
|
+
|
|
105
|
+
- name: Build
|
|
106
|
+
run: npm run build
|
|
107
|
+
|
|
108
|
+
- name: Upload artifact
|
|
109
|
+
uses: actions/upload-pages-artifact@v3
|
|
110
|
+
with:
|
|
111
|
+
path: dist/
|
|
112
|
+
|
|
113
|
+
deploy:
|
|
114
|
+
needs: build
|
|
115
|
+
runs-on: ubuntu-latest
|
|
116
|
+
environment:
|
|
117
|
+
name: github-pages
|
|
118
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
119
|
+
steps:
|
|
120
|
+
- name: Deploy to GitHub Pages
|
|
121
|
+
id: deployment
|
|
122
|
+
uses: actions/deploy-pages@v4
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Step 3: Enable GitHub Pages
|
|
126
|
+
|
|
127
|
+
1. Go to your repository on GitHub
|
|
128
|
+
2. Navigate to **Settings** → **Pages**
|
|
129
|
+
3. Under "Build and deployment", select **GitHub Actions** as the source
|
|
130
|
+
4. Push your code to the `main` branch
|
|
131
|
+
|
|
132
|
+
Your site will be available at `https://username.github.io/repo-name/`
|
|
133
|
+
|
|
134
|
+
### Step 4: Custom Domain (Optional)
|
|
135
|
+
|
|
136
|
+
To use a custom domain:
|
|
137
|
+
|
|
138
|
+
1. **Add CNAME file**: Create `public/CNAME` with your domain:
|
|
139
|
+
```
|
|
140
|
+
myblog.com
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
2. **Configure DNS**: Add these records at your domain registrar:
|
|
144
|
+
- **A records** (for apex domain like `myblog.com`):
|
|
145
|
+
```
|
|
146
|
+
185.199.108.153
|
|
147
|
+
185.199.109.153
|
|
148
|
+
185.199.110.153
|
|
149
|
+
185.199.111.153
|
|
150
|
+
```
|
|
151
|
+
- **CNAME record** (for `www` subdomain):
|
|
152
|
+
```
|
|
153
|
+
www -> username.github.io
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
3. **Update Astro config**:
|
|
157
|
+
```javascript
|
|
158
|
+
export default defineConfig({
|
|
159
|
+
site: 'https://myblog.com',
|
|
160
|
+
// No base needed for custom domain
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
4. **Enable in GitHub**: In repository Settings → Pages, add your custom domain
|
|
165
|
+
|
|
166
|
+
::: info SSL Certificate
|
|
167
|
+
GitHub automatically provisions a free SSL certificate. It may take up to 24 hours.
|
|
168
|
+
:::
|
|
169
|
+
|
|
170
|
+
## Deployment Checklist
|
|
171
|
+
|
|
172
|
+
Before deploying, verify:
|
|
173
|
+
|
|
174
|
+
- [ ] `npm run build` completes without errors
|
|
175
|
+
- [ ] `npm run preview` shows site correctly
|
|
176
|
+
- [ ] All links work (no broken links)
|
|
177
|
+
- [ ] Images load properly
|
|
178
|
+
- [ ] Meta tags are set (title, description)
|
|
179
|
+
- [ ] Favicon is configured
|
|
180
|
+
|
|
181
|
+
## Continuous Deployment
|
|
182
|
+
|
|
183
|
+
Once configured, your site updates automatically:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
git add .
|
|
187
|
+
git commit -m "Add new blog post"
|
|
188
|
+
git push origin main
|
|
189
|
+
# Site automatically updates in ~1-2 minutes!
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Other Deployment Options
|
|
193
|
+
|
|
194
|
+
This blog can be deployed to any static hosting platform:
|
|
195
|
+
|
|
196
|
+
- **Vercel** - Zero-config Astro support, global CDN
|
|
197
|
+
- **Netlify** - Easy setup with form handling
|
|
198
|
+
- **Cloudflare Pages** - Fast edge network, free tier
|
|
199
|
+
- **AWS S3 + CloudFront** - Scalable cloud hosting
|
|
200
|
+
- **Firebase Hosting** - Google's hosting platform
|
|
201
|
+
|
|
202
|
+
For detailed instructions on these platforms, refer to the [Astro Deployment Guides](https://docs.astro.build/en/guides/deploy/).
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
Congratulations! You've completed the Get Started guide.
|
|
207
|
+
|
|
208
|
+
Continue learning with the [Writing Guide](/posts/blog_docs_en/02.guide) to master content creation.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Get Started
|
|
3
|
+
description: Begin your journey with Astro Blog - from installation to deployment
|
|
4
|
+
pubDate: 2025-01-01
|
|
5
|
+
author: jet-w
|
|
6
|
+
categories:
|
|
7
|
+
- Documentation
|
|
8
|
+
tags:
|
|
9
|
+
- Getting Started
|
|
10
|
+
- Tutorial
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Get Started
|
|
14
|
+
|
|
15
|
+
Welcome! This guide will walk you through setting up your Astro Blog from scratch.
|
|
16
|
+
|
|
17
|
+
::: tip Who Is This For?
|
|
18
|
+
This tutorial is designed for beginners. Even if you're new to Astro or static site generators, you'll be able to follow along step by step.
|
|
19
|
+
:::
|
|
20
|
+
|
|
21
|
+
## Learning Path
|
|
22
|
+
|
|
23
|
+
Follow these chapters in order:
|
|
24
|
+
|
|
25
|
+
| Step | Chapter | What You'll Learn |
|
|
26
|
+
|------|---------|-------------------|
|
|
27
|
+
| 1 | [Introduction](./01-intro) | What Astro Blog is and its features |
|
|
28
|
+
| 2 | [Installation](./02-install) | Set up Node.js and install the project |
|
|
29
|
+
| 3 | [First Post](./03-create-post) | Write and publish your first article |
|
|
30
|
+
| 4 | [Project Structure](./04-structure) | Understand how files are organized |
|
|
31
|
+
| 5 | [Deployment](./05-deploy) | Build and deploy to the web |
|
|
32
|
+
|
|
33
|
+
## Prerequisites
|
|
34
|
+
|
|
35
|
+
Before starting, make sure you have:
|
|
36
|
+
|
|
37
|
+
- **Node.js 18+** installed on your computer
|
|
38
|
+
- A **code editor** (VS Code recommended)
|
|
39
|
+
- Basic familiarity with the **command line**
|
|
40
|
+
|
|
41
|
+
::: info Don't Have Node.js?
|
|
42
|
+
Download it from [nodejs.org](https://nodejs.org). Choose the LTS (Long Term Support) version.
|
|
43
|
+
:::
|
|
44
|
+
|
|
45
|
+
## Time Required
|
|
46
|
+
|
|
47
|
+
- **Quick setup**: ~5 minutes
|
|
48
|
+
- **Full tutorial**: ~30 minutes
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
Ready? Let's start with the [Introduction](./01-intro)!
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Containers
|
|
3
|
+
description: Use callout boxes for tips, warnings, and important information
|
|
4
|
+
pubDate: 2025-01-01
|
|
5
|
+
author: jet-w
|
|
6
|
+
categories:
|
|
7
|
+
- Documentation
|
|
8
|
+
tags:
|
|
9
|
+
- Markdown
|
|
10
|
+
- Containers
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Containers
|
|
14
|
+
|
|
15
|
+
Containers are special callout boxes that help highlight important information.
|
|
16
|
+
|
|
17
|
+
## Basic Syntax
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
::: type
|
|
21
|
+
Content goes here
|
|
22
|
+
:::
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Container Types
|
|
26
|
+
|
|
27
|
+
### Tip
|
|
28
|
+
|
|
29
|
+
For helpful suggestions:
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
::: tip
|
|
33
|
+
This is a helpful tip for the reader.
|
|
34
|
+
:::
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
<div class="container-tip custom-container" data-container-type="tip">
|
|
38
|
+
<div class="container-title">Tip</div>
|
|
39
|
+
<div class="container-content">
|
|
40
|
+
<p>This is a helpful tip for the reader.</p>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
### Info
|
|
45
|
+
|
|
46
|
+
For informational notes:
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
::: info
|
|
50
|
+
Here's some additional information.
|
|
51
|
+
:::
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
<div class="container-info custom-container" data-container-type="info">
|
|
55
|
+
<div class="container-title">Info</div>
|
|
56
|
+
<div class="container-content">
|
|
57
|
+
<p>Here's some additional information.</p>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
### Warning
|
|
62
|
+
|
|
63
|
+
For things to be careful about:
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
::: warning
|
|
67
|
+
Be careful with this operation.
|
|
68
|
+
:::
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
<div class="container-warning custom-container" data-container-type="warning">
|
|
72
|
+
<div class="container-title">Warning</div>
|
|
73
|
+
<div class="container-content">
|
|
74
|
+
<p>Be careful with this operation.</p>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
### Danger
|
|
79
|
+
|
|
80
|
+
For critical warnings:
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
::: danger
|
|
84
|
+
This action cannot be undone!
|
|
85
|
+
:::
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
<div class="container-danger custom-container" data-container-type="danger">
|
|
89
|
+
<div class="container-title">Danger</div>
|
|
90
|
+
<div class="container-content">
|
|
91
|
+
<p>This action cannot be undone!</p>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
### Note
|
|
96
|
+
|
|
97
|
+
For general notes:
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
::: note
|
|
101
|
+
A side note for the reader.
|
|
102
|
+
:::
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
<div class="container-note custom-container" data-container-type="note">
|
|
106
|
+
<div class="container-title">Note</div>
|
|
107
|
+
<div class="container-content">
|
|
108
|
+
<p>A side note for the reader.</p>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
## Custom Titles
|
|
113
|
+
|
|
114
|
+
Add a custom title after the type:
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
::: tip Pro Tip
|
|
118
|
+
This container has a custom title.
|
|
119
|
+
:::
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
<div class="container-tip custom-container" data-container-type="tip">
|
|
123
|
+
<div class="container-title">Pro Tip</div>
|
|
124
|
+
<div class="container-content">
|
|
125
|
+
<p>This container has a custom title.</p>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
::: warning Security Notice
|
|
131
|
+
Always validate user input!
|
|
132
|
+
:::
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
<div class="container-warning custom-container" data-container-type="warning">
|
|
136
|
+
<div class="container-title">Security Notice</div>
|
|
137
|
+
<div class="container-content">
|
|
138
|
+
<p>Always validate user input!</p>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
## Rich Content
|
|
143
|
+
|
|
144
|
+
Containers support full Markdown inside:
|
|
145
|
+
|
|
146
|
+
```markdown
|
|
147
|
+
::: info Features
|
|
148
|
+
This blog supports:
|
|
149
|
+
- **Markdown** formatting
|
|
150
|
+
- `Code` snippets
|
|
151
|
+
- [Links](https://example.com)
|
|
152
|
+
:::
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
<div class="container-info custom-container" data-container-type="info">
|
|
156
|
+
<div class="container-title">Features</div>
|
|
157
|
+
<div class="container-content">
|
|
158
|
+
<p>This blog supports:</p>
|
|
159
|
+
<ul>
|
|
160
|
+
<li><strong>Markdown</strong> formatting</li>
|
|
161
|
+
<li><code>Code</code> snippets</li>
|
|
162
|
+
<li><a href="https://example.com">Links</a></li>
|
|
163
|
+
</ul>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
## Details (Collapsible)
|
|
168
|
+
|
|
169
|
+
Create expandable sections:
|
|
170
|
+
|
|
171
|
+
```markdown
|
|
172
|
+
::: details Click to expand
|
|
173
|
+
This content is hidden by default.
|
|
174
|
+
You can put lots of content here.
|
|
175
|
+
:::
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
<details class="container-details custom-container" data-container-type="details">
|
|
179
|
+
<summary class="container-title">Click to expand</summary>
|
|
180
|
+
<div class="container-content">
|
|
181
|
+
<p>This content is hidden by default.</p>
|
|
182
|
+
<p>You can put lots of content here.</p>
|
|
183
|
+
</div>
|
|
184
|
+
</details>
|
|
185
|
+
|
|
186
|
+
### Details with Code
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
::: details View the solution
|
|
190
|
+
function solve() {
|
|
191
|
+
return 42;
|
|
192
|
+
}
|
|
193
|
+
:::
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
<details class="container-details custom-container" data-container-type="details">
|
|
197
|
+
<summary class="container-title">View the solution</summary>
|
|
198
|
+
<div class="container-content">
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
function solve() {
|
|
202
|
+
return 42;
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
</div>
|
|
207
|
+
</details>
|
|
208
|
+
|
|
209
|
+
## Best Practices
|
|
210
|
+
|
|
211
|
+
<div class="container-tip custom-container" data-container-type="tip">
|
|
212
|
+
<div class="container-title">When to Use Containers</div>
|
|
213
|
+
<div class="container-content">
|
|
214
|
+
<ul>
|
|
215
|
+
<li><strong>tip</strong> - Helpful suggestions, best practices</li>
|
|
216
|
+
<li><strong>info</strong> - Background information, context</li>
|
|
217
|
+
<li><strong>warning</strong> - Potential issues, things to watch</li>
|
|
218
|
+
<li><strong>danger</strong> - Critical errors, data loss risks</li>
|
|
219
|
+
<li><strong>note</strong> - General observations</li>
|
|
220
|
+
<li><strong>details</strong> - Optional content, long examples</li>
|
|
221
|
+
</ul>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div class="container-warning custom-container" data-container-type="warning">
|
|
226
|
+
<div class="container-title">Don't Overuse</div>
|
|
227
|
+
<div class="container-content">
|
|
228
|
+
<p>Too many containers can be distracting. Use them sparingly for truly important information.</p>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
## Quick Reference
|
|
233
|
+
|
|
234
|
+
| Type | Syntax | Use Case |
|
|
235
|
+
|------|--------|----------|
|
|
236
|
+
| tip | `::: tip` | Helpful suggestions |
|
|
237
|
+
| info | `::: info` | Additional information |
|
|
238
|
+
| warning | `::: warning` | Cautions |
|
|
239
|
+
| danger | `::: danger` | Critical warnings |
|
|
240
|
+
| note | `::: note` | Side notes |
|
|
241
|
+
| details | `::: details` | Collapsible content |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
Next: Master [Code Blocks](./03-code-blocks) for beautiful code snippets.
|