Comments (4)
From your code, script will be like:
<script>
export default {
metaInfo() {
return {
title: this.$page.documentation.title,
// just include a link property in this returned object here
link: [{ rel: 'canonical', href: `${this.getBaseUrl}${this.$page.documentation.path}/` }],
meta: [
{
key: 'description',
name: 'description',
content: this.$page.documentation.excerpt,
},
{ name: 'description', content: this.$page.documentation.excerpt },
{ name: 'twitter:card', content: 'summary_large_image' },
{
name: 'twitter:description',
content: this.$page.documentation.excerpt,
},
{ name: 'twitter:title', content: this.$page.documentation.title },
{
name: 'twitter:site',
content: `@${this.$static.metadata.siteAuthor}`,
},
{
name: 'twitter:image',
content: `${this.getBaseUrl}/default-thumb.png`,
},
{
name: 'twitter:creator',
content: `@${this.$static.metadata.siteAuthor}`,
},
{ property: 'og:type', content: 'document' },
{ property: 'og:title', content: this.$page.documentation.title },
{
property: 'og:description',
content: this.$page.documentation.excerpt,
},
{
property: 'og:url',
content: `${this.getBaseUrl}${this.$page.documentation.path}/`,
},
{
property: 'og:image',
content: `${this.getBaseUrl}/default-thumb.png`,
},
{
property: 'og:image:secure_url',
content: `${this.getBaseUrl}/default-thumb.png`,
},
],
}
},
components: {
AppSidebar: () => import('~/components/parts/AppSidebar'),
},
}
</script>
from gridsome.
You can return an array of 'link' as well as 'meta'. An example below. I might have added siteUrl to the config to access it via a static query like is shown here.
<script>
export default {
metaInfo() {
const pathUrl = `${this.$static.metadata.siteUrl}${this.$route.path}`
return {
link: [{ rel: 'canonical', href: pathUrl }],
meta: [{ property: 'og:url', content: pathUrl }],
}
},
}
</script>
from gridsome.
can you please implement this in above code and give full ? Thanks
from gridsome.
can I insert multiple <script> tag..?
from gridsome.
Related Issues (20)
- page query how to use router param
- How to download images on build and serve from dist instead of remote airtable? HOT 1
- Out of memory issue when Rendering HTML for a large site
- URL in the address bar changes, but it does not load the page HOT 1
- Error: Failed to process image ...gif. Input buffer contains unsupported image format HOT 1
- starter project creation error macbook m1 HOT 2
- Dynamic pages using templates HOT 1
- error while using gridsome/vue-remark
- Load content within content container
- Gridsome i18n dynamic router with dot doesnt work HOT 1
- Gridsome is not really static and titles don't work when refreshing HOT 1
- Create a section that doesnt reload when you switch from page
- gridsome build stuck HOT 2
- how to use @gridsome/transformer-remark to marked
- An error which says "Failed to process image xxxx" happened when run gridsome build
- Google Analytics 4? HOT 1
- Will Gridsome continue to have support and updates? Or will it become a deprecated technology? HOT 4
- Gridsome build stucked
- Building with dynamically generated pages for tags fails.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridsome.