@eox/pages-theme-eox 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierignore +1 -0
- package/config.mjs +17 -0
- package/package.json +8 -2
- package/src/index.js +8 -2
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
package-lock.json
|
package/config.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from "vitepress";
|
|
2
|
+
|
|
3
|
+
// https://vitepress.dev/reference/site-config
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
srcDir: "./pages",
|
|
6
|
+
appearance: "force-light",
|
|
7
|
+
cleanUrls: true,
|
|
8
|
+
vue: {
|
|
9
|
+
template: {
|
|
10
|
+
compilerOptions: {
|
|
11
|
+
isCustomElement: (tag) => {
|
|
12
|
+
return tag.toLowerCase().includes("-");
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eox/pages-theme-eox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vitepress Theme with EOX branding",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": "EOX",
|
|
8
|
-
"license": "MIT"
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"format": "npx prettier --write ."
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@eox/eslint-config": "^2.0.0"
|
|
14
|
+
}
|
|
9
15
|
}
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,13 @@ import DefaultTheme from "vitepress/theme";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
extends: DefaultTheme,
|
|
5
|
-
enhanceApp({ siteData }) {
|
|
5
|
+
enhanceApp({ router, siteData }) {
|
|
6
|
+
router.onAfterRouteChanged = () => {
|
|
7
|
+
if (!import.meta.env.SSR) {
|
|
8
|
+
window.scrollTo(0, 0);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
6
12
|
if (!import.meta.env.SSR) {
|
|
7
13
|
const brandStyle = document.createElement("style");
|
|
8
14
|
brandStyle.appendChild(
|
|
@@ -20,7 +26,7 @@ export default {
|
|
|
20
26
|
--vp-c-brand-3: color-mix(in srgb, ${siteData.value.themeConfig.theme.primaryColor} 80%, white);
|
|
21
27
|
--vp-c-brand-soft: color-mix(in srgb, ${siteData.value.themeConfig.theme.primaryColor} 16%, transparent);
|
|
22
28
|
}
|
|
23
|
-
`)
|
|
29
|
+
`),
|
|
24
30
|
);
|
|
25
31
|
document.head.appendChild(brandStyle);
|
|
26
32
|
}
|