Skip to content

Commit 2a85e79

Browse files
committed
Release 2.0.22
Co-authored-by: Maximilian Lenkeit <[email protected]>
1 parent 58d3ec4 commit 2a85e79

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
run: npm run docs:build
2727
env:
2828
VP_DOMAIN: https://documentation.apeirora.eu/
29+
VP_EDIT_LINK_PATTERN: 'https://github.com/apeirora/documentation/edit/main/:path'
2930

3031
- name: Upload Build Artifact
3132
uses: actions/upload-pages-artifact@v3

.vitepress/config.mts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ const resolveAbsoluteUrl = (relativeUrl: string) => {
2424
}
2525
const NAV_BAR_DIVIDER = { text: '', link: '#--divider--', activeMatch: '' }
2626

27+
const EDIT_LINK_PATTERN = process.env.VP_EDIT_LINK_PATTERN
28+
if (EDIT_LINK_PATTERN) {
29+
try {
30+
const url = new URL(EDIT_LINK_PATTERN)
31+
const urlStr = url.toString()
32+
if (!urlStr.includes('/:path')) {
33+
throw new Error(`Edit link pattern '${EDIT_LINK_PATTERN}' must contain the placeholder '/:path', check environment variable VP_EDIT_LINK_PATTERN`)
34+
}
35+
} catch (err) {
36+
throw new Error(`Edit link pattern '${EDIT_LINK_PATTERN}' must be a valid URL, check environment variable VP_EDIT_LINK_PATTERN`, err)
37+
}
38+
}
39+
const editLinkConfig = EDIT_LINK_PATTERN
40+
? { editLink: { pattern: EDIT_LINK_PATTERN } }
41+
: {}
42+
2743
// https://vitepress.dev/reference/site-config
2844
export default withMermaid(defineConfig({
2945
title: "ApeiroRA",
@@ -64,6 +80,7 @@ export default withMermaid(defineConfig({
6480
socialLinks: [
6581
{ icon: 'github', link: 'https://github.com/apeirora/' }
6682
],
83+
...editLinkConfig,
6784

6885
logo: {
6986
// relative to `public` folder

0 commit comments

Comments
 (0)