@eox/pages-theme-esa 0.4.1 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/pages-theme-esa",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "Vitepress Theme with ESA branding",
6
6
  "main": "src/index.js",
package/src/Layout.vue CHANGED
@@ -10,19 +10,22 @@ const router = useRouter();
10
10
 
11
11
  onMounted(async () => {
12
12
  setTimeout(() => {
13
- document.querySelector("esa-cookies").addEventListener("accept", () => {
14
- _paq.push(["rememberCookieConsentGiven"]);
15
- });
16
- document.querySelector("esa-cookies").addEventListener("decline", () => {
17
- _paq.push(["forgetCookieConsentGiven"]);
18
- _paq.push(["optUserOut"]);
19
- });
13
+ const cookieBanner = document.querySelector("esa-cookies");
14
+ if (cookieBanner) {
15
+ cookieBanner.addEventListener("accept", () => {
16
+ _paq.push(["rememberCookieConsentGiven"]);
17
+ });
18
+ cookieBanner.addEventListener("decline", () => {
19
+ _paq.push(["forgetCookieConsentGiven"]);
20
+ _paq.push(["optUserOut"]);
21
+ });
20
22
 
21
- if (
22
- !document.cookie.includes("mtm_cookie_consent") &&
23
- !document.cookie.includes("mtm_consent_removed")
24
- ) {
25
- document.querySelector("esa-cookies").style.display = "block";
23
+ if (
24
+ !document.cookie.includes("mtm_cookie_consent") &&
25
+ !document.cookie.includes("mtm_consent_removed")
26
+ ) {
27
+ cookieBanner.style.display = "block";
28
+ }
26
29
  }
27
30
 
28
31
  // TRACK PAGE SCROLL
@@ -60,12 +63,17 @@ onMounted(async () => {
60
63
  }
61
64
  };
62
65
 
63
- watch(() => router.route.data.relativePath, () => {
64
- _paq.push(['setCustomUrl', router.route.path]);
65
- _paq.push(['setDocumentTitle', router.route.data.title]);
66
- _paq.push(['trackPageView']);
67
- _paq.push(['enableLinkTracking']);
68
- }, { immediate: true });
66
+ watch(
67
+ () => router.route.data.relativePath,
68
+ () => {
69
+ if (!window._paq) return;
70
+ _paq.push(["setCustomUrl", router.route.path]);
71
+ _paq.push(["setDocumentTitle", router.route.data.title]);
72
+ _paq.push(["trackPageView"]);
73
+ _paq.push(["enableLinkTracking"]);
74
+ },
75
+ { immediate: true },
76
+ );
69
77
 
70
78
  applyShadowDomEventListener(
71
79
  [
@@ -93,13 +101,14 @@ onMounted(async () => {
93
101
  <ClientOnly>
94
102
  <slot name="layout-top"></slot>
95
103
  <esa-menu
96
- .menuItems="theme.nav.map(n => ({title: n.text, href: n.link}))"
104
+ .menuItems="theme.nav.map((n) => ({ title: n.text, href: n.link }))"
97
105
  :enable-login="theme.login"
98
106
  ></esa-menu>
99
107
  <esa-header></esa-header>
100
108
  <esa-navbar
109
+ :brand-logo="theme.logo"
101
110
  :brand-title="site.title"
102
- .menuItems="theme.nav.map(n => ({title: n.text, href: n.link}))"
111
+ .menuItems="theme.nav.map((n) => ({ title: n.text, href: n.link }))"
103
112
  :enable-login="theme.login"
104
113
  ></esa-navbar>
105
114
  </ClientOnly>
@@ -109,94 +118,57 @@ onMounted(async () => {
109
118
  <esa-cover
110
119
  :overline="frontmatter.title"
111
120
  :title="frontmatter.hero.text"
112
- :background-image="frontmatter.hero.image"
121
+ :background-image="frontmatter.hero.background"
113
122
  :underline="frontmatter.hero.tagline"
114
- cta
115
- :cta-link="frontmatter.hero.actions[0].link"
116
- :cta-text="frontmatter.hero.actions[0].text"
123
+ :cta="frontmatter.hero.actions?.[0]"
124
+ :cta-link="frontmatter.hero.actions?.[0]?.link"
125
+ :cta-text="frontmatter.hero.actions?.[0]?.text"
126
+ :alt="frontmatter.hero.actions?.[1]"
127
+ :alt-link="frontmatter.hero.actions?.[1]?.link"
128
+ :alt-text="frontmatter.hero.actions?.[1]?.text"
129
+ :image="frontmatter.hero.image"
117
130
  ></esa-cover>
118
131
  </ClientOnly>
119
132
  </template>
120
133
  <template #layout-bottom>
121
134
  <ClientOnly>
122
- <esa-gateway
123
- .items='[
124
- {
125
- title: "ESA Vision",
126
- links: [
127
- {
128
- name: "EO Science Strategy",
129
- href: "https://doi.org/10.5281/zenodo.13819557",
130
- },
131
- ],
132
- },
133
- {
134
- title: "ESA EO Programme",
135
- links: [
136
- {
137
- name: "Observing the Earth",
138
- href: "https://www.esa.int/Applications/Observing_the_Earth",
139
- },
140
- {
141
- name: "Science for Society",
142
- href: "https://eo4society.esa.int",
143
- },
144
- ],
145
- },
146
- {
147
- title: "Research at ESA",
148
- links: [
149
-
150
- {
151
- name: "Earth System Science Hub",
152
- href: "https://sciencehub.esa.int",
153
- },
154
- ],
155
- },
156
- {
157
- title: "Opportunities",
158
- links: [
159
-
160
- {
161
- name: "Network of Resources",
162
- href: "https://nor-discover.org",
163
- },
164
- ],
165
- },
166
- ]'
167
- ></esa-gateway>
168
135
  <esa-footer
169
- title="Get in touch"
170
- description="Join ESA's initiative to ensure long-term preservation and accessibility of research data, code, and documentation for a global scientific community."
171
- contact-link="mailto:earthcode@esa.int"
172
- .footerItems="[
173
- [
174
- {
175
- href: 'https://www.esa.int/',
176
- title: 'ESA Portal',
177
- },
178
- {
179
- href: 'https://www.esa.int/About_Us/Corporate_news',
180
- title: 'About ESA',
181
- },
182
- ],
183
- [
184
- {
185
- href: 'https://www.esa.int/Services/Terms_and_conditions',
186
- title: 'Terms and Conditions',
187
- },
188
- {
189
- href: 'https://www.esa.int/Services/Cookies_notice',
190
- title: 'Cookies Notice',
191
- },
192
- ],
193
- [
194
- {
195
- href: 'https://www.esa.int/Services/Privacy_notice',
196
- title: 'Privacy Notice',
197
- },
198
- ],
199
- ]"
136
+ :small="theme.footer.small"
137
+ :title="theme.footer.title || 'Get in touch'"
138
+ :description="
139
+ theme.footer.description || `Contact ESA for more information`
140
+ "
141
+ :contact-link="theme.footer.contact || 'mailto:info@esa.int'"
142
+ .footerItems="
143
+ theme.footer.items || [
144
+ [
145
+ {
146
+ href: 'https://www.esa.int/',
147
+ title: 'ESA Portal',
148
+ },
149
+ {
150
+ href: 'https://www.esa.int/About_Us/Corporate_news',
151
+ title: 'About ESA',
152
+ },
153
+ ],
154
+ [
155
+ {
156
+ href: 'https://www.esa.int/Services/Terms_and_conditions',
157
+ title: 'Terms and Conditions',
158
+ },
159
+ {
160
+ href: 'https://www.esa.int/Services/Cookies_notice',
161
+ title: 'Cookies Notice',
162
+ },
163
+ ],
164
+ [
165
+ {
166
+ href: 'https://www.esa.int/Services/Privacy_notice',
167
+ title: 'Privacy Notice',
168
+ },
169
+ ],
170
+ ]
171
+ "
200
172
  ></esa-footer>
201
173
  <esa-cookies
202
174
  link="https://www.esa.int/Services/Cookies_notice"
@@ -211,9 +183,12 @@ onMounted(async () => {
211
183
  esa-footer {
212
184
  padding: 0 24px;
213
185
  }
186
+ esa-footer[small] {
187
+ background: white;
188
+ }
214
189
  @media (min-width: 640px) {
215
190
  esa-footer {
216
- padding: 0 200px;
191
+ padding: 0 100px;
217
192
  }
218
193
  }
219
194
  </style>
@@ -1,13 +1,19 @@
1
1
  <script setup>
2
2
  import { data as blogposts } from "../blogposts.data.js";
3
+
4
+ const props = defineProps({
5
+ maxPosts: { type: Number, default: Infinity },
6
+ });
3
7
  </script>
4
8
 
5
9
  <template>
6
10
  <esa-cards>
7
11
  <esa-card
8
- v-for="(blogpost, index) in blogposts.sort((a, b) =>
9
- new Date(a.frontmatter.date) < new Date(b.frontmatter.date) ? 1 : -1,
10
- )"
12
+ v-for="(blogpost, index) in blogposts
13
+ .sort((a, b) =>
14
+ new Date(a.frontmatter.date) < new Date(b.frontmatter.date) ? 1 : -1,
15
+ )
16
+ .slice(0, props.maxPosts)"
11
17
  :feature="blogpost.frontmatter.feature"
12
18
  overline="Story"
13
19
  :image="blogpost.frontmatter.image"
package/src/style.css CHANGED
@@ -228,3 +228,6 @@ section > p {
228
228
  .VPButton.cta:hover:after {
229
229
  animation: cta-arrow 1s ease-in-out infinite;
230
230
  }
231
+ .VPFooter {
232
+ display: none;
233
+ }
Binary file