11<script setup lang="ts">
2+ const router = useRouter ()
3+
24import type { BlogPostFrontmatter } from ' #shared/schemas/blog'
5+ import { isModEventDivert } from ' @atproto/api/dist/client/types/tools/ozone/moderation/defs'
36
47const blogModules = import .meta .glob <BlogPostFrontmatter >(' ./*.md' , { eager: true })
58
@@ -17,44 +20,69 @@ const placeHolder = ['atproto', 'nuxt']
1720
1821definePageMeta ({
1922 name: ' blog' ,
20- // alias: ['/:path(.*)*'],
2123})
2224
2325useSeoMeta ({
24- title : () => $t (' blog.title' ),
25- description : () => $t (' blog.description' ),
26+ title : () => ` ${$t (' blog.title' )} - npmx ` ,
27+ ogTitle : () => ` ${$t (' blog.title' )} - npmx ` ,
28+ twitterTitle : () => ` ${$t (' blog.title' )} - npmx ` ,
29+ description : () => $t (' blog.meta_description' ),
30+ ogDescription : () => $t (' blog.meta_description' ),
31+ twitterDescription : () => $t (' blog.meta_description' ),
2632})
2733 </script >
2834
2935<template >
30- <main class =" container py-8 sm:py-12 w-full" >
31- <header class =" mb-8 pb-8 border-b border-border flex place-content-center text-3xl" >
32- <h1 class =" " >blog...</h1 >
33- </header >
34-
35- <article v-if =" posts && posts.length > 0" class =" mx-30 space-y-4" >
36- <BlogPostListCard
37- v-for =" (post, idx) in posts"
38- :key =" `${post.authors.map(a => a.name).join('-')}-${post.title}`"
39- :authors =" post.authors"
40- :title =" post.title"
41- :path =" post.slug"
42- :excerpt =" post.excerpt || post.description || 'No Excerpt Available'"
43- :topics =" Array.isArray(post.tags) ? post.tags : placeHolder"
44- :published =" post.date"
45- :index =" idx"
46- @focus =" i => console.log('Hovered:', i)"
47- />
48- <!-- :selected="toSuggestionIndex(unifiedSelectedIndex) === idx" -->
49- <!-- :is-exact-match="
50- (exactMatchType === 'org' && suggestion.type === 'org') ||
51- (exactMatchType === 'user' && suggestion.type === 'user')
52- " -->
53- <!-- @focus="handleBlogPostSelect" -->
54- <!-- </div> -->
36+ <main class =" container w-full flex-1 py-12 sm:py-16 overflow-x-hidden" >
37+ <article class =" max-w-2xl mx-auto" >
38+ <header class =" mb-12" >
39+ <div class =" flex items-baseline justify-between gap-4 mb-4" >
40+ <h1 class =" font-mono text-3xl sm:text-4xl font-medium" >
41+ {{ $t('blog.heading') }}
42+ </h1 >
43+ <button
44+ type =" button"
45+ class =" inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0"
46+ @click =" router.back()"
47+ >
48+ <span class =" i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden =" true" />
49+ <span class =" hidden sm:inline" >{{ $t('nav.back') }}</span >
50+ </button >
51+ </div >
52+ <p class =" text-fg-muted text-lg" >
53+ {{ $t('tagline') }}
54+ </p >
55+ </header >
56+ <article v-if =" posts && posts.length > 0" class =" flex flex-col gap-8" >
57+ <template
58+ v-for =" (post , idx ) in posts "
59+ :key =" ` ${post .authors .map (a => a .name ).join (' -' )}-${post .title } ` "
60+ >
61+ <BlogPostListCard
62+ :authors =" post.authors"
63+ :title =" post.title"
64+ :path =" post.slug"
65+ :excerpt =" post.excerpt || post.description || 'No Excerpt Available'"
66+ :topics =" Array.isArray(post.tags) ? post.tags : placeHolder"
67+ :published =" post.date"
68+ :index =" idx"
69+ @focus =" i => console.log('Hovered:', i)"
70+ />
71+ <hr v-if =" idx < posts.length - 1" class =" border-border-subtle" />
72+ </template >
73+ <!-- :selected="toSuggestionIndex(unifiedSelectedIndex) === idx" -->
74+ <!-- :is-exact-match="
75+ (exactMatchType === 'org' && suggestion.type === 'org') ||
76+ (exactMatchType === 'user' && suggestion.type === 'user')
77+ " -->
78+ <!-- @focus="handleBlogPostSelect" -->
79+ <!-- </div> -->
80+ </article >
81+
82+ <isModEventDivert v-else class =" text-center py-20 text-fg-subtle"
83+ >No posts found.</isModEventDivert
84+ >
5585 </article >
56-
57- <article v-else class =" text-center py-20 text-fg-subtle" >No posts found.</article >
5886 </main >
5987</template >
6088
0 commit comments