@eox/pages-theme-eox 0.4.0 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/pages-theme-eox",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "description": "Vitepress Theme with EOX branding",
6
6
  "main": "src/index.js",
package/src/Layout.vue CHANGED
@@ -132,22 +132,19 @@ import DefaultTheme from "vitepress/theme";
132
132
  const { Layout } = DefaultTheme;
133
133
  import { useData } from "vitepress";
134
134
  const { frontmatter, theme } = useData();
135
- // import FeatureSection from "./components/FeatureSection.vue";
136
- const scrollListener = () => {
137
- const nav = document.querySelector(".top-nav");
138
- // if (window.scrollY > nav.clientHeight) {
139
- // nav.classList.add("hidden")
140
- // nav.classList.add("sticky")
141
- // } else {
142
- // nav.classList.remove("hidden")
143
- // }
144
- if (window.scrollY > window.innerHeight) {
145
- nav.classList.remove("at-top");
146
- } else {
147
- nav.classList.add("at-top");
148
- }
149
- };
150
- window.addEventListener("scroll", scrollListener);
135
+
136
+ if (!import.meta.env.SSR) {
137
+ const scrollListener = () => {
138
+ const nav = document.querySelector(".top-nav");
139
+
140
+ if (window.scrollY > window.innerHeight) {
141
+ nav.classList.remove("at-top");
142
+ } else {
143
+ nav.classList.add("at-top");
144
+ }
145
+ };
146
+ window.addEventListener("scroll", scrollListener);
147
+ }
151
148
  </script>
152
149
 
153
150
  <style>
package/src/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import DefaultTheme from "vitepress/theme";
2
+ import FeatureSection from "./components/FeatureSection.vue";
2
3
  import Layout from "./Layout.vue";
3
4
  import "@eox/ui";
4
5
  import "./style.css";
@@ -7,12 +8,7 @@ export default {
7
8
  extends: DefaultTheme,
8
9
  Layout,
9
10
  enhanceApp({ app, router, siteData }) {
10
- const modules = import.meta.glob("./components/*.vue");
11
- for (const path in modules) {
12
- modules[path]().then((mod) => {
13
- app.component(path.split("/")[2].replace(".vue", ""), mod.default);
14
- });
15
- }
11
+ app.component("FeatureSection", FeatureSection);
16
12
 
17
13
  router.onAfterRouteChanged = () => {
18
14
  if (!import.meta.env.SSR) {