Skip to content

Commit 9174b20

Browse files
Copilotfulldecent
andcommitted
Fix prettier lint error and improve sitemap generation
Co-authored-by: fulldecent <382183+fulldecent@users.noreply.github.com>
1 parent 4f5cbee commit 9174b20

File tree

4 files changed

+245
-239
lines changed

4 files changed

+245
-239
lines changed

.github/workflows/build-test-deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ jobs:
4848
run: yarn install --immutable
4949

5050
- name: Generate sitemap
51+
env:
52+
# For repository named username.github.io, use https://username.github.io
53+
# For other repositories, use https://username.github.io/repository-name
54+
SITE_URL: ${{ github.event.repository.name == format('{0}.github.io', github.repository_owner) && format('https://{0}.github.io', github.repository_owner) || format('https://{0}.github.io/{1}', github.repository_owner, github.event.repository.name) }}
5155
run: yarn run generate-sitemap
5256
- name: Upload build artifact, ready for GitHub Pages deployment
5357
uses: actions/upload-pages-artifact@v3

.htmlvalidate.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ export default defineConfig({
77
"allowed-links": [
88
"error",
99
{
10-
"allowExternal": {
11-
"exclude": ["\\\\?utm_source=chatgpt.com", ".htm[l]?$"]
10+
allowExternal: {
11+
exclude: ["\\\\?utm_source=chatgpt.com", ".htm[l]?$"],
1212
},
13-
"allowRelative": {
14-
"exclude": [".htm[l]?$"]
13+
allowRelative: {
14+
exclude: [".htm[l]?$"],
1515
},
16-
"allowAbsolute": {
17-
"exclude": [".htm[l]?$"]
18-
}
19-
}
16+
allowAbsolute: {
17+
exclude: [".htm[l]?$"],
18+
},
19+
},
2020
],
2121
"pacific-medical-training/mailto-awesome": "error",
2222
"pacific-medical-training/external-links": "error",

scripts/generate-sitemap.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import path from "path";
33
import https from "https";
44
import { parseString } from "xml2js"; // Using xml2js for XML parsing
55

6-
const site = "https://www.acls.net";
6+
// Site URL configuration - can be overridden via SITE_URL environment variable
7+
// For GitHub Pages, this should typically be https://username.github.io/repository-name
8+
const site = process.env.SITE_URL || "https://www.acls.net";
79
const buildFolderPath = path.join(process.cwd(), "build");
810
const sitemapPath = path.join(buildFolderPath, "sitemap.xml");
911
const daysThreshold = 30; // Number of days to compare for updating lastmod

0 commit comments

Comments
 (0)