11<script setup>
22import { useData } from ' vitepress'
3+ import { computed } from ' vue'
34import LegalFooter from ' ./components/LegalFooter.vue'
5+ import ReleaseNotesSidebar from ' ./components/ReleaseNotesSidebar.vue'
46
5- const { frontmatter } = useData ()
7+ const { frontmatter , page } = useData ()
8+
9+ const META_COPY = {
10+ en: {
11+ section: ' Release Notes' ,
12+ readingTime: ' min read' ,
13+ locale: ' en-US' ,
14+ },
15+ de: {
16+ section: ' Release Notes' ,
17+ readingTime: ' Min. Lesezeit' ,
18+ locale: ' de-CH' ,
19+ },
20+ fr: {
21+ section: ' Release Notes' ,
22+ readingTime: ' min de lecture' ,
23+ locale: ' fr-CH' ,
24+ },
25+ it: {
26+ section: ' Release Notes' ,
27+ readingTime: ' min di lettura' ,
28+ locale: ' it-CH' ,
29+ },
30+ }
31+
32+ const currentLang = computed (() => {
33+ const rel = page .value .relativePath || ' '
34+ const langFromPath = rel .match (/ \. (de| fr| it)\. md$ / )? .[1 ]
35+ return langFromPath || frontmatter .value .lang || ' en'
36+ })
37+
38+ const metaCopy = computed (() => META_COPY [currentLang .value ] ?? META_COPY .en )
639
740function formatDate (dateStr ) {
841 if (! dateStr) return ' '
942 const d = new Date (dateStr)
10- return d .toLocaleDateString (' en-US ' , {
43+ return d .toLocaleDateString (metaCopy . value . locale , {
1144 year: ' numeric' ,
1245 month: ' long' ,
1346 day: ' numeric' ,
@@ -20,22 +53,26 @@ function formatDate(dateStr) {
2053 <!-- Hero Header -->
2154 < div class = " blog-hero" >
2255 < div style= " max-width: 800px; margin: 0 auto;" >
23- <div style =" font-size : 0.75em ; letter-spacing : 1px ; text-transform : uppercase ; opacity : 0.7 ; margin-bottom : 12px ; font-family : ' Lato ' , sans-serif ;" >
24- Release Notes
56+ < div style= " font-size: 0.75em; letter-spacing: 1px; text-transform: uppercase; opacity: 0.7; margin-bottom: 12px; font-family: var(--vp-font-family-base) ;" >
57+ {{ metaCopy . section }}
2558 < / div>
2659 < h1 style= " color: #fff; margin: 0 0 16px; font-size: 2em; line-height: 1.2;" >
2760 {{ frontmatter .title }}
2861 < / h1>
29- <div style =" display : flex ; gap : 20px ; font-size : 0.85em ; opacity : 0.85 ; font-family : ' Lato ' , sans-serif ; flex-wrap : wrap ;" >
62+ < div style= " display: flex; gap: 20px; font-size: 0.85em; opacity: 0.85; font-family: var(--vp-font-family-base) ; flex-wrap: wrap;" >
3063 < span v- if = " frontmatter.date" > 📅 {{ formatDate (frontmatter .date ) }}< / span>
31- <span v-if =" frontmatter.readingTime" >⏱ {{ frontmatter.readingTime }} min read </span >
64+ < span v- if = " frontmatter.readingTime" > ⏱ {{ frontmatter .readingTime }} {{ metaCopy . readingTime }} < / span>
3265 < / div>
3366 < / div>
3467 < / div>
3568
36- <!-- Content rendered from Markdown -->
37- <div class =" blog-content" >
38- <Content />
69+ < div class = " blog-post-shell" >
70+ < ReleaseNotesSidebar / >
71+
72+ <!-- Content rendered from Markdown -->
73+ < div class = " blog-content blog-content--post" >
74+ < Content / >
75+ < / div>
3976 < / div>
4077
4178 < LegalFooter / >
0 commit comments