@sarimarcus/content-sites-core 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/url/feed.d.ts +20 -0
- package/dist/url/feed.js +16 -0
- package/dist/url/index.d.ts +2 -0
- package/dist/url/index.js +1 -0
- package/package.json +1 -1
- package/src/url/feed.ts +34 -0
- package/src/url/index.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.18.0 (2026-10-02)
|
|
6
|
+
|
|
7
|
+
- `./url`: `articleFeedItem(article, site, author?)` builds one @astrojs/rss item (relative `/articles/<slug>` link, date-only values read as noon UTC, the OG image as `media:content`) (SLA-2744).
|
|
8
|
+
|
|
9
|
+
## 0.17.0 (2026-10-01)
|
|
10
|
+
|
|
11
|
+
- No changes; released in lockstep (SLA-2741).
|
|
12
|
+
|
|
5
13
|
## 0.16.0 (2026-10-01)
|
|
6
14
|
|
|
7
15
|
- `./config`: `PAGEFIND_EXCLUDE_SELECTORS`, the selectors `defineSiteConfig` passes to Pagefind, now exported (SLA-2735).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface FeedArticle {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
/** ISO datetime with offset; a legacy date-only value is read as noon UTC. */
|
|
5
|
+
datePublished: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FeedItem {
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
pubDate: Date;
|
|
12
|
+
link: string;
|
|
13
|
+
customData: string;
|
|
14
|
+
author?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One @astrojs/rss item for an article: a relative /articles/<slug> link (resolved against the feed's `site`) and its
|
|
18
|
+
* 1200×675 OG image as `media:content`, so the feed needs `xmlns: { media: 'http://search.yahoo.com/mrss/' }`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function articleFeedItem(article: FeedArticle, site: URL, author?: string): FeedItem;
|
package/dist/url/feed.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getOgImagePath } from "./ogImage.js";
|
|
2
|
+
/**
|
|
3
|
+
* One @astrojs/rss item for an article: a relative /articles/<slug> link (resolved against the feed's `site`) and its
|
|
4
|
+
* 1200×675 OG image as `media:content`, so the feed needs `xmlns: { media: 'http://search.yahoo.com/mrss/' }`.
|
|
5
|
+
*/
|
|
6
|
+
export function articleFeedItem(article, site, author) {
|
|
7
|
+
const { datePublished } = article;
|
|
8
|
+
return {
|
|
9
|
+
title: article.title,
|
|
10
|
+
description: article.description,
|
|
11
|
+
pubDate: datePublished.includes('T') ? new Date(datePublished) : new Date(`${datePublished}T12:00:00+00:00`),
|
|
12
|
+
link: `/articles/${article.slug}`,
|
|
13
|
+
customData: `<media:content url="${new URL(getOgImagePath('articles', article.slug), site)}" medium="image" type="image/jpeg" width="1200" height="675" />`,
|
|
14
|
+
...(author ? { author } : {}),
|
|
15
|
+
};
|
|
16
|
+
}
|
package/dist/url/index.d.ts
CHANGED
|
@@ -2,3 +2,5 @@ export { url, normalizePagePath, toAbsoluteSiteUrl, normalizeSiteUrl } from './u
|
|
|
2
2
|
export { getOgImagePath } from './ogImage.ts';
|
|
3
3
|
export { normalizeHref, extractProseHrefs, dedupRelated } from './relatedDedup.ts';
|
|
4
4
|
export { buildImageMap, keyBySlug } from './imageMap.ts';
|
|
5
|
+
export { articleFeedItem } from './feed.ts';
|
|
6
|
+
export type { FeedArticle, FeedItem } from './feed.ts';
|
package/dist/url/index.js
CHANGED
|
@@ -3,3 +3,4 @@ export { url, normalizePagePath, toAbsoluteSiteUrl, normalizeSiteUrl } from "./u
|
|
|
3
3
|
export { getOgImagePath } from "./ogImage.js";
|
|
4
4
|
export { normalizeHref, extractProseHrefs, dedupRelated } from "./relatedDedup.js";
|
|
5
5
|
export { buildImageMap, keyBySlug } from "./imageMap.js";
|
|
6
|
+
export { articleFeedItem } from "./feed.js";
|
package/package.json
CHANGED
package/src/url/feed.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getOgImagePath } from './ogImage.ts';
|
|
2
|
+
|
|
3
|
+
export interface FeedArticle {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
/** ISO datetime with offset; a legacy date-only value is read as noon UTC. */
|
|
7
|
+
datePublished: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface FeedItem {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
pubDate: Date;
|
|
15
|
+
link: string;
|
|
16
|
+
customData: string;
|
|
17
|
+
author?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* One @astrojs/rss item for an article: a relative /articles/<slug> link (resolved against the feed's `site`) and its
|
|
22
|
+
* 1200×675 OG image as `media:content`, so the feed needs `xmlns: { media: 'http://search.yahoo.com/mrss/' }`.
|
|
23
|
+
*/
|
|
24
|
+
export function articleFeedItem(article: FeedArticle, site: URL, author?: string): FeedItem {
|
|
25
|
+
const { datePublished } = article;
|
|
26
|
+
return {
|
|
27
|
+
title: article.title,
|
|
28
|
+
description: article.description,
|
|
29
|
+
pubDate: datePublished.includes('T') ? new Date(datePublished) : new Date(`${datePublished}T12:00:00+00:00`),
|
|
30
|
+
link: `/articles/${article.slug}`,
|
|
31
|
+
customData: `<media:content url="${new URL(getOgImagePath('articles', article.slug), site)}" medium="image" type="image/jpeg" width="1200" height="675" />`,
|
|
32
|
+
...(author ? { author } : {}),
|
|
33
|
+
};
|
|
34
|
+
}
|
package/src/url/index.ts
CHANGED
|
@@ -3,3 +3,5 @@ export { url, normalizePagePath, toAbsoluteSiteUrl, normalizeSiteUrl } from './u
|
|
|
3
3
|
export { getOgImagePath } from './ogImage.ts';
|
|
4
4
|
export { normalizeHref, extractProseHrefs, dedupRelated } from './relatedDedup.ts';
|
|
5
5
|
export { buildImageMap, keyBySlug } from './imageMap.ts';
|
|
6
|
+
export { articleFeedItem } from './feed.ts';
|
|
7
|
+
export type { FeedArticle, FeedItem } from './feed.ts';
|