Skip to content

Commit c4a780f

Browse files
authoredMar 4, 2023
Merge pull request #59 from ansidev/release/2.2.0
Release v2.2.0
2 parents 355ccf3 + 50b257a commit c4a780f

17 files changed

+996
-541
lines changed
 

‎.changes/v2.2.0.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## [v2.2.0](https://github.com/ansidev/astro-basic-template/compare/v2.1.0...v2.2.0) (2023-03-04)
2+
3+
### Features
4+
5+
- Change website font to Inter.
6+
- Add meta fields for SEO.
7+
- Generate post thumbnail using [satori](https://github.com/vercel/satori).
8+
9+
Full Changelog: [v2.1.0...v2.2.0](https://github.com/ansidev/astro-basic-template/compare/v2.1.0...v2.2.0)

‎CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
66

7+
## [v2.2.0](https://github.com/ansidev/astro-basic-template/compare/v2.1.0...v2.2.0) (2023-03-04)
8+
9+
### Features
10+
11+
- Change website font to Inter.
12+
- Add meta fields for SEO.
13+
- Generate post thumbnail using [satori](https://github.com/vercel/satori).
14+
15+
Full Changelog: [v2.1.0...v2.2.0](https://github.com/ansidev/astro-basic-template/compare/v2.1.0...v2.2.0)
16+
717
## [v2.1.0](https://github.com/ansidev/astro-basic-template/compare/v2.0.1...v2.1.0) (2023-03-01)
818

919
### Bug Fixes

‎README.md

+65-10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Solutions for LeetCode problems - Written by [ansidev](https://github.com/anside
88
## Features
99

1010
- [Astro](https://astro.build) v2, disabled Astro Telemetry.
11+
- Automate generating post thumbnail using [satori](https://github.com/vercel/satori) (since [v2.2.0](https://github.com/ansidev/leetcode-blog/releases/tag/v2.2.0)).
1112
- [Astro Compress](https://github.com/astro-community/astro-compress) - Compress output HTML, CSS, JS, image.
1213
- [Astro PurgeCSS](https://github.com/codiume/orbit/tree/main/packages/astro-purgecss) - Remove unused CSS from build output.
1314
- Automate releasing new versions using [GitHub Actions](https://github.com/features/actions) and following the [`git-flow`](https://nvie.com/posts/a-successful-git-branching-model/) branching model.
@@ -20,6 +21,7 @@ Solutions for LeetCode problems - Written by [ansidev](https://github.com/anside
2021
- [Conventional commit](https://conventionalcommits.org/).
2122
- [ESLint](https://eslint.org) - Static code analyzer.
2223
- [Prettier](https://prettier.io) - Code formatter.
24+
- [Husky](https://github.com/typicode/husky) - Modern native Git hooks made easy.
2325
- [Renovate](https://www.mend.io/free-developer-tools/renovate/) - Automate dependency updates.
2426
- [changie](https://changie.dev), [git-chglog](https://github.com/git-chglog/git-chglog) - Generate changelog from conventional commits.
2527
- [taskfile](https://github.com/ansidev/taskfile) - Task files for common tasks.
@@ -54,10 +56,10 @@ pnpm create astro@latest --template ansidev/astro-basic-template
5456
- https://docs.netlify.com/site-deploys/overview/#deploy-preview-controls
5557
3. Go to https://github.com/{user}/{repository}/settings/secrets/actions/new and add following repository secrets:
5658

57-
| Name | Description |
58-
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
59-
| `GH_TOKEN` | GitHub Personal Access Token which has the `repo` scope. Click [here](https://github.com/settings/tokens/new?scopes=repo) to create a new one. |
60-
| `NETLIFY_AUTH_TOKEN` | Netlify Authentication Token. Click [here](https://app.netlify.com/user/applications/personal) to create a new one. |
59+
| Name | Description |
60+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61+
| `GH_TOKEN` | GitHub Personal Access Token which has the `repo` scope. Click [here](https://github.com/settings/tokens/new?scopes=repo) to create a new one. |
62+
| `NETLIFY_AUTH_TOKEN` | Netlify Authentication Token. Click [here](https://app.netlify.com/user/applications/personal) to create a new one. |
6163
| `NETLIFY_SITE_ID` | Netlify site ID. You can obtain it via UI or CLI.<br/><ul><li>UI: Go to https://app.netlify.com/sites/{netlify-site-name}/settings/general#site-details and click the copy button next to the site ID.</li><li>CLI: Run `netlify sites:list` and copy the site ID.</li></ul> |
6264

6365
## Project Structure
@@ -68,6 +70,9 @@ Inside of your Astro project, you'll see the following folders and files:
6870

6971
```
7072
/
73+
./
74+
├── .astro
75+
│ └── types.d.ts
7176
├── .changes
7277
│ ├── unreleased
7378
│ │ └── .gitkeep
@@ -97,6 +102,7 @@ Inside of your Astro project, you'll see the following folders and files:
97102
│ ├── task_dep.yaml
98103
│ ├── task_git.yaml
99104
│ ├── task_github.yaml
105+
│ ├── task_leetcode.yaml
100106
│ ├── task_release.yaml
101107
│ └── task_site.yaml
102108
├── .vscode
@@ -107,24 +113,73 @@ Inside of your Astro project, you'll see the following folders and files:
107113
├── LICENSE
108114
├── README.md
109115
├── Taskfile.yaml
110-
├── astro-basic-template.code-workspace
111116
├── astro.config.mjs
112117
├── dotenv.config.ts
113118
├── eslint.config.cjs
114119
├── netlify.toml
115120
├── package.json
116121
├── pnpm-lock.yaml
117122
├── public
118-
│ └── favicon.svg
123+
│ ├── default-post-thumbnail.png
124+
│ └── favicon.ico
119125
├── renovate.json
120126
├── src
127+
│ ├── assets
128+
│ │ └── scss
129+
│ │ ├── _base.scss
130+
│ │ ├── _styles.scss
131+
│ │ └── app.scss
132+
│ ├── cmd
133+
│ │ └── leetcode.ts
121134
│ ├── components
122-
│ │ └── Card.astro
135+
│ │ ├── AppFooter.astro
136+
│ │ ├── AppHeader.astro
137+
│ │ ├── Breadcrumb.astro
138+
│ │ ├── Disqus.astro
139+
│ │ ├── Icon.astro
140+
│ │ ├── LeetCodeDifficulty.astro
141+
│ │ ├── SEOMeta.astro
142+
│ │ ├── ThemeSelector.astro
143+
│ │ ├── analytics
144+
│ │ │ ├── CounterAnalytics.astro
145+
│ │ │ ├── GoogleAnalytics.astro
146+
│ │ │ └── Swetrix.astro
147+
│ │ └── post
148+
│ │ ├── PostHeader.astro
149+
│ │ ├── PostItem.astro
150+
│ │ └── PostList.astro
151+
│ ├── configs
152+
│ │ └── site.ts
153+
│ ├── content
154+
│ │ ├── config.ts
155+
│ │ └── leetcode-solutions
156+
│ │ ├── *.md
123157
│ ├── env.d.ts
124158
│ ├── layouts
125-
│ │ └── Layout.astro
126-
│ └── pages
127-
│ └── index.astro
159+
│ │ ├── AppLayout.astro
160+
│ │ └── PostLayout.astro
161+
│ ├── leetcode
162+
│ │ ├── data
163+
│ │ │ └── problem_set.json
164+
│ │ ├── templates
165+
│ │ │ └── leetcode.md.mustache
166+
│ │ └── types.ts
167+
│ ├── pages
168+
│ │ ├── 404.astro
169+
│ │ ├── [slug].astro
170+
│ │ ├── difficulties
171+
│ │ │ └── [slug].astro
172+
│ │ ├── images
173+
│ │ │ └── [slug].png.ts
174+
│ │ ├── index.astro
175+
│ │ ├── rss.xml.ts
176+
│ │ └── tags
177+
│ │ └── [slug].astro
178+
│ └── utils
179+
│ ├── date.ts
180+
│ └── plugin.ts
181+
├── tailwind.config.cjs
182+
├── theme.config.cjs
128183
└── tsconfig.json
129184
```
130185

‎astro.config.mjs

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import fs from 'node:fs'
2+
13
import partytown from '@astrojs/partytown'
24
import sitemap from '@astrojs/sitemap'
35
import tailwind from '@astrojs/tailwind'
@@ -29,5 +31,29 @@ export default defineConfig({
2931
sitemap(),
3032
purgecss(),
3133
compress(),
32-
]
34+
],
35+
vite: {
36+
plugins: [rawFonts(['.ttf', '.woff'])],
37+
optimizeDeps: {
38+
exclude: [
39+
'@resvg/resvg-js',
40+
],
41+
},
42+
}
3343
})
44+
45+
// vite plugin to import fonts
46+
function rawFonts(ext) {
47+
return {
48+
name: 'vite-plugin-raw-fonts',
49+
transform(_, id) {
50+
if (ext.some((e) => id.endsWith(e))) {
51+
const buffer = fs.readFileSync(id)
52+
return {
53+
code: `export default ${JSON.stringify(buffer)}`,
54+
map: null,
55+
}
56+
}
57+
},
58+
}
59+
}

‎package.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "leetcode-blog",
33
"description": "Solutions for LeetCode problems - Written by ansidev",
44
"type": "module",
5-
"version": "2.1.0",
5+
"version": "2.2.0",
66
"license": "MIT",
77
"scripts": {
88
"lc:new": "tsx ./src/cmd/leetcode.ts",
@@ -20,20 +20,22 @@
2020
"@astrojs/rss": "^2.1.1",
2121
"@astrojs/sitemap": "^1.1.0",
2222
"@astrojs/tailwind": "^3.0.1",
23-
"astro": "^2.0.16",
23+
"astro": "^2.0.17",
2424
"astro-compress": "^1.1.35",
25-
"astro-purgecss": "^2.0.0",
25+
"astro-purgecss": "^2.0.1",
2626
"tailwindcss": "^3.2.7"
2727
},
2828
"devDependencies": {
2929
"@commitlint/cli": "^17.4.4",
3030
"@commitlint/config-conventional": "^17.4.4",
31+
"@fontsource/ibm-plex-mono": "^4.5.13",
3132
"@iconify-json/bi": "^1.1.15",
33+
"@resvg/resvg-js": "^2.4.1",
3234
"@tailwindcss/typography": "^0.5.9",
3335
"@types/lodash.get": "^4.4.7",
3436
"@types/lodash.kebabcase": "^4.1.7",
3537
"@types/mustache": "^4.2.2",
36-
"@types/node": "^18.14.2",
38+
"@types/node": "^18.14.6",
3739
"@typescript-eslint/eslint-plugin": "^5.54.0",
3840
"@typescript-eslint/parser": "^5.54.0",
3941
"commander": "^10.0.0",
@@ -48,6 +50,8 @@
4850
"lodash.kebabcase": "^4.1.1",
4951
"mustache": "^4.2.0",
5052
"sass": "^1.58.3",
53+
"satori": "^0.4.1",
54+
"satori-html": "^0.3.2",
5155
"tailwindcss-themer": "^3.0.1",
5256
"tsx": "^3.12.3",
5357
"typescript": "^4.9.5"

0 commit comments

Comments
 (0)
Please sign in to comment.