2121 </div >
2222 </div >
2323 </template >
24+ <template #contentAfter v-if =" firstPublishedDate " >
25+ <div style =" text-align : right ; font-size : 14px ; color : #3c3c43 ; margin-bottom : -45px ; margin-top : 32px ;" >{{ firstPublishedDatePlaceholder }}<span style =" color : #3c3c43c7 ;" >{{ firstPublishedDate }}</span ></div >
26+ </template >
2427 </Layout >
2528</template >
2629
@@ -30,12 +33,24 @@ import { Layout } from 'vuepress-theme-hope/client';
3033import { ref , watch , computed } from ' vue' ;
3134import { useRoute , withBase , useRouter } from ' vuepress/client' ;
3235import { getDialect , getDocVersion , URL_SUFFIX } from ' ../utils/index.js' ;
36+ import { usePageData } from " vuepress/client" ;
37+ import dayjs from " dayjs" ;
3338
3439const route = useRoute ();
3540const router = useRouter ();
3641const currentLang = ref (' zh' );
3742const currentVersion = ref (' ' );
3843const currentDialect = ref (' ' );
44+ const page = usePageData ();
45+
46+ const firstPublishedDate = computed (() => {
47+ const raw = page .value .frontmatter .publishedDate ;
48+ return raw ? (currentLang .value === ' zh' ? dayjs (raw ).format (" YYYY/M/D HH:mm" ) : dayjs (raw ).format (" D/M/YY, h:mm A" )) : null
49+ })
50+
51+ const firstPublishedDatePlaceholder = computed (() => {
52+ return currentLang .value === ' zh' ? ' 首次发布: ' : ' First Published: ' ;
53+ })
3954
4055const ModelName = computed (() => {
4156 return currentLang .value === ' zh' ? {
0 commit comments