feat: navbar
This commit is contained in:
@@ -5,9 +5,10 @@ import { loadArticle } from '@lib/articles'
|
||||
import { useRoute, onBeforeRouteUpdate, type RouteLocation } from 'vue-router'
|
||||
import NotFoundView from './NotFoundView.vue'
|
||||
import { simpleDateFormat } from '@lib/dates'
|
||||
import { SIGNATURE, TITLE } from '@lib/meta'
|
||||
import { BACK_LINK, SIGNATURE, TITLE } from '@lib/meta'
|
||||
import PageFooter from '@components/PageFooter.vue'
|
||||
import { stripHTML } from '@/lib/strings'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
|
||||
const article = ref<Article | null>(null)
|
||||
const loading = ref<boolean>(true)
|
||||
@@ -34,6 +35,7 @@ onBeforeRouteUpdate(loadPage)
|
||||
</template>
|
||||
<template v-else>
|
||||
<main class="article">
|
||||
<NavBar />
|
||||
<div class="article-header">
|
||||
<RouterLink class="link-home" to="/"><i icon="undo-2">↑</i></RouterLink>
|
||||
<h1 class="article-title" v-html="article.metadata.title"></h1>
|
||||
@@ -50,7 +52,9 @@ onBeforeRouteUpdate(loadPage)
|
||||
</div>
|
||||
<div class="article-text" v-html="article.html"></div>
|
||||
<div class="article-signature" v-html="SIGNATURE"></div>
|
||||
<br />
|
||||
<template v-if="$route.fullPath != '/'">
|
||||
<RouterLink class="link-back" to="/"><span v-html="BACK_LINK"></span></RouterLink>
|
||||
</template>
|
||||
<PageFooter />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@@ -6,6 +6,7 @@ import { simpleDateFormat } from '@lib/dates'
|
||||
import { TITLE } from '@lib/meta'
|
||||
import PageFooter from '@components/PageFooter.vue'
|
||||
import { stripHTML } from '@/lib/strings'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
|
||||
const articles = ref<ArticleMetadata[]>([])
|
||||
|
||||
@@ -17,8 +18,8 @@ onBeforeMount(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<h1 class="title" v-html="TITLE"></h1>
|
||||
<main class="home">
|
||||
<NavBar />
|
||||
<template v-for="(metadata, index) in articles" v-bind:key="index">
|
||||
<div v-if="!metadata.draft && metadata.path" class="article-item">
|
||||
<RouterLink :to="metadata.path">
|
||||
|
||||
@@ -11,6 +11,7 @@ onBeforeMount(() => {
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<NavBar />
|
||||
<h1>Page not found</h1>
|
||||
<PageFooter />
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user