Skip to content

Commit 6a5d550

Browse files
author
Yanbin Zhu
committed
feat(*): init
0 parents  commit 6a5d550

File tree

105 files changed

+18547
-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.

105 files changed

+18547
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
// 本项目不使用devcontainer,此文件为原始模版自带,不做删除处理,留待后续使用
3+
"name":"blog",
4+
// 若需要自己构建image,则需要将image改为build,并指定构建镜像的Dockerfile。
5+
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:20",
6+
"hostRequirements": {
7+
"memory": "8gb"
8+
},
9+
"waitFor": "onCreateCommand",
10+
"updateContentCommand": "yarn",
11+
"postCreateCommand": "",
12+
"postAttachCommand": "yarn dev",
13+
"customizations": {
14+
// "codespaces": {
15+
// "openFiles": ["data/blog/code-sample.mdx"]
16+
// },
17+
"vscode": {
18+
"settings": {
19+
"editor.formatOnSave": true
20+
},
21+
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
22+
}
23+
},
24+
"portsAttributes": {
25+
"3000": {
26+
"label": "Nextjs server",
27+
"onAutoForward": "openPreview"
28+
}
29+
},
30+
"forwardPorts": [3000]
31+
}

.env.example

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# visit https://giscus.app to get your Giscus ids
2+
NEXT_PUBLIC_GISCUS_REPO=
3+
NEXT_PUBLIC_GISCUS_REPOSITORY_ID=
4+
NEXT_PUBLIC_GISCUS_CATEGORY=
5+
NEXT_PUBLIC_GISCUS_CATEGORY_ID=
6+
NEXT_PUBLIC_UTTERANCES_REPO=
7+
NEXT_PUBLIC_DISQUS_SHORTNAME=
8+
9+
10+
MAILCHIMP_API_KEY=
11+
MAILCHIMP_API_SERVER=
12+
MAILCHIMP_AUDIENCE_ID=
13+
14+
BUTTONDOWN_API_KEY=
15+
16+
CONVERTKIT_API_KEY=
17+
# curl https://api.convertkit.com/v3/forms?api_key=<your_public_api_key> to get your form ID
18+
CONVERTKIT_FORM_ID=
19+
20+
KLAVIYO_API_KEY=
21+
KLAVIYO_LIST_ID=
22+
23+
REVUE_API_KEY=
24+
25+
# Create EmailOctopus API key at https://emailoctopus.com/api-documentation
26+
EMAILOCTOPUS_API_KEY=
27+
# List ID can be found in the URL as a UUID after clicking a list on https://emailoctopus.com/lists
28+
# or the settings page of your list https://emailoctopus.com/lists/{UUID}/settings
29+
EMAILOCTOPUS_LIST_ID=

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.eslintrc.js

.eslintrc.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
env: {
5+
browser: true,
6+
amd: true,
7+
node: true,
8+
es6: true,
9+
},
10+
plugins: ['@typescript-eslint'],
11+
extends: [
12+
'eslint:recommended',
13+
'plugin:@typescript-eslint/eslint-recommended',
14+
'plugin:@typescript-eslint/recommended',
15+
'plugin:jsx-a11y/recommended',
16+
'plugin:prettier/recommended',
17+
'next',
18+
'next/core-web-vitals',
19+
],
20+
parserOptions: {
21+
project: true,
22+
tsconfigRootDir: __dirname,
23+
},
24+
rules: {
25+
'prettier/prettier': 'error',
26+
'react/react-in-jsx-scope': 'off',
27+
'jsx-a11y/anchor-is-valid': [
28+
'error',
29+
{
30+
components: ['Link'],
31+
specialLink: ['hrefLeft', 'hrefRight'],
32+
aspects: ['invalidHref', 'preferButton'],
33+
},
34+
],
35+
'react/prop-types': 0,
36+
'@typescript-eslint/no-unused-vars': 0,
37+
'react/no-unescaped-entities': 0,
38+
'@typescript-eslint/explicit-module-boundary-types': 'off',
39+
'@typescript-eslint/no-var-requires': 'off',
40+
'@typescript-eslint/ban-ts-comment': 'off',
41+
},
42+
}

.gitattributes

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
## Source: https://github.com/alexkaratarakis/gitattributes
2+
## Modified * text=auto to * text=auto eol=lf eol=lf to force LF endings.
3+
4+
## GITATTRIBUTES FOR WEB PROJECTS
5+
#
6+
# These settings are for any web project.
7+
#
8+
# Details per file setting:
9+
# text These files should be normalized (i.e. convert CRLF to LF).
10+
# binary These files are binary and should be left untouched.
11+
#
12+
# Note that binary is a macro for -text -diff.
13+
######################################################################
14+
15+
# Auto detect
16+
## Force LF line endings automatically for files detected as
17+
## text and leave all files detected as binary untouched.
18+
## This will handle all files NOT defined below.
19+
* text=auto eol=lf
20+
21+
# Source code
22+
*.bash text eol=lf
23+
*.bat text eol=crlf
24+
*.cmd text eol=crlf
25+
*.coffee text
26+
*.css text
27+
*.htm text diff=html
28+
*.html text diff=html
29+
*.inc text
30+
*.ini text
31+
*.js text
32+
*.json text
33+
*.jsx text
34+
*.less text
35+
*.ls text
36+
*.map text -diff
37+
*.od text
38+
*.onlydata text
39+
*.php text diff=php
40+
*.pl text
41+
*.ps1 text eol=crlf
42+
*.py text diff=python
43+
*.rb text diff=ruby
44+
*.sass text
45+
*.scm text
46+
*.scss text diff=css
47+
*.sh text eol=lf
48+
*.sql text
49+
*.styl text
50+
*.tag text
51+
*.ts text
52+
*.tsx text
53+
*.xml text
54+
*.xhtml text diff=html
55+
56+
# Docker
57+
Dockerfile text
58+
59+
# Documentation
60+
*.ipynb text
61+
*.markdown text
62+
*.md text
63+
*.mdwn text
64+
*.mdown text
65+
*.mkd text
66+
*.mkdn text
67+
*.mdtxt text
68+
*.mdtext text
69+
*.txt text
70+
AUTHORS text
71+
CHANGELOG text
72+
CHANGES text
73+
CONTRIBUTING text
74+
COPYING text
75+
copyright text
76+
*COPYRIGHT* text
77+
INSTALL text
78+
license text
79+
LICENSE text
80+
NEWS text
81+
readme text
82+
*README* text
83+
TODO text
84+
85+
# Templates
86+
*.dot text
87+
*.ejs text
88+
*.haml text
89+
*.handlebars text
90+
*.hbs text
91+
*.hbt text
92+
*.jade text
93+
*.latte text
94+
*.mustache text
95+
*.njk text
96+
*.phtml text
97+
*.tmpl text
98+
*.tpl text
99+
*.twig text
100+
*.vue text
101+
102+
# Configs
103+
*.cnf text
104+
*.conf text
105+
*.config text
106+
.editorconfig text
107+
.env text
108+
.gitattributes text
109+
.gitconfig text
110+
.htaccess text
111+
*.lock text -diff
112+
package-lock.json text -diff
113+
*.toml text
114+
*.yaml text
115+
*.yml text
116+
browserslist text
117+
Makefile text
118+
makefile text
119+
120+
# Heroku
121+
Procfile text
122+
123+
# Graphics
124+
*.ai binary
125+
*.bmp binary
126+
*.eps binary
127+
*.gif binary
128+
*.gifv binary
129+
*.ico binary
130+
*.jng binary
131+
*.jp2 binary
132+
*.jpg binary
133+
*.jpeg binary
134+
*.jpx binary
135+
*.jxr binary
136+
*.pdf binary
137+
*.png binary
138+
*.psb binary
139+
*.psd binary
140+
# SVG treated as an asset (binary) by default.
141+
*.svg text
142+
# If you want to treat it as binary,
143+
# use the following line instead.
144+
# *.svg binary
145+
*.svgz binary
146+
*.tif binary
147+
*.tiff binary
148+
*.wbmp binary
149+
*.webp binary
150+
151+
# Audio
152+
*.kar binary
153+
*.m4a binary
154+
*.mid binary
155+
*.midi binary
156+
*.mp3 binary
157+
*.ogg binary
158+
*.ra binary
159+
160+
# Video
161+
*.3gpp binary
162+
*.3gp binary
163+
*.as binary
164+
*.asf binary
165+
*.asx binary
166+
*.fla binary
167+
*.flv binary
168+
*.m4v binary
169+
*.mng binary
170+
*.mov binary
171+
*.mp4 binary
172+
*.mpeg binary
173+
*.mpg binary
174+
*.ogv binary
175+
*.swc binary
176+
*.swf binary
177+
*.webm binary
178+
179+
# Archives
180+
*.7z binary
181+
*.gz binary
182+
*.jar binary
183+
*.rar binary
184+
*.tar binary
185+
*.zip binary
186+
187+
# Fonts
188+
*.ttf binary
189+
*.eot binary
190+
*.otf binary
191+
*.woff binary
192+
*.woff2 binary
193+
194+
# Executables
195+
*.exe binary
196+
*.pyc binary
197+
198+
# RC files (like .babelrc or .eslintrc)
199+
*.*rc text
200+
201+
# Ignore files (like .npmignore or .gitignore)
202+
*.*ignore text

.github/workflows/pages.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Inspired from https://github.com/actions/starter-workflows/blob/main/pages/nextjs.yml
2+
name: GitHub Pages
3+
4+
on:
5+
push:
6+
branches: main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: 'pages'
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
cache: yarn
27+
- id: configurepages
28+
uses: actions/configure-pages@v5
29+
- name: Restore cache
30+
uses: actions/cache@v4
31+
with:
32+
path: .next/cache
33+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
34+
restore-keys: |
35+
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
36+
- run: yarn
37+
- run: yarn build
38+
env:
39+
EXPORT: 1
40+
UNOPTIMIZED: 1
41+
BASE_PATH: ${{ steps.configurepages.outputs.base_path }}
42+
- uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: ./out
45+
46+
# Deployment job
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- id: deployment
55+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)