Skip to content

Commit 6884d94

Browse files
authored
chore: add mdl rule to enable no-docsy-dev-external-urls checking, fix link (#2584)
2 parents b219dab + e91cf74 commit 6884d94

File tree

10 files changed

+30
-8
lines changed

10 files changed

+30
-8
lines changed

.markdownlint-cli2.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# cSpell:ignore docsy github lookandfeel iconsimages
22

3+
customRules:
4+
- ./scripts/_md-rules/link-rules.mjs
5+
36
globs:
47
- '!docsy.dev/**'
58
- '!layouts/**'

.markdownlint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@ no-inline-html: false
1515
no-trailing-punctuation: false
1616
no-trailing-spaces: { br_spaces: 0, strict: true}
1717
# table-column-style: false
18+
19+
# Link-validation rules (from scripts/_md-rules/link-rules.mjs)
20+
21+
no-docsy-dev-external-urls:
22+
pattern: 'https?://(?:www\.)?docsy\.dev/'
23+
message: Use a site-relative path instead of the full docsy.dev URL.
24+
replace: '/'

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
<!-- markdownlint-disable no-docsy-dev-external-urls -->
4+
35
The changelog is published online, see
46
[Changelog](https://www.docsy.dev/project/about/changelog/) or the
57
[page source](docsy.dev/content/en/project/about/changelog.md).

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Contributing
22

3+
<!-- markdownlint-disable no-docsy-dev-external-urls -->
4+
35
The contributing page is published online, see
46
[Contributing](https://www.docsy.dev/docs/contributing/) or the
57
[page source](docsy.dev/content/en/docs/contributing.md).

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Docsy
22

3+
<!-- markdownlint-disable no-docsy-dev-external-urls -->
4+
35
Docsy is a [Hugo](https://gohugo.io) theme for technical documentation sets,
46
providing simple navigation, site structure, and more.
57

@@ -106,9 +108,6 @@ This project is licensed under the Apache License 2.0, see
106108
[deploys]: https://app.netlify.com/sites/docsydocs/deploys
107109
[main-preview]: https://main--docsydocs.netlify.app/
108110
[netlify]: https://netlify.com
109-
110-
<!-- FIXME: once 0.14.0 is released, update the link to the changelog page -->
111-
112111
[official-support]:
113112
https://www.docsy.dev/project/about/changelog/#official-support
114113
[releases]: https://github.com/google/docsy/releases

docsy.dev/config/_default/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# status: archived # Then fetch include
88

99
version: &docsyVersion 0.14.4-dev
10-
tdBuildId: 020-over-main-4a09247b
10+
tdBuildId: 021-over-main-b219dab5
1111
versionLatest: &versionLatest v0.14.3
1212
version_menu: *docsyVersion
1313
version_menu_pagelinks: true

docsy.dev/content/en/docs/content/lookandfeel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ translucent setting ensures that the hero image is maximally visible. Once the
617617
user has scrolled past the cover (hero image), the navbar reverts to its default
618618
(opaque) style.
619619

620-
[About Docsy]: https://www.docsy.dev/about/
620+
[About Docsy]: /about/
621621
[blocks/cover]: /docs/content/shortcodes/#blocks-cover
622622

623623
### Customizing the navbar {#navbar-customization}

docsy.dev/content/en/project/_index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ cascade:
88
type: docs
99
params:
1010
hide_feedback: true
11-
params:
12-
FAS: <i class="fa-solid fa-{1} text-{2}"></i>
1311
cSpell:ignore: docsydocs
1412
---
1513

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsy",
3-
"version": "0.14.4-dev+020-over-main-4a09247b",
3+
"version": "0.14.4-dev+021-over-main-b219dab5",
44
"repository": "github:google/docsy",
55
"homepage": "https://www.docsy.dev",
66
"license": "Apache-2.0",
@@ -67,6 +67,7 @@
6767
"@cspell/dict-fr-fr": "^2.3.2",
6868
"cpy-cli": "^6.0.0",
6969
"markdownlint-cli2": "^0.20.0",
70+
"markdownlint-rule-link-pattern": "github:chalin/markdownlint-rule-link-pattern#v0.2.0",
7071
"prettier": "^3.8.1"
7172
},
7273
"config": {

scripts/_md-rules/link-rules.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// @ts-check
2+
3+
import { createLinkPatternRule } from 'markdownlint-rule-link-pattern';
4+
5+
export default [
6+
createLinkPatternRule(
7+
'no-docsy-dev-external-urls',
8+
'Use a local path instead of an external URL for site-local pages',
9+
),
10+
];

0 commit comments

Comments
 (0)