Skip to content

Commit

Permalink
feat: add banner
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdayo committed Sep 1, 2023
1 parent dcc4cd6 commit 8d96a56
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
3 changes: 2 additions & 1 deletion content/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ export default defineConfigWithTheme<BsBlogThemeConfig>({

themeConfig: {
author: 'bsdayo',
bio: '♪sakana——\\(>○<\\)♪',
bio: '怎么会是呢?',
avatar: 'https://avatars.githubusercontent.com/u/41754841',
avatarBg: '/img/avatarBg.jpg',
defaultPostCover: 'https://cdn.vuetifyjs.com/images/parallax/material.jpg',
navLinks: [
{
Expand Down
1 change: 1 addition & 0 deletions content/pages/links/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ Pull Request;或是直接在下面评论。记得带上类似上面的的格
</v-container>

<script setup>
import LinkCard from './LinkCard.vue'
</script>
Binary file added content/public/img/avatarBg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 24 additions & 12 deletions theme/components/MainFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ defineEmits<{
</script>

<template>
<v-navigation-drawer v-model="drawerOpened">
<v-img class="d-flex align-end text-white" :src="theme.avatarBg" height="150px" :cover="true">
<v-list-item>
<template #prepend>
<v-avatar size="56">
<v-img :src="theme.avatar"/>
</v-avatar>
</template>

<v-list-item-title>{{ theme.author }}</v-list-item-title>
<v-list-item-subtitle>{{ theme.bio }}</v-list-item-subtitle>
</v-list-item>
</v-img>

<v-list :nav="true">
<v-list-item v-for="link in theme.navLinks"
:key="link.href"
@click="drawerOpened = $vuetify.display.mobile ? false : drawerOpened"
:prepend-icon="link.icon"
:title="link.title"
:value="link.title"
:href="link.href"/>
</v-list>
</v-navigation-drawer>

<v-app-bar>
<template #prepend>
Expand All @@ -25,18 +49,6 @@ defineEmits<{
<v-btn icon="mdi-brightness-6" @click="$emit('toggleTheme')"/>
</template>
</v-app-bar>

<v-navigation-drawer v-model="drawerOpened">
<v-list :nav="true">
<v-list-item v-for="link in theme.navLinks"
:key="link.href"
@click="drawerOpened = $vuetify.display.mobile ? false : drawerOpened"
:prepend-icon="link.icon"
:title="link.title"
:value="link.title"
:href="link.href"/>
</v-list>
</v-navigation-drawer>
</template>

<style scoped lang="scss">
Expand Down
1 change: 1 addition & 0 deletions theme/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface BsBlogThemeConfig {
author: string
bio: string
avatar: string
avatarBg: string
defaultPostCover: string
navLinks?: NavLink[]
socialLinks?: SocialLink[]
Expand Down

0 comments on commit 8d96a56

Please sign in to comment.