mirror of
https://github.com/samber/lo.git
synced 2026-04-22 15:37:14 +08:00
fix(seo): sync meta tags, robots.txt and sitemap config from samber/do
- Add twitter:site, og:locale, og:site_name head tags - Add fallback description meta tag - Exclude /search from sitemap - Disallow /search and /tags/ in robots.txt
This commit is contained in:
@@ -135,9 +135,35 @@ const config: Config = {
|
||||
content: '@samuelberthe',
|
||||
},
|
||||
},
|
||||
// NOTE: do not add a global <link rel="canonical"> here.
|
||||
// Docusaurus generates correct per-page canonical tags from the `url` field above.
|
||||
// A global canonical in headTags applies to ALL pages and conflicts with those.
|
||||
// twitter:site complements twitter:creator for card attribution
|
||||
{
|
||||
tagName: 'meta',
|
||||
attributes: {
|
||||
name: 'twitter:site',
|
||||
content: '@samuelberthe',
|
||||
},
|
||||
},
|
||||
// og:locale signals language/region to crawlers and social platforms
|
||||
{
|
||||
tagName: 'meta',
|
||||
attributes: {
|
||||
property: 'og:locale',
|
||||
content: 'en_US',
|
||||
},
|
||||
},
|
||||
// og:site_name provides branding context in social share cards
|
||||
{
|
||||
tagName: 'meta',
|
||||
attributes: {
|
||||
property: 'og:site_name',
|
||||
content: 'samber/lo',
|
||||
},
|
||||
},
|
||||
// NOTE: do NOT add a global <link rel="canonical"> here.
|
||||
// Docusaurus injects a correct per-page canonical automatically
|
||||
// based on `url` + `baseUrl` + the page path. A static href here
|
||||
// would override every page's canonical to the homepage, causing
|
||||
// Google to treat all docs pages as non-canonical duplicates.
|
||||
],
|
||||
|
||||
customFields: {
|
||||
@@ -181,7 +207,7 @@ const config: Config = {
|
||||
lastmod: 'date',
|
||||
changefreq: 'weekly',
|
||||
priority: 0.7,
|
||||
ignorePatterns: ['/tags/**'],
|
||||
ignorePatterns: ['/tags/**', '/search'],
|
||||
filename: 'sitemap.xml',
|
||||
// Enhanced sitemap features from 3.8+
|
||||
createSitemapItems: async (params) => {
|
||||
@@ -228,8 +254,12 @@ const config: Config = {
|
||||
},
|
||||
|
||||
// Enhanced metadata
|
||||
// og:type defaults to "website"; individual doc pages that need
|
||||
// "article" should override via their page's <Layout> or frontmatter.
|
||||
metadata: [
|
||||
{name: 'og:type', content: 'website'},
|
||||
// Fallback description for pages that don't set their own
|
||||
{name: 'description', content: 'A Lodash-style utility library for Go. Slices, maps, channels, and more — type-safe, using generics.'},
|
||||
],
|
||||
|
||||
navbar: {
|
||||
|
||||
Vendored
+4
@@ -1,4 +1,8 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
# Low-value pages — no need to crawl or index
|
||||
Disallow: /search
|
||||
Disallow: /tags/
|
||||
|
||||
Sitemap: https://lo.samber.dev/sitemap.xml
|
||||
|
||||
Reference in New Issue
Block a user