-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
301 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useData, inBrowser } from 'vitepress' | ||
import { h } from 'vue' | ||
import DefaultTheme from 'vitepress/theme-without-fonts' | ||
import { | ||
NolebaseEnhancedReadabilitiesMenu, | ||
NolebaseEnhancedReadabilitiesScreenMenu, | ||
} from '@nolebase/vitepress-plugin-enhanced-readabilities' | ||
|
||
import './main.css' | ||
import '@nolebase/vitepress-plugin-enhanced-readabilities/dist/style.css' | ||
|
||
export default { | ||
extends: DefaultTheme, | ||
Layout: () => { | ||
return h(DefaultTheme.Layout, null, { | ||
// 为较宽的屏幕的导航栏添加阅读增强菜单 | ||
'nav-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu), | ||
// 为较窄的屏幕(通常是小于 iPad Mini)添加阅读增强菜单 | ||
'nav-screen-content-after': () => | ||
h(NolebaseEnhancedReadabilitiesScreenMenu), | ||
}) | ||
}, | ||
setup() { | ||
// setup language | ||
const { lang } = useData() | ||
if (inBrowser) { | ||
// @ts-ignore | ||
document.cookie = `nf_lang=${lang.value}; expires=Mon, 1 Jan 2024 00:00:00 UTC; path=/` | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
/** | ||
* Colors | ||
* -------------------------------------------------------------------------- */ | ||
|
||
:root { | ||
--c-blue: #4092aa; | ||
--c-blue-dark: #2c3e50; | ||
--c-blue-darker: #1e2a38; | ||
--c-blue-light: #5e9ab5; | ||
--c-blue-lighter: #7fb1c2; | ||
|
||
--c-teal: #0c5053; | ||
--c-teal-light: #27696d; | ||
|
||
--c-white-dark: #f8f8f8; | ||
--vp-c-black-darker: #0d121b; | ||
--vp-c-black: #111827; | ||
--vp-c-black-light: #161f32; | ||
--vp-c-black-lighter: #262a44; | ||
|
||
--c-green-light: #8ae99c; | ||
--c-green: #52ce63; | ||
--c-green-dark: #51a256; | ||
--c-green-darker: #316334; | ||
|
||
--vp-c-text-dark-1: #d9e6eb; | ||
--vp-c-text-dark-2: #c4dde6; | ||
--vp-c-text-dark-3: #abc4cc; | ||
--c-text-light-1: #2c3e50; | ||
--c-text-light-2: #476582; | ||
--c-text-light-3: #90a4b7; | ||
/* #f9fafb */ | ||
|
||
/* light theme is a bit different */ | ||
--vp-c-brand: var(--c-green-darker); | ||
--vp-c-brand-light: var(--c-green); | ||
--vp-c-brand-lighter: var(--c-blue-lighter); | ||
--vp-c-brand-lightest: var(--c-blue-lighter); | ||
|
||
--vp-c-brand-dark: var(--c-green-dark); | ||
--vp-c-brand-darker: var(--c-green-darker); | ||
--vp-c-brand-dimm: rgba(100, 108, 255, 0.08); | ||
--vp-c-brand-text: var(--c-text-light-1); | ||
--c-bg-accent: var(--c-white-dark); | ||
|
||
--vp-code-block-bg: #0d121b; | ||
--vp-code-line-highlight-color: rgba(0, 0, 0, 0.075); | ||
} | ||
|
||
html.dark:root { | ||
--vp-c-brand: var(--c-blue); | ||
--vp-c-brand-dark: var(--c-blue-dark); | ||
--vp-c-brand-darker: var(--c-blue-darker); | ||
--vp-c-brand-light: var(--c-blue-light); | ||
|
||
--vp-c-bg-alpha-with-backdrop: rgba(20, 25, 36, 0.7); | ||
--vp-c-bg-alpha-without-backdrop: rgba(20, 25, 36, 0.9); | ||
|
||
--vp-code-line-highlight-color: rgba(0, 0, 0, 0.5); | ||
|
||
--vp-c-text: var(--c-text-dark-1); | ||
--vp-c-brand-text: var(--c-text-light-1); | ||
--c-text-light: var(--c-text-dark-2); | ||
--c-text-lighter: var(--c-text-dark-3); | ||
--c-divider: var(--c-divider-dark); | ||
--c-bg-accent: var(--vp-c-black-light); | ||
|
||
--vp-c-bg: var(--vp-c-black); | ||
--vp-c-bg-soft: var(--vp-c-black-light); | ||
--vp-c-bg-soft-up: var(--vp-c-black-lighter); | ||
--vp-c-bg-mute: var(--vp-c-black-light); | ||
--vp-c-bg-soft-mute: var(--vp-c-black-lighter); | ||
--vp-c-bg-alt: #0d121b; | ||
--vp-c-bg-elv: var(--vp-c-bg-soft); | ||
--vp-c-bg-elv-mute: var(--vp-c-bg-soft-mute); | ||
--vp-c-mute: var(--vp-c-bg-mute); | ||
--vp-c-mute-dark: var(--vp-c-black-lighter); | ||
--vp-c-mute-darker: var(--vp-c-black-darker); | ||
|
||
--vp-home-hero-name-background: -webkit-linear-gradient( | ||
78deg, | ||
var(--c-blue) 30%, | ||
var(--c-green-light) | ||
); | ||
} | ||
|
||
/** | ||
* Component: Button | ||
* -------------------------------------------------------------------------- */ | ||
|
||
:root { | ||
--vp-button-brand-border: transparent; | ||
--vp-button-brand-bg: var(--c-teal-light); | ||
--vp-button-brand-hover-border: transparent; | ||
--vp-button-brand-hover-bg: var(--c-teal); | ||
--vp-button-brand-active-border: transparent; | ||
--vp-button-brand-active-bg: var(--c-teal-light); | ||
} | ||
|
||
/** | ||
* Component: Home | ||
* -------------------------------------------------------------------------- */ | ||
|
||
:root { | ||
--vp-home-hero-name-color: transparent; | ||
--vp-home-hero-name-background: linear-gradient( | ||
292deg, | ||
var(--c-green-dark) 50%, | ||
var(--c-green-light) | ||
); | ||
--vp-home-hero-image-background-image: linear-gradient( | ||
15deg, | ||
var(--c-green-light) 65%, | ||
var(--c-blue) 30% | ||
); | ||
--vp-home-hero-image-filter: blur(40px); | ||
} | ||
|
||
/** | ||
* Component: Header | ||
* -------------------------------------------------------------------------- */ | ||
|
||
:root { | ||
--vp-layout-max-width: 100%; | ||
} | ||
|
||
/** | ||
* Component: plugins | ||
* -------------------------------------------------------------------------- */ | ||
|
||
:root { | ||
--vp-nolebase-enhanced-readabilities-spotlight-under-bg-color: rgb(147 228 213 / 10%); | ||
} | ||
|
||
.VPHero .VPImage.image-src { | ||
max-height: 192px; | ||
} | ||
|
||
@media (min-width: 640px) { | ||
:root { | ||
--vp-home-hero-image-filter: blur(56px); | ||
} | ||
.VPHero .VPImage.image-src { | ||
max-height: 256px; | ||
} | ||
} | ||
|
||
@media (min-width: 960px) { | ||
:root { | ||
--vp-home-hero-image-filter: blur(72px); | ||
} | ||
.VPHero .VPImage.image-src { | ||
max-height: 320px; | ||
} | ||
} | ||
|
||
/** | ||
* Component: Algolia | ||
* -------------------------------------------------------------------------- */ | ||
|
||
.DocSearch { | ||
--docsearch-primary-color: var(--vp-c-brand) !important; | ||
} | ||
|
||
html.dark .DocSearch, | ||
html.dark .DocSearch-Modal { | ||
/* --docsearch-text-color: var(--c-white-dark); */ | ||
--docsearch-container-background: rgba(9, 10, 17, 0.8); | ||
--docsearch-modal-background: var(--vp-c-black); | ||
--docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309; | ||
/* --docsearch-searchbox-background: var(--c-black-lighter); */ | ||
/* --docsearch-searchbox-focus-background: var(--c-black-light); */ | ||
--docsearch-hit-color: var(--c-text-dark-1); | ||
--docsearch-hit-active-color: var(--c-text-light-1); | ||
--docsearch-hit-shadow: none; | ||
--docsearch-hit-background: var(--vp-c-black-light); | ||
--docsearch-footer-background: var(--vp-c-black-light); | ||
--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), | ||
0 -4px 8px 0 rgba(0, 0, 0, 0.2); | ||
--docsearch-logo-color: var(--vp-c-brand); | ||
--docsearch-muted-color: var(--c-text-light-3); | ||
} | ||
|
||
html.dark .DocSearch-Logo svg .cls-1, | ||
html.dark .DocSearch-Logo svg .cls-2 { | ||
fill: var(--vp-c-brand); | ||
} | ||
|
||
.become-sponsor { | ||
font-size: 0.9em; | ||
font-weight: 700; | ||
width: auto; | ||
text-align: center; | ||
background-color: transparent; | ||
padding: 0.75em 2em; | ||
border-radius: 2em; | ||
transition: all 0.15s ease; | ||
box-sizing: border-box; | ||
border: 2px solid var(--c-blue-dark); | ||
} | ||
|
||
.become-sponsor:hover { | ||
background-color: var(--c-blue); | ||
text-decoration: none; | ||
border-color: var(--c-blue); | ||
color: var(--c-text-light-1); | ||
} | ||
|
||
.sponsors-top .become-sponsor { | ||
font-size: 0.75em; | ||
padding: 0.2em; | ||
width: auto; | ||
max-width: 150px; | ||
} | ||
|
||
kbd { | ||
display: inline-block; | ||
padding: 3px 5px; | ||
font-size: 0.65em; | ||
color: var(--vp-c-text-1); | ||
vertical-align: middle; | ||
background-color: var(--vp-c-bg-mute); | ||
border: solid 1px var(--vp-c-bg-soft-mute); | ||
border-radius: 6px; | ||
box-shadow: inset 0 -1px 0 var(--vp-c-bg-soft-mute); | ||
line-height: 0.95em; | ||
} | ||
|
||
.VPSocialLinks.VPNavBarSocialLinks.social-links { | ||
margin-right: 0; | ||
} | ||
|
||
/** | ||
* Component: MediumZoom | ||
* -------------------------------------------------------------------------- */ | ||
.medium-zoom-overlay { | ||
z-index: 20; | ||
} | ||
|
||
.medium-zoom-image { | ||
z-index: 21; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import { processColumnsOverview, processVitePressConfig } from "./generator/index.js" | ||
import { processColumnsOverview, processVitePressConfig, processVitePressTheme } from "./generator/index.js" | ||
import { processVitePressIndexMD } from "./generator/index.js" | ||
import { processOverviewMD } from "./generator/index.js" | ||
|
||
// | ||
await processVitePressIndexMD() | ||
|
||
await processOverviewMD() | ||
|
||
await processColumnsOverview() | ||
|
||
// 生成 vitepress 配置 | ||
await processVitePressConfig([ | ||
{ text: 'Item A', link: '/item-1' }, | ||
{ text: 'Item B', link: '/item-2' }, | ||
{ text: 'Item C', link: '/item-3' } | ||
]) | ||
// | ||
// await processVitePressIndexMD() | ||
// | ||
// await processOverviewMD() | ||
|
||
await processColumnsOverview() | ||
await processVitePressTheme() |