This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/routes/blogEntry.vue

84 lines
2.0 KiB
Vue
Raw Normal View History

<template>
<NotFound v-if="!content"/>
<div v-else class="blog-post">
2021-10-31 07:55:15 -07:00
<LinksNav v-if="config.links.split"/>
<p v-else>
<router-link :to="'/' + config.links.blogRoute" v-if="config.links.blog">
<Icon v="pen-nib"/>
<T>links.blog</T>
</router-link>
</p>
2022-04-16 04:57:07 -07:00
<Spelling v-if="disableTwemoji" :text="content"/>
<Twemoji v-else>
2021-12-16 07:08:28 -08:00
<Spelling :text="content"/>
</Twemoji>
2021-04-14 10:17:57 -07:00
<Separator icon="heart"/>
<Support/>
<section>
<Share :title="title"/>
</section>
</div>
</template>
<script>
import { head } from "../src/helpers";
2021-09-07 11:01:52 -07:00
import parseMarkdown from '../src/parseMarkdown';
export default {
2022-04-16 04:57:07 -07:00
data() {
return {
selGroup: 'general',
}
},
async asyncData({route}) {
return parseMarkdown((await import(`../data/blog/${route.params.slug || route.meta[0].slug}.md`)).default);
},
head() {
return head({
title: this.title,
2021-12-23 08:56:27 -08:00
description: this.intro,
banner: this.img,
});
},
};
</script>
<style lang="scss">
@import "assets/variables";
.blog-post {
img {
max-width: 100%;
}
figure {
width: 100%;
max-width: 24rem;
padding: $spacer;
img {
width: 100%;
}
figcaption {
margin-top: $spacer / 2;
font-size: $small-font-size;
}
}
.forms-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(18rem, 3fr));
grid-gap: $spacer;
justify-items: center;
figure {
padding: 0;
figcaption {
font-size: 90%;
}
}
}
}
</style>