@eox/pages-theme-eox 0.4.8 → 0.4.10

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.8",
3
+ "version": "0.4.10",
4
4
  "type": "module",
5
5
  "description": "Vitepress Theme with EOX branding",
6
6
  "main": "src/index.js",
package/src/Layout.vue CHANGED
@@ -8,7 +8,7 @@
8
8
  <a href="/">
9
9
  <img
10
10
  :src="withBase(theme.logo)"
11
- :alt="`${theme.siteTitle} logo`"
11
+ :alt="`${site.title} logo`"
12
12
  class="logo"
13
13
  />
14
14
  </a>
@@ -21,7 +21,7 @@
21
21
  <a data-ui="#mobile-menu" href="/">
22
22
  <img
23
23
  :src="withBase(theme.logo)"
24
- :alt="`${theme.siteTitle} logo`"
24
+ :alt="`${site.title} logo`"
25
25
  class="logo margin"
26
26
  />
27
27
  </a>
@@ -76,7 +76,7 @@
76
76
  <a href="/">
77
77
  <img
78
78
  :src="withBase(theme.logo)"
79
- :alt="`${theme.siteTitle} logo`"
79
+ :alt="`${site.title} logo`"
80
80
  class="logo"
81
81
  />
82
82
  </a>
@@ -137,6 +137,11 @@
137
137
  </div>
138
138
  </header>
139
139
  </template>
140
+ <template #page-bottom>
141
+ <FeaturesGallery
142
+ v-if="page.relativePath.startsWith('features/')"
143
+ ></FeaturesGallery>
144
+ </template>
140
145
  <template #layout-bottom>
141
146
  <footer class="surface row center-align">
142
147
  <div class="holder">
@@ -144,7 +149,7 @@
144
149
  <nav class="padding right-align">
145
150
  <img
146
151
  :src="withBase(theme.logo)"
147
- :alt="`${theme.siteTitle} logo`"
152
+ :alt="`${site.title} logo`"
148
153
  class="logo"
149
154
  />
150
155
  <ul>
@@ -179,7 +184,7 @@
179
184
  import DefaultTheme from "vitepress/theme";
180
185
  const { Layout } = DefaultTheme;
181
186
  import { useData, withBase } from "vitepress";
182
- const { frontmatter, theme } = useData();
187
+ const { frontmatter, page, site, theme } = useData();
183
188
 
184
189
  if (!import.meta.env.SSR) {
185
190
  const scrollListener = () => {
@@ -37,7 +37,6 @@
37
37
  </template>
38
38
 
39
39
  <script setup>
40
- import { defineProps } from "vue";
41
40
  import { withBase } from "vitepress";
42
41
  const props = defineProps([
43
42
  "icon",
@@ -0,0 +1,58 @@
1
+ <script setup>
2
+ import { useData, withBase } from "vitepress";
3
+ import { data as features } from "../features.data.js";
4
+
5
+ const { page, site } = useData();
6
+
7
+ const featuresExcerpts = features.map((f) => {
8
+ const el = document.createElement("html");
9
+ el.innerHTML = f.html;
10
+ const featureSection = el.querySelector("featuresection");
11
+ return featureSection
12
+ ? {
13
+ title: featureSection.title,
14
+ description: featureSection.textContent,
15
+ image: featureSection.getAttribute("image"),
16
+ link: f.url,
17
+ show: page.value.relativePath.includes(f.url.replace("/", "")),
18
+ }
19
+ : false;
20
+ });
21
+ </script>
22
+
23
+ <template>
24
+ <h2>Read more about these other {{ site.title }} features:</h2>
25
+ <div class="grid">
26
+ <a
27
+ v-for="(feature, index) in features.filter(
28
+ (f, i) => f.show && featuresExcerpts[i],
29
+ )"
30
+ class="feature s12 m3"
31
+ :href="feature.url"
32
+ >
33
+ <article class="no-padding">
34
+ <img
35
+ v-if="featuresExcerpts[index].image"
36
+ class="responsive small"
37
+ :src="withBase(featuresExcerpts[index].image)"
38
+ />
39
+ <div class="padding">
40
+ <h5 class="small">{{ featuresExcerpts[index].title }}</h5>
41
+ <p>{{ featuresExcerpts[index].description }}</p>
42
+ <nav>
43
+ <a class="button" :href="featuresExcerpts[index].link">
44
+ <span>Read more</span>
45
+ <i class="mdi mdi-arrow-right"></i>
46
+ </a>
47
+ </nav>
48
+ </div>
49
+ </article>
50
+ </a>
51
+ </div>
52
+ </template>
53
+
54
+ <style scoped>
55
+ h2 {
56
+ margin-top: 8rem;
57
+ }
58
+ </style>
@@ -0,0 +1,11 @@
1
+ import { createContentLoader } from "vitepress";
2
+
3
+ export default createContentLoader("features/*.md", {
4
+ includeSrc: true,
5
+ render: true,
6
+ transform(rawData) {
7
+ return rawData.filter(
8
+ (d) => d.url !== "/features/" && d.url !== "/features/README",
9
+ );
10
+ },
11
+ });
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import DefaultTheme from "vitepress/theme";
2
2
  import FeatureSection from "./components/FeatureSection.vue";
3
+ import FeaturesGallery from "./components/FeaturesGallery.vue";
3
4
  import Layout from "./Layout.vue";
4
5
  import "@eox/ui";
5
6
  import "./style.css";
@@ -9,6 +10,7 @@ export default {
9
10
  Layout,
10
11
  enhanceApp({ app, router, siteData }) {
11
12
  app.component("FeatureSection", FeatureSection);
13
+ app.component("FeaturesGallery", FeaturesGallery);
12
14
 
13
15
  router.onAfterRouteChanged = () => {
14
16
  if (!import.meta.env.SSR) {