@ -47,7 +47,7 @@
|
||||
<p class="menu-label">{{ category }}</p>
|
||||
<ul class="menu-list">
|
||||
<li v-for="(item, key) of pages" :key="key">
|
||||
<NuxtLink :to="item.slug" exact-active-class="is-active">
|
||||
<NuxtLink :to="'/' + item.slug" exact-active-class="is-active">
|
||||
{{ item.title }}
|
||||
</NuxtLink>
|
||||
</li>
|
||||
|
@ -7,7 +7,7 @@ export default {
|
||||
|
||||
// Global page headers: https://go.nuxtjs.dev/config-head
|
||||
head: {
|
||||
title: "S3rius' dev blog",
|
||||
title: 'Dev blog',
|
||||
meta: [
|
||||
{ charset: 'utf-8' },
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||
@ -58,6 +58,8 @@ export default {
|
||||
'@nuxt/content',
|
||||
// https://sitemap.nuxtjs.org/
|
||||
'@nuxtjs/sitemap',
|
||||
// https://github.com/nuxt-community/robots-module
|
||||
'@nuxtjs/robots'
|
||||
],
|
||||
|
||||
// Axios module configuration: https://go.nuxtjs.dev/config-axios
|
||||
@ -104,4 +106,10 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
robots: [
|
||||
{
|
||||
UserAgent: '*',
|
||||
Sitemap: 'https://s3rius.blog/sitemap.xml'
|
||||
},
|
||||
],
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
"@nuxtjs/axios": "^5.13.6",
|
||||
"@nuxtjs/composition-api": "^0.31.0",
|
||||
"@nuxtjs/pwa": "^3.3.5",
|
||||
"@nuxtjs/robots": "^2.5.0",
|
||||
"@nuxtjs/sitemap": "^2.4.0",
|
||||
"clipboard": "^2.0.8",
|
||||
"core-js": "^3.15.1",
|
||||
|
@ -6,17 +6,20 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
defineComponent,
|
||||
useContext,
|
||||
ref,
|
||||
onMounted,
|
||||
useMeta,
|
||||
useStore,
|
||||
onMounted,
|
||||
useContext,
|
||||
defineComponent,
|
||||
} from '@nuxtjs/composition-api'
|
||||
import Prism from '~/plugins/prism'
|
||||
|
||||
export default defineComponent({
|
||||
head() {},
|
||||
setup() {
|
||||
const page = ref({})
|
||||
const { title, meta } = useMeta()
|
||||
const { $content, params, error } = useContext()
|
||||
const store = useStore()
|
||||
// Finding current path's slug.
|
||||
@ -26,6 +29,27 @@ export default defineComponent({
|
||||
.fetch()
|
||||
.then((doc) => {
|
||||
page.value = doc
|
||||
title.value = `${doc.title} - Dev blog`
|
||||
const meta_data = [
|
||||
{
|
||||
hid: 'og:title',
|
||||
name: 'og:title',
|
||||
content: doc.title,
|
||||
},
|
||||
{
|
||||
hid: 'og:description',
|
||||
name: 'og:description',
|
||||
content: doc.description,
|
||||
},
|
||||
]
|
||||
if (doc.image) {
|
||||
meta_data.push({
|
||||
hid: 'og:description',
|
||||
name: 'og:description',
|
||||
content: doc.image,
|
||||
})
|
||||
}
|
||||
meta.value = meta_data
|
||||
})
|
||||
.catch((_) => {
|
||||
error({ statusCode: 404, message: 'Page not found' })
|
||||
@ -47,7 +71,6 @@ export default defineComponent({
|
||||
@import '@/static/css/global-styles.scss';
|
||||
|
||||
.nuxt-content {
|
||||
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
|
||||
|
@ -1509,6 +1509,11 @@
|
||||
serve-static "^1.14.1"
|
||||
workbox-cdn "^5.1.4"
|
||||
|
||||
"@nuxtjs/robots@^2.5.0":
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@nuxtjs/robots/-/robots-2.5.0.tgz#a42b25e3bc58181cb2a8fbd30d6b0fee6c36bc60"
|
||||
integrity sha512-z1F3HXb05NiZga8Cuq6k5bbowfJOScPtbSOakip0nege+1aI9pGoajzap8eR5s1qwLXAk9Ts+NcgetoUn5lwrQ==
|
||||
|
||||
"@nuxtjs/sitemap@^2.4.0":
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@nuxtjs/sitemap/-/sitemap-2.4.0.tgz#6a9fa1c35e161f87375d59949d973568cec40614"
|
||||
|
Reference in New Issue
Block a user