-
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6463 from kodadot/main
- Loading branch information
Showing
87 changed files
with
2,507 additions
and
3,274 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,117 @@ | ||
<template> | ||
<div class="article"> | ||
<div | ||
class="is-flex is-justify-content-space-between has-text-grey is-size-5"> | ||
<div>{{ attributes.tags }}</div> | ||
<div v-if="attributes.date"> | ||
{{ format(new Date(attributes.date), 'dd.MM.yyyy') }} | ||
</div> | ||
</div> | ||
<h1>{{ attributes.title }}</h1> | ||
<p v-if="attributes.subtitle" class="subtitle">{{ attributes.subtitle }}</p> | ||
<img | ||
v-if="attributes.image" | ||
:src="attributes.image" | ||
:alt="attributes.title" | ||
width="100%" /> | ||
<component :is="singlePostComponent" /> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { format } from 'date-fns' | ||
import { convertMarkdownToText } from '@/utils/markdown' | ||
const { $seoMeta } = useNuxtApp() | ||
const route = useRoute() | ||
const slug = route.params.slug | ||
const attributes = ref({}) | ||
const singlePostComponent = ref('') | ||
onMounted(async () => { | ||
const post = await import(`~/content/blog/${slug}.md`) | ||
attributes.value = post.attributes | ||
singlePostComponent.value = post.vue.component | ||
}) | ||
const title = computed(() => attributes.value.title) | ||
const meta = computed(() => { | ||
return [ | ||
...$seoMeta({ | ||
title: attributes.value.title, | ||
description: convertMarkdownToText(attributes.value.subtitle), | ||
url: route.path, | ||
image: attributes.value.image, | ||
}), | ||
] | ||
}) | ||
useNuxt2Meta({ | ||
title, | ||
meta, | ||
}) | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '@/styles/abstracts/variables'; | ||
.article { | ||
margin: 0 auto; | ||
max-width: 40rem; | ||
.subtitle { | ||
font-size: 25px; | ||
margin-bottom: 0; | ||
} | ||
h1 { | ||
font-size: 3rem; | ||
font-weight: 700; | ||
margin: 1rem 0; | ||
} | ||
h2 { | ||
font-size: 1.5rem; | ||
font-weight: bold; | ||
margin-bottom: 1rem; | ||
} | ||
img { | ||
border-radius: 1rem; | ||
margin: 2.5rem 0; | ||
} | ||
p { | ||
font-size: 20px; | ||
line-height: 30px; | ||
margin-bottom: 1rem; | ||
} | ||
@include ktheme() { | ||
.markdown-body { | ||
color: theme('k-accentlight2-dark'); | ||
} | ||
img { | ||
border: 1px solid theme('border-color'); | ||
} | ||
} | ||
@include touch { | ||
.subtitle { | ||
font-size: 1.25rem; | ||
} | ||
h1 { | ||
font-size: 1.75rem; | ||
} | ||
h2, | ||
p { | ||
font-size: 1rem; | ||
} | ||
} | ||
} | ||
</style> |
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
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.