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
12 changes: 12 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// Ignore files referenced by .gitignore (only valid at root)
"gitignore": true,

// Define glob expressions to ignore
"ignores": [
"node_modules/",
"coverage/",
".github/",
"src/pages/config.md"
]
}
15 changes: 13 additions & 2 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ MD007: false
MD013: false

# MD024/no-duplicate-heading - Multiple headings with the same content
MD024:
siblings_only: true
MD024: false

# MD025/single-title/single-h1 - Multiple top-level headings in the same document
MD025:
Expand All @@ -35,6 +34,12 @@ MD033:
- Resources
- DiscoverBlock
- InlineAlert
- Edition
- SuperHero
- CodeBlock
- Fragment
- Cards
- HorizontalLine

# MD034/no-bare-urls - Bare URL used
MD034: false
Expand Down Expand Up @@ -64,3 +69,9 @@ MD049: false
MD050:
style: asterisk

# MD055/table-pipe-style - Require leading and trailing pipes (matches AM023)
MD055:
style: leading_and_trailing

# MD060/table-column-style - Table column style (disabled for flexible formatting)
MD060: false
2 changes: 1 addition & 1 deletion src/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- Tools
---

<HeroSimple slots="image, heading, text"/>
<SuperHero slots="image, heading, text"/>

![Commerce Cloud Docker](_images/banner-hex-violet.png)

Expand Down
12 changes: 8 additions & 4 deletions tests/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const LINK_REGEX = /\]\((.+)\)$/;
* Helper functions to reduce duplication
*/
const isExternalUrl = (url) => url.startsWith('http://') || url.startsWith('https://');
const isAnchorLink = (url) => url.startsWith('#');

const extractTitle = (entry) => {
const match = entry.match(TITLE_REGEX);
Expand Down Expand Up @@ -246,7 +247,7 @@ describe('Config.md Navigation Tests', () => {
test('internal page links should point to existing files', () => {
configData.pages.forEach((page) => {
const link = extractLink(page);
if (link && !isExternalUrl(link)) {
if (link && !isExternalUrl(link) && !isAnchorLink(link)) {
const filePath = path.join(PAGES_DIR, link);
expect(fs.existsSync(filePath)).toBe(true);
}
Expand Down Expand Up @@ -281,14 +282,14 @@ describe('Config.md Navigation Tests', () => {
test('internal subPage links should point to existing files', () => {
configData.subPages.forEach((item) => {
const parentLink = extractLink(item.parent);
if (parentLink && !isExternalUrl(parentLink)) {
if (parentLink && !isExternalUrl(parentLink) && !isAnchorLink(parentLink)) {
const filePath = path.join(PAGES_DIR, parentLink);
expect(fs.existsSync(filePath)).toBe(true);
}

item.children.forEach((child) => {
const childLink = extractLink(child);
if (childLink && !isExternalUrl(childLink)) {
if (childLink && !isExternalUrl(childLink) && !isAnchorLink(childLink)) {
const filePath = path.join(PAGES_DIR, childLink);
expect(fs.existsSync(filePath)).toBe(true);
}
Expand All @@ -308,7 +309,10 @@ describe('Config.md Navigation Tests', () => {
test('internal links should use .md extension', () => {
const links = getAllLinks(configData, true);
links.forEach((link) => {
expect(link).toMatch(/\.md$/);
// Skip anchor links as they don't need .md extension
if (!isAnchorLink(link)) {
expect(link).toMatch(/\.md$/);
}
});
});

Expand Down
Loading