File tree Expand file tree Collapse file tree 6 files changed +20
-16
lines changed
Expand file tree Collapse file tree 6 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 2323 version : 10
2424 - uses : actions/setup-node@v4
2525 with :
26- node-version : 20
26+ node-version : 24
2727 cache : " pnpm"
2828 - name : Install dependencies
2929 run : pnpm install
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ export default defineConfig({
173173 editLink : {
174174 baseUrl : 'https://github.com/JamieMason/syncpack/edit/main/site/' ,
175175 } ,
176- favicon : '/favicon.ico ' ,
176+ favicon : '/logo.svg ' ,
177177 logo : {
178178 src : './src/assets/logo.svg' ,
179179 } ,
@@ -233,6 +233,13 @@ export default defineConfig({
233233 Head : './src/components/Head.astro' ,
234234 } ,
235235 head : [
236+ {
237+ tag : 'link' ,
238+ attrs : {
239+ rel : 'apple-touch-icon' ,
240+ href : '/syncpack/apple-touch-icon-180x180.png' ,
241+ } ,
242+ } ,
236243 {
237244 tag : 'script' ,
238245 attrs : {
Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises' ;
2+
3+ const sitemap = await fs . readFile ( 'dist/sitemap.xml' , 'utf8' ) ;
4+
5+ const urls = sitemap . match ( / < l o c > ( .* ?) < \/ l o c > / g) . map ( url => url . replace ( / < l o c > | < \/ l o c > / g, '' ) ) ;
6+
7+ await fs . writeFile ( 'dist/sitemap.txt' , `${ urls . join ( '\n' ) } \n` ) ;
Original file line number Diff line number Diff line change @@ -4,23 +4,13 @@ function patch_sitemap() {
44 # Remove the sitemap index file (we only have one sitemap)
55 rm dist/sitemap-index.xml
66 mv dist/sitemap-0.xml dist/sitemap.xml
7-
8- # Add lastmod dates to sitemap entries
9- # Use current date as lastmod for all entries since we don't track per-page dates
10- CURRENT_DATE=$( date -u +" %Y-%m-%d" )
11-
12- # Use sed with temp file (works on both macOS and Linux)
13- sed " s|</loc>|</loc><lastmod>${CURRENT_DATE} </lastmod>|g" dist/sitemap.xml > dist/sitemap.xml.tmp
14- mv dist/sitemap.xml.tmp dist/sitemap.xml
15- }
16-
17- function patch_link_rel_icon() {
18- # find rel="shortcut icon" and replace with rel="icon" in every html file in dist
7+ # create sitemap.txt
8+ node scripts/patch.js
9+ # replace sitemap.xml with sitemap.txt
1910 find dist -name " *.html" | while read -r file; do
20- sed " s|rel= \" shortcut icon \" |rel= \" icon \" |g" " $file " > " $file .tmp"
11+ sed " s|sitemap.xml|sitemap.txt |g" " $file " > " $file .tmp"
2112 mv " $file .tmp" " $file "
2213 done
2314}
2415
2516patch_sitemap
26- patch_link_rel_icon
You can’t perform that action at this time.
0 commit comments