This repository has been archived by the owner on Feb 11, 2024. It is now read-only.
generated from valaxyjs/valaxy-theme-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
122 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script setup lang="ts"> | ||
import type { Post } from 'valaxy' | ||
import { formatDate } from 'valaxy' | ||
import { useI18n } from 'vue-i18n' | ||
defineProps<{ | ||
frontmatter: Post | ||
}>() | ||
const { t } = useI18n() | ||
</script> | ||
|
||
<template> | ||
<div class="text-right text-sm text-gray-500"> | ||
<span v-if="frontmatter.updated !== frontmatter.date" class="inline-block mr-2"> | ||
<div class="mr-1 i-ri-calendar-check-fill inline-block" /> | ||
<span>{{ t('post.edited') }}</span> | ||
<time :title="t('post.modified') + t('symbol.colon') + frontmatter.updated" itemprop="dateModified" :datetime="formatDate(frontmatter.date || '')"> | ||
{{ formatDate(frontmatter.updated || frontmatter.date || '') }} | ||
</time> | ||
</span> | ||
</div> | ||
<!-- 等待和waline&twikoo进行阅读量重构 --> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script setup lang="ts"> | ||
import { usePrevNext } from 'valaxy' | ||
import ShokaxPostNavBlock from './ShokaxPostNavBlock.vue' | ||
const [prev, next] = usePrevNext() | ||
</script> | ||
|
||
<template> | ||
<div class="post-nav flex mb-4"> | ||
<div class="item left w-1/2"> | ||
<ShokaxPostNavBlock v-if="prev" type="prev" :item="prev" /> | ||
</div> | ||
<div class="item right w-1/2"> | ||
<ShokaxPostNavBlock v-if="next" type="next" :item="next" /> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup lang="ts"> | ||
import type { Post } from 'valaxy' | ||
import { useI18n } from 'vue-i18n' | ||
import { getCover } from '../composables' | ||
const props = defineProps<{ | ||
item: Post | ||
type: 'next' | 'prev' | ||
}>() | ||
const cover = getCover(props.item) | ||
let lastcat: string | ||
if (typeof props.item.categories === 'object') | ||
lastcat = props.item.categories[-1] | ||
else if (typeof props.item.categories === 'string') | ||
lastcat = props.item.categories | ||
const { t } = useI18n() | ||
</script> | ||
|
||
<template> | ||
<a | ||
:href="item.path" | ||
class="flex flex-col h-full text-white p-5 bg-cover relative" | ||
:rel="type" | ||
itemprop="url" | ||
:data-background-image="item.cover || cover" | ||
:title="item.title || item.path || t('post.untitled')" | ||
> | ||
<span class="type text-sm self-start"> {{ t(`post.${type}`) }}</span> | ||
<span v-if="lastcat" class="category text-sm self-start"> | ||
<div class="i-ri-flag-fill" /> | ||
{{ lastcat }} | ||
</span> | ||
<h3> | ||
{{ item.title || item.path || t('post.untitled') }} | ||
</h3> | ||
</a> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters