From fa418d48f0117556a293e126869e97b245e110b2 Mon Sep 17 00:00:00 2001 From: arthurfiorette Date: Tue, 7 Feb 2023 16:43:20 -0300 Subject: [PATCH] feat: improved og tags --- docs/.vitepress/config.ts | 47 ++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 57e4435f..7317f316 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -13,14 +13,17 @@ console.log( : 'Building docs for latest version' ); +const description = + 'Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!'; +const url = 'https://axios-cache-interceptor.js.org'; + export default defineConfig({ // The language of the site. This will be used to set the `lang` attribute on the element lang: 'en-US', // Title for the site. This will be displayed in the nav bar also used as the suffix for all page titles title: 'Axios Cache Interceptor', // Description for the site. This will render as a tag in the page HTML - description: - 'Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!', + description: description, // The directory where the markdown pages are stored srcDir: './src', @@ -131,6 +134,7 @@ export default defineConfig({ href: `${BASE_URL}favicon-16x16.png` } ], + ['link', { rel: 'manifest', href: `${BASE_URL}manifest.json` }], ['meta', { name: 'msapplication-TileColor', content: '#e5972a' }], [ @@ -138,25 +142,22 @@ export default defineConfig({ { name: 'msapplication-TileImage', content: `${BASE_URL}ms-icon-144x144.png` } ], ['meta', { name: 'theme-color', content: '#e5972a' }], + ['meta', { name: 'description', content: description }], - // OG + // Facebook Meta Tags + ['meta', { property: 'og:url', content: url }], ['meta', { property: 'og:type', content: 'website' }], - ['meta', { property: 'og:url', content: 'https://axios-cache-interceptor.js.org' }], ['meta', { property: 'og:title', content: 'Axios Cache Interceptor' }], - [ - 'meta', - { - property: 'og:description', - content: 'Small and efficient cache interceptor for axios.' - } - ], - [ - 'meta', - { - property: 'og:image', - content: `${BASE_URL}preview.png` - } - ], + ['meta', { property: 'og:description', content: description }], + ['meta', { property: 'og:image', content: `${BASE_URL}preview.png` }], + + // Twitter Meta Tags + ['meta', { name: 'twitter:card', content: 'summary_large_image' }], + ['meta', { property: 'twitter:domain', content: url.replace(/https?:\/\//, '') }], + ['meta', { property: 'twitter:url', content: url }], + ['meta', { name: 'twitter:title', content: 'Axios Cache Interceptor' }], + ['meta', { name: 'twitter:description', content: description }], + ['meta', { name: 'twitter:image', content: `${BASE_URL}preview.png` }], // Analytics :( // This is an open source documentation project, analytics is being used to only track the number of visitors. @@ -186,12 +187,12 @@ export default defineConfig({ '@context': 'http://www.schema.org', '@type': 'Organization', name: 'Axios Cache Interceptor', - url: 'https://axios-cache-interceptor.js.org/', + url: url, sameAs: ['https://github.com/ArthurFiorette/axios-cache-interceptor'], datePublished: '2022-01-17', dateModified: '2022-01-17', - logo: 'https://axios-cache-interceptor.js.org/preview.png', - image: 'https://axios-cache-interceptor.js.org/preview.png', + logo: `${url}/preview.png`, + image: `${url}/preview.png`, description: 'Axios Cache Interceptor is a small and efficient cache interceptor for axios.', headline: 'A small and efficient cache interceptor for axios.' @@ -231,8 +232,8 @@ export default defineConfig({ { text: VERSION, items: [ - { text: 'Latest', link: 'https://axios-cache-interceptor.js.org/' }, - { text: 'v0.x', link: 'https://axios-cache-interceptor.js.org/v0/' } + { text: 'Latest', link: url }, + { text: 'v0.x', link: `${url}/v0/` } ].filter((i) => BASE_URL === '/' ? i.text !== 'Latest' : !i.link.includes(BASE_URL) )