Skip to content

Commit 14d8d3c

Browse files
authored
Merge pull request #13 from dually8/add-toc
Add ToC and Anchor Links
2 parents 2320952 + 9b3852b commit 14d8d3c

18 files changed

+294
-92
lines changed

.github/workflows/firebase-hosting-merge.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: Use Node.js 20
15+
- name: Use Node.js 22
1616
uses: actions/setup-node@v4
1717
with:
18-
node-version: "20"
19-
cache: "npm"
20-
cache-dependency-path: "./package-lock.json"
18+
node-version: '22'
19+
cache: 'npm'
20+
cache-dependency-path: './package-lock.json'
2121

2222
- name: Install dependencies
2323
run: npm ci
@@ -27,7 +27,7 @@ jobs:
2727

2828
- uses: FirebaseExtended/action-hosting-deploy@v0.9.0
2929
with:
30-
repoToken: "${{ secrets.GITHUB_TOKEN }}"
31-
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_MYWEBSITE_555F6 }}"
30+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
31+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_MYWEBSITE_555F6 }}'
3232
channelId: live
3333
projectId: mywebsite-555f6

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore markdown
2+
*.md
3+
*.mdx

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"typescript.tsdk": "node_modules/typescript/lib"
3-
}
3+
}

astro.config.mjs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
3+
import remarkToc from 'remark-toc';
34
import mdx from '@astrojs/mdx';
45
import sitemap from '@astrojs/sitemap';
56
import svelte from '@astrojs/svelte';
7+
import rehypeSlug from 'rehype-slug';
8+
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
69

710
// https://astro.build/config
811
export default defineConfig({
912
site: 'https://cjcoffey.com',
10-
integrations: [mdx(), sitemap({
11-
filter: filterSitemap,
12-
}), svelte()],
13+
integrations: [
14+
mdx(),
15+
sitemap({
16+
filter: filterSitemap,
17+
}),
18+
svelte(),
19+
],
1320
prefetch: true,
1421
markdown: {
22+
remarkPlugins: [remarkToc],
23+
rehypePlugins: [
24+
rehypeSlug,
25+
[
26+
rehypeAutolinkHeadings,
27+
{
28+
behavior: 'wrap',
29+
},
30+
],
31+
],
1532
shikiConfig: {
1633
theme: 'dracula-soft',
1734
wrap: true,
18-
}
35+
},
1936
},
2037
experimental: {
2138
svg: true,
22-
}
39+
},
2340
});
2441

2542
/**

firebase.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"hosting": {
33
"public": "dist",
4-
"ignore": [
5-
"firebase.json",
6-
"**/.*",
7-
"**/node_modules/**"
8-
]
4+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
95
}
106
}

package-lock.json

Lines changed: 148 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"test:e2e": "playwright test",
1414
"test:e2e:ui": "playwright test --ui",
1515
"test:report": "playwright show-report",
16-
"precommit": "npm run clean && npm run astro:check && npm run test:e2e && npm run build",
16+
"format": "npx prettier . --write",
17+
"precommit": "npm run clean && npm run format && npm run astro:check && npm run test:e2e && npm run build",
1718
"generate-images": "tsx ./scripts/generate-apple-icons.ts ./public/img/avatar.png ./public/img/"
1819
},
1920
"dependencies": {
@@ -25,12 +26,17 @@
2526
"@picocss/pico": "^2.0.6",
2627
"astro": "^5.1.1",
2728
"dayjs": "^1.11.13",
29+
"rehype-autolink-headings": "^7.1.0",
30+
"rehype-slug": "^6.0.0",
31+
"remark-toc": "^9.0.0",
2832
"svelte": "^5.14.0",
2933
"typescript": "^5.7.2"
3034
},
3135
"devDependencies": {
3236
"@playwright/test": "^1.49.1",
3337
"@types/node": "^22.10.2",
38+
"prettier": "3.4.2",
39+
"prettier-plugin-astro": "0.14.1",
3440
"rimraf": "^6.0.1",
3541
"sharp": "^0.33.5",
3642
"tsx": "^4.19.2"

prettier.config.mjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @see https://prettier.io/docs/en/configuration.html
3+
* @type {import("prettier").Config}
4+
*/
5+
export default {
6+
arrowParens: 'always',
7+
bracketSameLine: true,
8+
bracketSpacing: true,
9+
embeddedLanguageFormatting: 'auto',
10+
htmlWhitespaceSensitivity: 'ignore',
11+
insertPragma: false,
12+
jsxSingleQuote: false,
13+
printWidth: 120,
14+
proseWrap: 'preserve',
15+
quoteProps: 'preserve',
16+
requirePragma: false,
17+
semi: true,
18+
singleAttributePerLine: true,
19+
singleQuote: true,
20+
tabWidth: 2,
21+
trailingComma: 'all',
22+
useTabs: false,
23+
vueIndentScriptAndStyle: false,
24+
plugins: ['prettier-plugin-astro'],
25+
overrides: [
26+
{
27+
files: '*.astro',
28+
options: {
29+
parser: 'astro',
30+
},
31+
},
32+
],
33+
};

0 commit comments

Comments
 (0)