mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-22 02:37:42 +00:00
Fix edit url and announcement bar color on dark mode (#20)
Changes: 1. Dark mdoe colors for announcement bar, used the way in [CSS module class names in the document](https://docusaurus.io/docs/styling-layout#global-styles) to change the style. 2. Fix edit url. Right now, clicking on "edit url" will redirect to lastest version of documents no matter from v1.19 or current version. Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/20 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: HesterG <hestergong@gmail.com> Co-committed-by: HesterG <hestergong@gmail.com>
This commit is contained in:
@@ -46,8 +46,16 @@ const config = {
|
|||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
routeBasePath: '/', // Serve the docs at the site's root
|
routeBasePath: '/', // Serve the docs at the site's root
|
||||||
editUrl: ({locale, versionDocsDirPath, docPath}) => {
|
editUrl: ({versionDocsDirPath, docPath, locale, version, permalink}) => {
|
||||||
return `https://github.com/go-gitea/gitea/tree/main/docs/content/doc/${docPath}`
|
let fileName = `doc/${docPath.replace('.md', '')}.en-us.md`;
|
||||||
|
if (locale === 'zh-cn') {
|
||||||
|
fileName = `doc/${docPath.replace('.md', '')}.zh-cn.md`;
|
||||||
|
}
|
||||||
|
// intro.md has different name from upstream, need to handle this here
|
||||||
|
if (docPath.includes('intro.md')) {
|
||||||
|
fileName = locale === 'zh-cn' ? 'page/index.zh-cn.md': 'page/index.en-us.md';
|
||||||
|
}
|
||||||
|
return `https://github.com/go-gitea/gitea/tree/main/docs/content/${fileName}`;
|
||||||
},
|
},
|
||||||
versions: {
|
versions: {
|
||||||
current: {
|
current: {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-theme='dark'] .announcementBar_node_modules-\@docusaurus-theme-classic-lib-theme-AnnouncementBar-styles-module {
|
[data-theme='dark'] [class*='announcementBar'] {
|
||||||
color: var(--ifm-font-color-base);
|
color: var(--ifm-font-color-base);
|
||||||
background-color: var(--ifm-background-color);
|
background-color: var(--ifm-background-color);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user