feat: navbar
This commit is contained in:
@@ -20,7 +20,7 @@ bun run build
|
|||||||
- [x] build with github actions
|
- [x] build with github actions
|
||||||
- [x] config in sub repo
|
- [x] config in sub repo
|
||||||
- [x] copyright
|
- [x] copyright
|
||||||
- [ ] nav bar on top
|
- [x] nav bar on top
|
||||||
- [ ] date updated
|
- [ ] date updated
|
||||||
- [ ] archive page
|
- [ ] archive page
|
||||||
- [ ] about page
|
- [ ] about page
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "md-blog",
|
"name": "md-blog",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": "https://github.com/klemek/md-blog",
|
"repository": "https://github.com/klemek/md-blog",
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { BASE_URL, TITLE, RSS_LINK } from '@/lib/meta'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<nav>
|
||||||
|
<RouterLink to="/" class="nav-title"><span v-html="TITLE"></span></RouterLink>
|
||||||
|
<span class="nav-items">
|
||||||
|
<a :href="BASE_URL + 'atom.xml'" v-html="RSS_LINK"></a>
|
||||||
|
</span>
|
||||||
|
</nav>
|
||||||
|
</template>
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { REPOSITORY, NAME, VERSION, BASE_URL, TITLE, COPYRIGHT } from '@/lib/meta'
|
import { REPOSITORY, NAME, VERSION, TITLE, COPYRIGHT } from '@/lib/meta'
|
||||||
import { stripHTML } from '@/lib/strings';
|
import { stripHTML } from '@/lib/strings';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="$route.fullPath != '/'">
|
|
||||||
<RouterLink to="/"><i icon="undo-2"></i> Back to home</RouterLink>
|
|
||||||
</template>
|
|
||||||
<hr />
|
|
||||||
<footer>
|
<footer>
|
||||||
{{ stripHTML(TITLE) }} © {{ new Date().getFullYear() }}, <span v-html="COPYRIGHT"></span> | Made with
|
{{ stripHTML(TITLE) }} © {{ new Date().getFullYear() }}, <span v-html="COPYRIGHT"></span> | Made with
|
||||||
<a :href="REPOSITORY">{{ NAME }} {{ VERSION }}</a> |
|
<a :href="REPOSITORY">{{ NAME }} {{ VERSION }}</a>
|
||||||
<a :href="BASE_URL + 'atom.xml'"><i icon="rss"></i> RSS</a>
|
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ export const REPOSITORY = packageJson.repository
|
|||||||
export const TITLE = import.meta.env.VITE_APP_TITLE
|
export const TITLE = import.meta.env.VITE_APP_TITLE
|
||||||
export const SIGNATURE = import.meta.env.VITE_APP_SIGNATURE
|
export const SIGNATURE = import.meta.env.VITE_APP_SIGNATURE
|
||||||
export const COPYRIGHT = import.meta.env.VITE_APP_COPYRIGHT
|
export const COPYRIGHT = import.meta.env.VITE_APP_COPYRIGHT
|
||||||
|
export const RSS_LINK = import.meta.env.VITE_APP_RSS_LINK
|
||||||
|
export const BACK_LINK = import.meta.env.VITE_APP_BACK_LINK
|
||||||
export const BASE_URL = import.meta.env.BASE_URL
|
export const BASE_URL = import.meta.env.BASE_URL
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import { loadArticle } from '@lib/articles'
|
|||||||
import { useRoute, onBeforeRouteUpdate, type RouteLocation } from 'vue-router'
|
import { useRoute, onBeforeRouteUpdate, type RouteLocation } from 'vue-router'
|
||||||
import NotFoundView from './NotFoundView.vue'
|
import NotFoundView from './NotFoundView.vue'
|
||||||
import { simpleDateFormat } from '@lib/dates'
|
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 PageFooter from '@components/PageFooter.vue'
|
||||||
import { stripHTML } from '@/lib/strings'
|
import { stripHTML } from '@/lib/strings'
|
||||||
|
import NavBar from '@/components/NavBar.vue'
|
||||||
|
|
||||||
const article = ref<Article | null>(null)
|
const article = ref<Article | null>(null)
|
||||||
const loading = ref<boolean>(true)
|
const loading = ref<boolean>(true)
|
||||||
@@ -34,6 +35,7 @@ onBeforeRouteUpdate(loadPage)
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<main class="article">
|
<main class="article">
|
||||||
|
<NavBar />
|
||||||
<div class="article-header">
|
<div class="article-header">
|
||||||
<RouterLink class="link-home" to="/"><i icon="undo-2">↑</i></RouterLink>
|
<RouterLink class="link-home" to="/"><i icon="undo-2">↑</i></RouterLink>
|
||||||
<h1 class="article-title" v-html="article.metadata.title"></h1>
|
<h1 class="article-title" v-html="article.metadata.title"></h1>
|
||||||
@@ -50,7 +52,9 @@ onBeforeRouteUpdate(loadPage)
|
|||||||
</div>
|
</div>
|
||||||
<div class="article-text" v-html="article.html"></div>
|
<div class="article-text" v-html="article.html"></div>
|
||||||
<div class="article-signature" v-html="SIGNATURE"></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 />
|
<PageFooter />
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { simpleDateFormat } from '@lib/dates'
|
|||||||
import { TITLE } from '@lib/meta'
|
import { TITLE } from '@lib/meta'
|
||||||
import PageFooter from '@components/PageFooter.vue'
|
import PageFooter from '@components/PageFooter.vue'
|
||||||
import { stripHTML } from '@/lib/strings'
|
import { stripHTML } from '@/lib/strings'
|
||||||
|
import NavBar from '@/components/NavBar.vue'
|
||||||
|
|
||||||
const articles = ref<ArticleMetadata[]>([])
|
const articles = ref<ArticleMetadata[]>([])
|
||||||
|
|
||||||
@@ -17,8 +18,8 @@ onBeforeMount(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main>
|
<main class="home">
|
||||||
<h1 class="title" v-html="TITLE"></h1>
|
<NavBar />
|
||||||
<template v-for="(metadata, index) in articles" v-bind:key="index">
|
<template v-for="(metadata, index) in articles" v-bind:key="index">
|
||||||
<div v-if="!metadata.draft && metadata.path" class="article-item">
|
<div v-if="!metadata.draft && metadata.path" class="article-item">
|
||||||
<RouterLink :to="metadata.path">
|
<RouterLink :to="metadata.path">
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ onBeforeMount(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main>
|
<main>
|
||||||
|
<NavBar />
|
||||||
<h1>Page not found</h1>
|
<h1>Page not found</h1>
|
||||||
<PageFooter />
|
<PageFooter />
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ export default ({ mode }: { mode: string }) => {
|
|||||||
process.env.VITE_APP_SIGNATURE = articlesConfig['signature']
|
process.env.VITE_APP_SIGNATURE = articlesConfig['signature']
|
||||||
process.env.VITE_CUSTOM_HEAD = articlesConfig['custom_head']
|
process.env.VITE_CUSTOM_HEAD = articlesConfig['custom_head']
|
||||||
process.env.VITE_APP_COPYRIGHT = articlesConfig['copyright']
|
process.env.VITE_APP_COPYRIGHT = articlesConfig['copyright']
|
||||||
|
process.env.VITE_APP_RSS_LINK = articlesConfig['rss_link']
|
||||||
|
process.env.VITE_APP_BACK_LINK = articlesConfig['back_link']
|
||||||
|
|
||||||
return defineConfig({
|
return defineConfig({
|
||||||
plugins: [vue(), vueDevTools(), mdPlugin({ mode: [Mode.HTML] })],
|
plugins: [vue(), vueDevTools(), mdPlugin({ mode: [Mode.HTML] })],
|
||||||
|
|||||||
Reference in New Issue
Block a user