Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
run: yarn install --immutable

- name: Generate sitemap
env:
# For repository named username.github.io, use https://username.github.io
# For other repositories, use https://username.github.io/repository-name
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) }}
run: yarn run generate-sitemap
- name: Upload build artifact, ready for GitHub Pages deployment
uses: actions/upload-pages-artifact@v3
Expand Down
14 changes: 14 additions & 0 deletions .htmlvalidate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ export default defineConfig({
plugins: ["<rootDir>/test/plugin.html-validate.mjs"],
extends: ["html-validate:prettier", "<rootDir>/test/plugin.html-validate.mjs:recommended"],
rules: {
"allowed-links": [
"error",
{
allowExternal: {
exclude: ["\\\\?utm_source=chatgpt.com", ".htm[l]?$"],
},
allowRelative: {
exclude: [".htm[l]?$"],
},
allowAbsolute: {
exclude: [".htm[l]?$"],
},
},
],
"pacific-medical-training/mailto-awesome": "error",
"pacific-medical-training/external-links": "error",
"pacific-medical-training/no-jquery": "error",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"structured-data-testing-tool": "^4.5.0"
},
"scripts": {
"test": "yarn node test/fixtures-html-validate-should-fail.mjs && yarn node test/fixtures-structured-data-should-fail.mjs && yarn node test/build-html-validate.mjs && yarn node test/dirty-words-checker.mjs && yarn node test/dirty-file-paths-checker.mjs && yarn node test/build-structured-data-validate.mjs",
"test": "yarn node test/fixtures-html-validate-should-fail.mjs && yarn node test/fixtures-structured-data-should-fail.mjs && yarn node test/build-html-validate.mjs && yarn node test/dirty-file-paths-checker.mjs && yarn node test/build-structured-data-validate.mjs",
"test-structured-data": "yarn node test/build-structured-data-validate.mjs",
"lint": "yarn prettier-check && yarn markdownlint-check",
"lint-fix": "yarn prettier-fix && yarn markdownlint-fix",
Expand Down
4 changes: 3 additions & 1 deletion scripts/generate-sitemap.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import path from "path";
import https from "https";
import { parseString } from "xml2js"; // Using xml2js for XML parsing

const site = "https://www.acls.net";
// Site URL configuration - can be overridden via SITE_URL environment variable
// For GitHub Pages, this should typically be https://username.github.io/repository-name
const site = process.env.SITE_URL || "https://www.acls.net";
const buildFolderPath = path.join(process.cwd(), "build");
const sitemapPath = path.join(buildFolderPath, "sitemap.xml");
const daysThreshold = 30; // Number of days to compare for updating lastmod
Expand Down
85 changes: 0 additions & 85 deletions test/dirty-words-checker.mjs

This file was deleted.

20 changes: 0 additions & 20 deletions test/dirty-words.json

This file was deleted.

24 changes: 24 additions & 0 deletions test/fixtures/required-results.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
}
],
"test/fixtures/external-link-broken.html": [
{
"ruleId": "allowed-links",
"severity": 2,
"message": "External link to this destination is not allowed by current configuration",
"offset": 204,
"line": 9,
"column": 14,
"size": 66,
"selector": "html > body > a:nth-child(1)",
"ruleUrl": "https://html-validate.org/rules/allowed-links.html",
"context": "external"
},
{
"ruleId": "pacific-medical-training/external-links",
"severity": 2,
Expand Down Expand Up @@ -59,6 +71,18 @@
}
],
"test/fixtures/internal-link-broken.html": [
{
"ruleId": "allowed-links",
"severity": 2,
"message": "Absolute link to this destination is not allowed by current configuration",
"offset": 204,
"line": 9,
"column": 14,
"size": 36,
"selector": "html > body > a",
"ruleUrl": "https://html-validate.org/rules/allowed-links.html",
"context": "absolute"
},
{
"ruleId": "pacific-medical-training/internal-links",
"severity": 2,
Expand Down