mirror of
https://github.com/go-task/task.git
synced 2025-12-24 23:49:24 +01:00
improve website's SEO
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { defineConfig } from 'vitepress';
|
||||
import { defineConfig, HeadConfig } from 'vitepress';
|
||||
import githubLinksPlugin from './plugins/github-links';
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
localIconLoader
|
||||
} from 'vitepress-plugin-group-icons';
|
||||
import { team } from './team.ts';
|
||||
import { taskDescription, taskName } from './meta.ts';
|
||||
import { taskDescription, taskName, ogUrl, ogImage } from './meta.ts';
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import llmstxt, { copyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms';
|
||||
|
||||
@@ -40,7 +40,7 @@ export default defineConfig({
|
||||
{
|
||||
rel: 'icon',
|
||||
type: 'image/x-icon',
|
||||
href: '/img/favicon.icon',
|
||||
href: '/img/favicon.ico',
|
||||
sizes: '48x48'
|
||||
}
|
||||
],
|
||||
@@ -53,17 +53,23 @@ export default defineConfig({
|
||||
href: '/img/logo.svg'
|
||||
}
|
||||
],
|
||||
[
|
||||
'link',
|
||||
{
|
||||
rel: 'canonical',
|
||||
href: 'https://taskfile.dev/'
|
||||
}
|
||||
],
|
||||
[
|
||||
'meta',
|
||||
{ name: 'author', content: `${team.map((c) => c.name).join(', ')}` }
|
||||
],
|
||||
// Open Graph
|
||||
['meta', { property: 'og:type', content: 'website' }],
|
||||
['meta', { property: 'og:site_name', content: taskName }],
|
||||
['meta', { property: 'og:title', content: taskName }],
|
||||
['meta', { property: 'og:description', content: taskDescription }],
|
||||
['meta', { property: 'og:image', content: ogImage }],
|
||||
['meta', { property: 'og:url', content: ogUrl }],
|
||||
// Twitter Card
|
||||
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
|
||||
['meta', { name: 'twitter:site', content: '@taskfiledev' }],
|
||||
['meta', { name: 'twitter:title', content: taskName }],
|
||||
['meta', { name: 'twitter:description', content: taskDescription }],
|
||||
['meta', { name: 'twitter:image', content: ogImage }],
|
||||
[
|
||||
'meta',
|
||||
{
|
||||
@@ -81,6 +87,22 @@ export default defineConfig({
|
||||
}
|
||||
]
|
||||
],
|
||||
transformHead({ pageData }) {
|
||||
const head: HeadConfig[] = []
|
||||
|
||||
// Canonical URL dynamique
|
||||
const canonicalUrl = `https://taskfile.dev/${pageData.relativePath
|
||||
.replace(/\.md$/, '')
|
||||
.replace(/index$/, '')}`
|
||||
head.push(['link', { rel: 'canonical', href: canonicalUrl }])
|
||||
|
||||
// Noindex pour 404
|
||||
if (pageData.relativePath === '404.md') {
|
||||
head.push(['meta', { name: 'robots', content: 'noindex, nofollow' }])
|
||||
}
|
||||
|
||||
return head
|
||||
},
|
||||
srcDir: 'src',
|
||||
cleanUrls: true,
|
||||
markdown: {
|
||||
@@ -342,6 +364,12 @@ export default defineConfig({
|
||||
}
|
||||
},
|
||||
sitemap: {
|
||||
hostname: 'https://taskfile.dev'
|
||||
hostname: 'https://taskfile.dev',
|
||||
transformItems: (items) => {
|
||||
return items.map((item) => ({
|
||||
...item,
|
||||
lastmod: new Date().toISOString()
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,3 +3,4 @@ export const taskDescription =
|
||||
'A fast, cross-platform build tool inspired by Make, designed for modern workflows.';
|
||||
|
||||
export const ogUrl = 'https://taskfile.dev/';
|
||||
export const ogImage = 'https://taskfile.dev/img/logo.png';
|
||||
|
||||
@@ -20,10 +20,8 @@
|
||||
"vitepress": "^1.6.3",
|
||||
"vitepress-plugin-group-icons": "^1.6.1",
|
||||
"vitepress-plugin-tabs": "^0.7.1",
|
||||
"vitepress-plugin-llms": "^1.9.1",
|
||||
"vue": "^3.5.18"
|
||||
},
|
||||
"packageManager": "pnpm@10.26.0+sha512.3b3f6c725ebe712506c0ab1ad4133cf86b1f4b687effce62a9b38b4d72e3954242e643190fc51fa1642949c735f403debd44f5cb0edd657abe63a8b6a7e1e402",
|
||||
"dependencies": {
|
||||
"vitepress-plugin-llms": "^1.9.1"
|
||||
}
|
||||
"packageManager": "pnpm@10.26.0+sha512.3b3f6c725ebe712506c0ab1ad4133cf86b1f4b687effce62a9b38b4d72e3954242e643190fc51fa1642949c735f403debd44f5cb0edd657abe63a8b6a7e1e402"
|
||||
}
|
||||
|
||||
7
website/pnpm-lock.yaml
generated
7
website/pnpm-lock.yaml
generated
@@ -7,10 +7,6 @@ settings:
|
||||
importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
vitepress-plugin-llms:
|
||||
specifier: ^1.9.1
|
||||
version: 1.9.3
|
||||
devDependencies:
|
||||
'@types/markdown-it':
|
||||
specifier: ^14.1.2
|
||||
@@ -30,6 +26,9 @@ importers:
|
||||
vitepress-plugin-group-icons:
|
||||
specifier: ^1.6.1
|
||||
version: 1.6.5(vite@5.4.19(@types/node@24.10.4))
|
||||
vitepress-plugin-llms:
|
||||
specifier: ^1.9.1
|
||||
version: 1.9.3
|
||||
vitepress-plugin-tabs:
|
||||
specifier: ^0.7.1
|
||||
version: 0.7.3(vitepress@1.6.4(@algolia/client-search@5.35.0)(@types/node@24.10.4)(jwt-decode@4.0.0)(postcss@8.5.6)(search-insights@2.17.3)(typescript@5.9.3))(vue@3.5.25(typescript@5.9.3))
|
||||
|
||||
BIN
website/src/public/favicon.ico
Normal file
BIN
website/src/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 170 KiB |
Reference in New Issue
Block a user