Skip to content

Commit dd65781

Browse files
committed
init: project init
0 parents  commit dd65781

File tree

118 files changed

+30271
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+30271
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PUBLIC_SITE_URL=http://localhost:3000

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
3+
*.{ico,png,jpg,jpeg,gif,webp,svg,woff,woff2} binary

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy Project
2+
3+
on:
4+
push:
5+
branches: main
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 24
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.13.1
23+
24+
# pnpm cache
25+
- name: Get pnpm store directory
26+
shell: bash
27+
run: |
28+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
29+
30+
- name: Setup pnpm cache
31+
uses: actions/cache@v4
32+
with:
33+
path: ${{ env.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: |
36+
${{ runner.os }}-pnpm-store-
37+
38+
# Install and build
39+
- name: Install dependencies
40+
run: pnpm install --frozen-lockfile --ignore-scripts
41+
42+
- name: Build project
43+
env:
44+
PUBLIC_SITE_URL: ${{ secrets.PUBLIC_SITE_URL }}
45+
run: pnpm run build
46+
47+
- name: Copy file via ssh key
48+
uses: appleboy/[email protected]
49+
with:
50+
host: ${{ secrets.SSH_HOST }}
51+
username: ${{ secrets.SSH_USER }}
52+
key: ${{ secrets.SSH_PRIVATE_KEY }}
53+
source: dist
54+
target: ${{ secrets.BLOG_PATH_REMOTE }}
55+
rm: true

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/
25+
26+
# pagefind
27+
28+
public/pagefind

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx", "biomejs.biome"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

.vscode/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll.biome": "explicit"
5+
},
6+
"editor.formatOnSave": true,
7+
"[typescript]": {
8+
"editor.defaultFormatter": "biomejs.biome"
9+
},
10+
"[javascript]": {
11+
"editor.defaultFormatter": "biomejs.biome"
12+
},
13+
"[json]": {
14+
"editor.defaultFormatter": "biomejs.biome"
15+
},
16+
"[jsonc]": {
17+
"editor.defaultFormatter": "biomejs.biome"
18+
},
19+
"[css]": {
20+
"editor.defaultFormatter": "biomejs.biome"
21+
},
22+
"[astro]": {
23+
"editor.defaultFormatter": "biomejs.biome"
24+
}
25+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Power by [astro](https://astro.build). Theme provider by [AstroPaper](https://github.com/satnaing/astro-paper). Thanks!

astro.config.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import mdx from "@astrojs/mdx";
2+
import sitemap from "@astrojs/sitemap";
3+
import {
4+
transformerNotationDiff,
5+
transformerNotationHighlight,
6+
transformerNotationWordHighlight,
7+
} from "@shikijs/transformers";
8+
import tailwindcss from "@tailwindcss/vite";
9+
import { defineConfig } from "astro/config";
10+
import remarkCollapse from "remark-collapse";
11+
import remarkToc from "remark-toc";
12+
import { loadEnv } from "vite";
13+
import { transformerFileName } from "./src/utils/transformers/fileName";
14+
15+
// https://github.com/withastro/astro/issues/12667
16+
// https://docs.astro.build/en/guides/environment-variables/#in-the-astro-config-file
17+
const env = loadEnv(process.env.NODE_ENV || "", process.cwd(), "");
18+
19+
// https://astro.build/config
20+
export default defineConfig({
21+
site: env.PUBLIC_SITE_URL,
22+
integrations: [sitemap(), mdx()],
23+
devToolbar: {
24+
enabled: false,
25+
},
26+
markdown: {
27+
remarkPlugins: [remarkToc, [remarkCollapse, { test: "Table of contents" }]],
28+
shikiConfig: {
29+
// For more themes, visit https://shiki.style/themes
30+
themes: { light: "min-light", dark: "night-owl" },
31+
defaultColor: false,
32+
wrap: false,
33+
transformers: [
34+
transformerFileName({ style: "v2", hideDot: false }),
35+
transformerNotationHighlight(),
36+
transformerNotationWordHighlight(),
37+
transformerNotationDiff({ matchAlgorithm: "v3" }),
38+
],
39+
},
40+
},
41+
vite: {
42+
plugins: [
43+
// https://github.com/withastro/astro/issues/14030
44+
tailwindcss(),
45+
],
46+
},
47+
});

0 commit comments

Comments
 (0)