Browse Source

Render markdown to html

restructure
Garrit Franke 3 years ago
parent
commit
e58539993a
  1. 5
      content/posts/2021-01-18-reasons-the-fediverse-is-better.md
  2. 7
      content/posts/delete-twitter-use-mastodon.md
  3. 3
      lib/rss.js
  4. 21
      package-lock.json
  5. 1
      package.json

5
content/posts/2021-01-18-reasons-the-fediverse-is-better.md

@ -0,0 +1,5 @@
---
title: 5 reasons the Fediverse is better than regular social media
date: "2021-01-18"
draft: true
---

7
content/posts/delete-twitter-use-mastodon.md

@ -1,7 +0,0 @@
---
title: Delete Twitter, use Mastodon
date: "2020-10-18"
draft: true
---
All privacy concers aside, I've never been someone who ~~spends~~ wastes a lot of time on Twitter. Either their algorithm never got me or I just follow the wrong people. But thinking about it, the latter actually builds upon the former.

3
lib/rss.js

@ -3,6 +3,7 @@ const path = require("path");
const matter = require("gray-matter");
const rfc822Date = require("rfc822-date");
const markdown = require("markdown").markdown;
const files = fs
.readdirSync(path.join(__dirname, "../content/posts"))
@ -72,7 +73,7 @@ const blogPostsRssXml = (blogPosts) => {
<pubDate>${rfc822Date(new Date(postDate))}</pubDate>
<description>
<![CDATA[${post.markdownBody}]]>
<![CDATA[${markdown.toHTML(post.markdownBody)}]]>
</description>
</item>`;
});

21
package-lock.json generated

@ -1389,6 +1389,11 @@
"resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
@ -3609,6 +3614,14 @@
"object-visit": "^1.0.0"
}
},
"markdown": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/markdown/-/markdown-0.5.0.tgz",
"integrity": "sha1-KCBbVlqK51kt4gdGPWY33BgnIrI=",
"requires": {
"nopt": "~2.1.1"
}
},
"markdown-escapes": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz",
@ -4001,6 +4014,14 @@
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.61.tgz",
"integrity": "sha512-DD5vebQLg8jLCOzwupn954fbIiZht05DAZs0k2u8NStSe6h9XdsuIQL8hSRKYiU8WUQRznmSDrKGbv3ObOmC7g=="
},
"nopt": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz",
"integrity": "sha1-bMzZd7gBMqB3MdbozljCyDA8+a8=",
"requires": {
"abbrev": "1"
}
},
"normalize-html-whitespace": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/normalize-html-whitespace/-/normalize-html-whitespace-1.0.0.tgz",

1
package.json

@ -10,6 +10,7 @@
"dependencies": {
"glob": "^7.1.6",
"gray-matter": "^4.0.2",
"markdown": "^0.5.0",
"next": "9.5.3",
"raw-loader": "^4.0.1",
"react": "16.13.1",

Loading…
Cancel
Save