on master help sign in
rss: fix link building
120d44bHunter Miller
lib/rss.js+4−6
@@ -24,17 +24,15 @@ const generateRSSFeed = () => {
24 fs.readFileSync(path.join(dir, post.name)),
24 fs.readFileSync(path.join(dir, post.name)),
25 options
25 options
26 );
26 );
27+ const leadingDir = dir.substr(dir.indexOf("content") + 8);
28+ const name = post.name.replace(/.md$/, "");
29+
27 return {
30 return {
28 title: pageData.title,
31 title: pageData.title,
29 descripton: pageData.description || "",
32 descripton: pageData.description || "",
30 author: pageData.extra.author || "",
33 author: pageData.extra.author || "",
31 date: pageData.date,
34 date: pageData.date,
32− link: path.join(
33− "https://urbit.org/",
35+ link: `https://urbit.org/${leadingDir}/${name}`,
34− dir.substr(dir.indexOf("content") + 7),
35− "/",
36− post.name.replace(/.md$/, "")
37− ),
38 content: pageContent,
36 content: pageContent,
39 };
37 };
40 });
38 });