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:
@@ -3,6 +3,8 @@ export const fmtDate = (date) =>
|
||||
|
||||
export const toISODate = (d) => new Date(d).toISOString().split("T")[0];
|
||||
|
||||
export const toISO = (d) => new Date(d).toISOString();
|
||||
|
||||
export const escapeHtml = (s = "") =>
|
||||
String(s ?? "").replace(/[&<>"']/g, (ch) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[ch]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user