on master help sign in
rss: fix link building
commit120d44bfabe6c717baf9c00f393e304565a277ff authorHunter Miller <hunter@thisdot.co> dateWed 28 Jul 2021, 18:52 (5 years ago) parenta4900e9
1 file changed+4−6
lib/rss.js+4−6
lib/rss.js+4−6
@@ -24,17 +24,15 @@ const generateRSSFeed = () => {
2424 fs.readFileSync(path.join(dir, post.name)),
2525 options
2626 );
27+ const leadingDir = dir.substr(dir.indexOf("content") + 8);
28+ const name = post.name.replace(/.md$/, "");
29+
2730 return {
2831 title: pageData.title,
2932 descripton: pageData.description || "",
3033 author: pageData.extra.author || "",
3134 date: pageData.date,
32− link: path.join(
33− "https://urbit.org/",
34− dir.substr(dir.indexOf("content") + 7),
35− "/",
36− post.name.replace(/.md$/, "")
37− ),
35+ link: `https://urbit.org/${leadingDir}/${name}`,
3836 content: pageContent,
3937 };
4038 });