1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-29 19:20:39 +02:00

RSS fix (hopefully?)

This commit is contained in:
Pomax
2020-09-23 17:49:14 -07:00
parent 490f36632d
commit dda4808a34
8 changed files with 17 additions and 14 deletions

View File

@@ -31,7 +31,7 @@
<meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-23T03:51:04+00:00" />
<meta property="og:updated_time" content="2020-09-24T00:48:27+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />

View File

@@ -33,7 +33,7 @@
<meta property="og:locale" content="ja-JP" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-23T03:51:04+00:00" />
<meta property="og:updated_time" content="2020-09-24T00:48:27+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />

View File

@@ -26,8 +26,8 @@
<meta property="og:description" content="Rewriting the tech stack" />
<meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2020-09-18T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-23T03:51:04+00:00" />
<meta property="og:published_time" content="Thu Sep 17 2020 17:00:00 +00:00" />
<meta property="og:updated_time" content="Wed Sep 23 2020 17:48:27 +00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />

View File

@@ -26,7 +26,7 @@
<meta property="og:description" content="" />
<meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="Tue Sep 22 2020 20:51:04 GMT-0700 (Pacific Daylight Time)" />
<meta property="og:published_time" content="Wed Sep 23 2020 17:48:27 GMT-0700 (Pacific Daylight Time)" />
<meta property="og:updated_time" content="" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />

View File

@@ -6,7 +6,7 @@
<atom:link href="https://pomax.github.io/bezierinfo" rel="self"></atom:link>
<description>News updates for the <a href="https://pomax.github.io/bezierinfo">primer on Bézier Curves</a> by Pomax</description>
<language>en-GB</language>
<lastBuildDate>Tue Sep 22 2020 20:51:04 GMT-0700 (Pacific Daylight Time)</lastBuildDate>
<lastBuildDate>Wed Sep 23 2020 17:48:27 +00:00</lastBuildDate>
<image>
<url>https://pomax.github.io/bezierinfo/images/og-image.png</url>
<title>A Primer on Bézier Curves</title>
@@ -61,7 +61,7 @@
&lt;p&gt;See you in the next post!&lt;/p&gt;
&lt;p&gt;— Pomax&lt;/p&gt;
</description>
<pubDate>2020-09-18</pubDate>
<pubDate>Thu Sep 17 2020 17:00:00 +00:00</pubDate>
<guid>2020-09-18.html</guid>
</item>

View File

@@ -33,7 +33,7 @@
<meta property="og:locale" content="zh-CN" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-23T03:51:04+00:00" />
<meta property="og:updated_time" content="2020-09-24T00:48:27+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />

View File

@@ -60,7 +60,9 @@ async function generatePost(file, localeStrings) {
const title = post.substring(post.indexOf(`<h1>`) + 4, post.indexOf(`</h1>`));
post = post.replace(`<h1>${title}</h1>`, ``);
const postDateTime = new Date(postDate).toString();
const pubDate = `${postDateTime.substring(0, postDateTime.indexOf(`GMT`) - 1)} +00:00`;
const now = new Date().toString();
const renderContext = {
base,
post,
@@ -70,12 +72,12 @@ async function generatePost(file, localeStrings) {
filename,
locale,
dateString,
publishTime: `${postDate}T12:00:00+00:00`,
currentTime: new Date().toISOString().substring(0, 19) + "+00:00",
publishTime: pubDate,
currentTime: `${now.substring(0, now.indexOf("GMT") - 1)} +00:00`,
};
const newspage = nunjucks.render(`post.template.html`, renderContext);
fs.writeFileSync(path.join(paths.news, filename), newspage, `utf8`);
return { filename, postDate, title, post, dateString };
return { filename, pubDate, title, post, dateString };
}
/**
@@ -96,9 +98,10 @@ function generateNewsIndex(details) {
* ...docs go here...
*/
function generateRSSFeed(details) {
const now = new Date().toString();
const renderContext = {
items: details,
buildDate: new Date(),
buildDate: `${now.substring(0, now.indexOf(`GMT`) - 1)} +00:00`,
};
const index = nunjucks.render(`rss.template.xml`, renderContext);
fs.writeFileSync(path.join(paths.news, `rss.xml`), index, `utf8`);

View File

@@ -18,7 +18,7 @@
<title>{{ item.title }}</title>
<link>https://pomax.github.io/bezierinfo/news/{{ item.filename }}</link>
<description>{{ item.post | escape }}</description>
<pubDate>{{ item.postDate }}</pubDate>
<pubDate>{{ item.pubDate }}</pubDate>
<guid>{{ item.filename }}</guid>
</item>
{% endfor %}