mirror of
https://github.com/apophenia-news/apophenia.news.git
synced 2026-10-29 06:44:56 +00:00
Feat: Add NewsArticle JSON-LD, large image previews and automatic modified dates
Articles get NewsArticle structured data (headline, image, dates, author, publisher) plus article:published_time and article:modified_time, and the homepage gets WebSite and Organization data. Every indexable page allows max-image-preview:large. The modified date is the article folder's last commit, so editing an article updates it, the sitemap lastmod included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,7 @@ export const merch = `
|
||||
</section>
|
||||
`;
|
||||
|
||||
export const shellHead = ({ title, desc, image, url, type = "website", noindex = false }) => `<!doctype html>
|
||||
export const shellHead = ({ title, desc, image, url, type = "website", noindex = false, published, modified, jsonLd }) => `<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -85,7 +85,10 @@ export const shellHead = ({ title, desc, image, url, type = "website", noindex =
|
||||
${url ? `<meta property="og:url" content="${url}" />` : ""}
|
||||
${image ? `<meta property="og:image" content="${image}" />` : ""}
|
||||
<meta name="theme-color" content="#fcfcfa" />
|
||||
${noindex ? `<meta name="robots" content="noindex" />` : ""}
|
||||
<meta name="robots" content="${noindex ? "noindex" : "max-image-preview:large"}" />
|
||||
${published ? `<meta property="article:published_time" content="${published}" />` : ""}
|
||||
${modified ? `<meta property="article:modified_time" content="${modified}" />` : ""}
|
||||
${jsonLd ? `<script type="application/ld+json">${JSON.stringify(jsonLd).replace(/</g, "\\u003c")}</script>` : ""}
|
||||
${url ? `<link rel="canonical" href="${url}" />` : ""}
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="alternate" type="application/rss+xml" title="apophenia.news RSS" href="${SITE_URL}/rss.xml" />
|
||||
|
||||
Reference in New Issue
Block a user