-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 navigate per month and title inheritance
- Loading branch information
Showing
25 changed files
with
327 additions
and
106 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
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,58 @@ | ||
<template> | ||
<div class="taxonomy"> | ||
<ol class="taxonomy-items flex flex-wrap text-center list-none"> | ||
<li | ||
v-for="[monthNumber, monthName] in months" | ||
:key="monthName" | ||
class="is-hoverizable w-auto px-2 py-1 mb-2 mr-2" | ||
:class="{ | ||
'taxonomy-items-active': currentMonth && currentMonth === monthNumber, | ||
}" | ||
> | ||
<nuxt-link | ||
:to="{ | ||
path: `/blog/${year}/${monthNumber}`, | ||
}" | ||
> | ||
<time :datetime="`${year}-${monthNumber}`" :lang="locale"> | ||
{{ monthName }} | ||
</time> | ||
</nuxt-link> | ||
</li> | ||
</ol> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, ref } from '@nuxtjs/composition-api' | ||
import { getMonthNames, IMonthNames, isValidYear } from '~/lib' | ||
export interface Props { | ||
year: string | ||
currentMonth: string | ||
} | ||
export interface Data { | ||
months: IMonthNames | ||
} | ||
export interface Computed {} | ||
export default defineComponent<Props, Data, Computed>({ | ||
props: { | ||
year: { | ||
type: String, | ||
default: () => String(new Date().getFullYear()), | ||
validate: isValidYear, | ||
}, | ||
currentMonth: { | ||
type: String, | ||
default: '01', | ||
}, | ||
}, | ||
setup() { | ||
const locale = ref('fr-CA') | ||
const months = getMonthNames(locale.value) | ||
return { | ||
months, | ||
locale, | ||
} | ||
}, | ||
}) | ||
</script> |
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
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
Oops, something went wrong.