mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat: show git commit reference in documents footer
This commit is contained in:
parent
efda5a84dc
commit
2831208de3
7 changed files with 33 additions and 8 deletions
2
.github/workflows/documents.yml
vendored
2
.github/workflows/documents.yml
vendored
|
@ -40,7 +40,7 @@ jobs:
|
||||||
working-directory: docs
|
working-directory: docs
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: yarn docs:build
|
run: COMMIT_REF=$(git rev-parse HEAD) yarn docs:build
|
||||||
working-directory: docs
|
working-directory: docs
|
||||||
|
|
||||||
- name: Archive artifacts
|
- name: Archive artifacts
|
||||||
|
|
3
docs/.vitepress/config/common.ts
Normal file
3
docs/.vitepress/config/common.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export const projectUrl: string = "https://github.com/0xJacky/nginx-ui"
|
||||||
|
export const demoUrl: string = "https://demo.nginxui.com"
|
||||||
|
export const editLinkPattern: string = projectUrl + '/edit/master/docs/:path'
|
|
@ -1,11 +1,12 @@
|
||||||
import {LocaleSpecificConfig, DefaultTheme} from "vitepress"
|
import {LocaleSpecificConfig, DefaultTheme} from "vitepress"
|
||||||
|
import {demoUrl} from './common'
|
||||||
|
|
||||||
export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
|
export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
nav: [
|
nav: [
|
||||||
{text: 'Home', link: '/'},
|
{text: 'Home', link: '/'},
|
||||||
{text: 'Guide', link: '/guide/about'},
|
{text: 'Guide', link: '/guide/about'},
|
||||||
{text: 'Demo', link: 'https://demo.nginxui.com'}
|
{text: 'Demo', link: demoUrl}
|
||||||
],
|
],
|
||||||
|
|
||||||
sidebar: {
|
sidebar: {
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
import { defineConfig } from 'vitepress'
|
import { defineConfig } from 'vitepress'
|
||||||
|
import {projectUrl, editLinkPattern} from './common'
|
||||||
|
|
||||||
|
export const commitRef = process.env.COMMIT_REF ?
|
||||||
|
`<a href="${projectUrl}/commit/${process.env.COMMIT_REF}">` + process.env.COMMIT_REF.slice(0, 8) + '</a>':
|
||||||
|
'dev'
|
||||||
|
|
||||||
function thisYear() {
|
function thisYear() {
|
||||||
return new Date().getFullYear()
|
return new Date().getFullYear()
|
||||||
|
@ -8,6 +13,11 @@ export const sharedConfig = defineConfig({
|
||||||
title: 'Nginx UI',
|
title: 'Nginx UI',
|
||||||
description: 'Yet another Nginx Web UI',
|
description: 'Yet another Nginx Web UI',
|
||||||
|
|
||||||
|
head: [
|
||||||
|
['link', { rel: 'icon', type: 'image/svg+xml', href: '/assets/logo.svg' }],
|
||||||
|
['meta', { name: 'theme-color', content: '#3682D8' }]
|
||||||
|
],
|
||||||
|
|
||||||
lastUpdated: true,
|
lastUpdated: true,
|
||||||
|
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
|
@ -18,16 +28,16 @@ export const sharedConfig = defineConfig({
|
||||||
},
|
},
|
||||||
|
|
||||||
editLink: {
|
editLink: {
|
||||||
pattern: 'https://github.com/0xJacky/nginx-ui/edit/master/docs/:path'
|
pattern: editLinkPattern
|
||||||
},
|
},
|
||||||
|
|
||||||
footer: {
|
footer: {
|
||||||
message: 'Released under the AGPL-3.0 License.',
|
message: `Released under the AGPL-3.0 License. (${commitRef})`,
|
||||||
copyright: 'Copyright © 2021-' + thisYear() + ' Nginx UI Team'
|
copyright: 'Copyright © 2021-' + thisYear() + ' Nginx UI Team'
|
||||||
},
|
},
|
||||||
|
|
||||||
socialLinks: [
|
socialLinks: [
|
||||||
{icon: 'github', link: 'https://github.com/0xJacky/nginx-ui'}
|
{icon: 'github', link: projectUrl}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
import {LocaleSpecificConfig, DefaultTheme} from "vitepress"
|
import {LocaleSpecificConfig, DefaultTheme} from "vitepress"
|
||||||
|
import {demoUrl, editLinkPattern} from './common'
|
||||||
|
|
||||||
export const zhCNConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
|
export const zhCNConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
nav: [
|
nav: [
|
||||||
{text: '首页', link: '/zh_CN/'},
|
{text: '首页', link: '/zh_CN/'},
|
||||||
{text: '手册', link: '/zh_CN/guide/about'},
|
{text: '手册', link: '/zh_CN/guide/about'},
|
||||||
{text: '演示', link: 'https://demo.nginxui.com'}
|
{text: '演示', link: demoUrl}
|
||||||
],
|
],
|
||||||
|
|
||||||
editLink: {
|
editLink: {
|
||||||
text: '编辑此页',
|
text: '编辑此页',
|
||||||
pattern: 'https://github.com/0xJacky/nginx-ui/edit/master/docs/:path'
|
pattern: editLinkPattern
|
||||||
},
|
},
|
||||||
|
|
||||||
sidebar: {
|
sidebar: {
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
"vitepress": "^1.0.0-alpha.75"
|
"vitepress": "^1.0.0-alpha.75"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.1.0",
|
||||||
"less": "^4.1.3"
|
"less": "^4.1.3"
|
||||||
}
|
},
|
||||||
|
"license": "AGPL-3.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -427,6 +427,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@types/node@npm:^20.1.0":
|
||||||
|
version: 20.1.0
|
||||||
|
resolution: "@types/node@npm:20.1.0"
|
||||||
|
checksum: c6d9afa9aa78b4b4348c69ece94975be70346b144c278f1395694a10ef919d7db300018101b6f9245e6bdd76674a5327d2d14829092f3d5295e858cff5f22a66
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@types/web-bluetooth@npm:^0.0.17":
|
"@types/web-bluetooth@npm:^0.0.17":
|
||||||
version: 0.0.17
|
version: 0.0.17
|
||||||
resolution: "@types/web-bluetooth@npm:0.0.17"
|
resolution: "@types/web-bluetooth@npm:0.0.17"
|
||||||
|
@ -1448,6 +1455,7 @@ __metadata:
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "nginx-ui-docs@workspace:."
|
resolution: "nginx-ui-docs@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@types/node": ^20.1.0
|
||||||
less: ^4.1.3
|
less: ^4.1.3
|
||||||
vitepress: ^1.0.0-alpha.75
|
vitepress: ^1.0.0-alpha.75
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue