-
Notifications
You must be signed in to change notification settings - Fork 35
Docs/updates to docs layout #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8018623
09d346d
a66c2d2
4ee5ad8
9a01771
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
User-agent: * | ||
Allow: / | ||
|
||
# Sitemap | ||
Sitemap: https://docs.kinde.com/sitemap-0.xml | ||
# Sitemap location | ||
Sitemap: https://docs.kinde.com/sitemap-0.xml | ||
|
||
# Crawl delay for respectful crawling | ||
Crawl-delay: 1 | ||
|
||
# Allow all major search engines | ||
User-agent: Googlebot | ||
Allow: / | ||
|
||
User-agent: Bingbot | ||
Allow: / | ||
|
||
User-agent: Slurp | ||
Allow: / | ||
|
||
# Disallow admin or private areas (if any exist in the future) | ||
Disallow: /admin/ |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,7 +10,20 @@ export const collections = { | |||||
page_id: z.string().uuid(), | ||||||
relatedArticles: z.string().array().optional().nullable(), | ||||||
app_context: z.array(z.any()).optional(), | ||||||
social_sharing_image_url: z.string().optional() | ||||||
social_sharing_image_url: z.string().optional(), | ||||||
// Enhanced metadata for SEO - made more flexible to match existing content | ||||||
metadata: z.object({ | ||||||
topics: z.array(z.string()).optional(), | ||||||
sdk: z.array(z.string()).optional(), | ||||||
languages: z.array(z.string()).optional(), | ||||||
audience: z.array(z.string()).optional(), | ||||||
complexity: z.enum(['beginner', 'intermediate', 'advanced']).optional(), | ||||||
keywords: z.array(z.string()).optional(), | ||||||
updated: z.union([z.string(), z.date()]).optional(), // Allow both string and date | ||||||
featured: z.boolean().optional(), | ||||||
deprecated: z.boolean().optional(), | ||||||
'ai-summary': z.string().optional() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use consistent camelCase naming for all metadata fields The field - 'ai-summary': z.string().optional()
+ aiSummary: z.string().optional() Note: This change will require updates in other files that reference this field. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||
}).optional() | ||||||
}) | ||||||
}) | ||||||
}), | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,115 @@ | |
import Default from "@astrojs/starlight/components/Head.astro"; | ||
import type {Props} from "@astrojs/starlight/props"; | ||
|
||
const { entry } = Astro.props; | ||
const hasCustomOGImage = Astro.props.entry.data.head.find((t) => | ||
t.attrs.property === "og:image" ? true : false | ||
); | ||
--- | ||
|
||
{ | ||
import.meta.env.PUBLIC_IS_ANALYTICS_ENABLED === "true" && ( | ||
<script data-domain="kinde.com" src="https://kinde.com/js/script.tagged-events.js" defer /> | ||
) | ||
// Extract metadata from frontmatter - handle both patterns | ||
// Pattern 1: metadata wrapper object | ||
// Pattern 2: fields directly in frontmatter | ||
const metadata = entry.data.metadata || {}; | ||
const directFields = entry.data as any; | ||
|
||
// Combine both sources, with metadata wrapper taking precedence | ||
const keywords = metadata.keywords || directFields.keywords || []; | ||
const topics = metadata.topics || directFields.topics || []; | ||
const audience = metadata.audience || directFields.audience || []; | ||
const complexity = metadata.complexity || directFields.complexity; | ||
const updated = metadata.updated || directFields.updated; | ||
const featured = metadata.featured || directFields.featured; | ||
const deprecated = metadata.deprecated || directFields.deprecated; | ||
const aiSummary = metadata['ai-summary'] || directFields['ai-summary']; | ||
|
||
// Handle updated field - convert date to string if needed | ||
const updatedString = updated instanceof Date ? updated.toISOString() : updated; | ||
|
||
// Combine keywords from different sources | ||
const allKeywords = [ | ||
...keywords, | ||
...topics, | ||
...audience, | ||
complexity, | ||
entry.data.title, | ||
entry.data.description | ||
].filter(Boolean); | ||
|
||
// Create structured data for better SEO | ||
const structuredData: any = { | ||
"@context": "https://schema.org", | ||
"@type": "TechArticle", | ||
"headline": entry.data.title, | ||
"description": entry.data.description, | ||
"keywords": allKeywords.join(", "), | ||
"author": { | ||
"@type": "Organization", | ||
"name": "Kinde" | ||
}, | ||
"publisher": { | ||
"@type": "Organization", | ||
"name": "Kinde", | ||
"url": "https://kinde.com" | ||
}, | ||
"mainEntityOfPage": { | ||
"@type": "WebPage", | ||
"@id": Astro.url.href | ||
}, | ||
"articleSection": topics.join(", "), | ||
"articleBody": entry.data.description, | ||
"wordCount": entry.data.description?.length || 0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix inaccurate wordCount - using character count instead of word count The Either calculate the actual word count or remove this field: - "wordCount": entry.data.description?.length || 0,
+ "wordCount": entry.data.description?.split(/\s+/).filter(Boolean).length || 0, Or remove it entirely if an accurate count from the full content isn't available: - "wordCount": entry.data.description?.length || 0,
🤖 Prompt for AI Agents
|
||
"dateModified": updatedString, | ||
"inLanguage": "en-US", | ||
"isAccessibleForFree": true, | ||
"educationalLevel": complexity || "Beginner", | ||
"audience": { | ||
"@type": "Audience", | ||
"audienceType": audience.join(", ") | ||
} | ||
}; | ||
|
||
// Add featured/deprecated status if available | ||
if (featured !== undefined) { | ||
structuredData.isPartOf = { | ||
"@type": "CreativeWork", | ||
"isFeatured": featured | ||
}; | ||
} | ||
|
||
if (deprecated !== undefined) { | ||
structuredData.isDeprecated = deprecated; | ||
} | ||
--- | ||
|
||
<Default {...Astro.props} /> | ||
|
||
<!-- Enhanced SEO Meta Tags --> | ||
<meta name="keywords" content={allKeywords.join(", ")} /> | ||
<meta name="article:section" content={topics.join(", ")} /> | ||
<meta name="article:tag" content={keywords.join(", ")} /> | ||
<meta name="article:difficulty" content={complexity || "Beginner"} /> | ||
{updatedString && <meta name="article:modified_time" content={updatedString} />} | ||
{featured && <meta name="article:featured" content={featured.toString()} />} | ||
{deprecated && <meta name="article:deprecated" content={deprecated.toString()} />} | ||
|
||
<!-- Enhanced Open Graph Tags --> | ||
<meta property="og:keywords" content={allKeywords.join(", ")} /> | ||
<meta property="og:article:section" content={topics.join(", ")} /> | ||
<meta property="og:article:tag" content={keywords.join(", ")} /> | ||
{complexity && <meta property="og:article:difficulty" content={complexity} />} | ||
{updatedString && <meta property="og:article:modified_time" content={updatedString} />} | ||
|
||
<!-- Enhanced Twitter Card Tags --> | ||
<meta name="twitter:description" content={entry.data.description} /> | ||
{allKeywords.length > 0 && <meta name="twitter:keywords" content={allKeywords.join(", ")} />} | ||
|
||
<!-- Structured Data --> | ||
<script type="application/ld+json" set:html={JSON.stringify(structuredData)} /> | ||
|
||
<Default {...Astro.props}> | ||
<slot /> | ||
</Default> | ||
<!-- AI Summary for enhanced search --> | ||
{aiSummary && <meta name="ai-summary" content={aiSummary} />} | ||
|
||
{!hasCustomOGImage && <meta property="og:image" content={`${Astro.url.href}og-image.png`} />} | ||
<!-- Custom OG Image if not already set --> | ||
{!hasCustomOGImage && entry.data.social_sharing_image_url && ( | ||
<meta property="og:image" content={entry.data.social_sharing_image_url} /> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use actual content modification dates instead of build time for
lastmod
Using
new Date()
sets the same modification date (build time) for all pages in the sitemap, which doesn't reflect actual content changes and could mislead search engines about update frequency.Consider using actual file modification dates or the
updated
metadata field from your content files for more accurate lastmod values.Apply this approach to use actual modification dates:
🤖 Prompt for AI Agents