Add a blog, built from pages
A post is a page in the panel's "Blog" category, so it is written, translated, scheduled and reviewed like any page, and the MCP server can publish one the same way. Nothing new in the API. - /blog (/en/blog, /ca/blog): posts newest first, with image, date and excerpt. - A post shows its date and leads back to the blog; its structured data is a BlogPosting. - /blog/rss.xml?lang=xx: one feed per language, announced in <head>. - Posts stay out of the header and the footer, which links the blog once there is any post instead of growing with every one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,9 +8,11 @@ import {
|
||||
import { copyFor, type Copy } from '../core/copy';
|
||||
import { listingAlternates, listingPath } from '../core/routes';
|
||||
import { memberLinks } from './member-card';
|
||||
import { isBlogPost } from '../core/blog';
|
||||
import type { Locale } from '../core/api';
|
||||
import { RadarPage } from './radar-page';
|
||||
import { ServiceDetail } from './service-detail';
|
||||
import { BlogPage } from './blog-page';
|
||||
import { CallDetail } from './call-detail';
|
||||
import type { RoutedPageData, RoutedRecord } from '../core/routed-page';
|
||||
import { ContentPage } from './content-page';
|
||||
@@ -27,6 +29,7 @@ import { ProjectDetail } from './project-detail';
|
||||
selector: 'app-routed-page',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
BlogPage,
|
||||
CallDetail,
|
||||
ContentPage,
|
||||
ContributePage,
|
||||
@@ -69,6 +72,13 @@ import { ProjectDetail } from './project-detail';
|
||||
[locale]="data().locale"
|
||||
/>
|
||||
}
|
||||
@case ('blog') {
|
||||
<app-blog-page
|
||||
[posts]="found.record"
|
||||
[copy]="copy()"
|
||||
[locale]="data().locale"
|
||||
/>
|
||||
}
|
||||
@case ('contribute') {
|
||||
<app-contribute-page
|
||||
[calls]="found.record.calls"
|
||||
@@ -115,6 +125,7 @@ export function seoFor(
|
||||
switch (found.type) {
|
||||
case 'page': {
|
||||
const page = found.record;
|
||||
const post = isBlogPost(page, locale);
|
||||
|
||||
return {
|
||||
title: page.meta_title || `Pireon — ${page.title}`,
|
||||
@@ -123,12 +134,24 @@ export function seoFor(
|
||||
alternates: page.alternates ?? {},
|
||||
type: 'article',
|
||||
image: page.featured_image?.url,
|
||||
jsonLd: {
|
||||
'@type': 'WebPage',
|
||||
name: page.title,
|
||||
description: page.excerpt,
|
||||
inLanguage: page.locale,
|
||||
},
|
||||
feed: post ? `/blog/rss.xml?lang=${locale}` : undefined,
|
||||
jsonLd: post
|
||||
? {
|
||||
'@type': 'BlogPosting',
|
||||
headline: page.title,
|
||||
description: page.excerpt,
|
||||
inLanguage: page.locale,
|
||||
datePublished: page.published_at,
|
||||
dateModified: page.updated_at,
|
||||
image: page.featured_image?.url,
|
||||
publisher: { '@type': 'Organization', name: 'Pireon' },
|
||||
}
|
||||
: {
|
||||
'@type': 'WebPage',
|
||||
name: page.title,
|
||||
description: page.excerpt,
|
||||
inLanguage: page.locale,
|
||||
},
|
||||
};
|
||||
}
|
||||
case 'project': {
|
||||
@@ -200,6 +223,20 @@ export function seoFor(
|
||||
},
|
||||
};
|
||||
}
|
||||
case 'blog':
|
||||
return {
|
||||
title: `Pireon — ${copy.blog.title}`,
|
||||
description: copy.blog.lead,
|
||||
path: listingPath('blog', locale),
|
||||
alternates: listingAlternates('blog'),
|
||||
type: 'website',
|
||||
feed: `/blog/rss.xml?lang=${locale}`,
|
||||
jsonLd: {
|
||||
'@type': 'Blog',
|
||||
name: copy.blog.title,
|
||||
description: copy.blog.lead,
|
||||
},
|
||||
};
|
||||
case 'contribute':
|
||||
return {
|
||||
title: `Pireon — ${copy.contribute.title}`,
|
||||
|
||||
Reference in New Issue
Block a user