Commit 876cf28e authored by Sam Beckham's avatar Sam Beckham 🔴

Adds content to the RSS feed

parent 8d68e875
Pipeline #87069709 passed with stages
in 2 minutes and 45 seconds
......@@ -3,6 +3,7 @@
// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
const blocksToHtml = require("@sanity/block-content-to-html");
const clientConfig = require("./client.config");
const { NODE_ENV, GRIDSOME_BASE_PATH, SANITY_TOKEN } = process.env;
......@@ -11,6 +12,20 @@ const SITE_NAME = "Sam Beckham";
const SITE_DESCRIPTION =
"The personal website, blog, portfolio, and playground of Sam Beckham. Senior frontend engineer at GitLab";
// `h` is a way to build HTML known as hyperscript
// See https://github.com/hyperhype/hyperscript for more info
const h = blocksToHtml.h;
const serializers = {
types: {
code: ({ node }) =>
h("pre", { className: node.language }, h("code", node.code)),
a11yImage: ({ node }) => h("img", { src: node.src }),
tweet: ({ node }) => h("div", node.tweetId),
codepen: ({ node }) => h("div", node.url)
}
};
module.exports = {
siteName: SITE_NAME,
titleTemplate: `%s | ${SITE_NAME}`,
......@@ -44,7 +59,15 @@ module.exports = {
title: node.title,
description: node.description,
url: `${GRIDSOME_BASE_PATH}/wrote/${node.slug.current}`,
date: node.publishedAt
date: node.publishedAt,
custom_elements: [
{
content: blocksToHtml({
blocks: node.rtBody,
serializers: serializers
})
}
]
})
}
}
......
This diff is collapsed.
......@@ -743,6 +743,13 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==
"@sanity/block-content-to-html@^1.3.8":
version "1.3.8"
resolved "https://registry.yarnpkg.com/@sanity/block-content-to-html/-/block-content-to-html-1.3.8.tgz#eff8e3dafe82f4a7e10ed914f7fa646c3e59ec2d"
integrity sha512-eXXilwPQCFe2uHMK5DItzZWg2CgaCfbo2hpcY1BbJEDPNhPjRlkaNBxM65U9M6yxreNnFffTNWHORVX3vZmIeQ==
dependencies:
"@sanity/block-content-to-hyperscript" "^2.0.5"
"@sanity/block-content-to-hyperscript@^2.0.5":
version "2.0.10"
resolved "https://registry.yarnpkg.com/@sanity/block-content-to-hyperscript/-/block-content-to-hyperscript-2.0.10.tgz#9cf805c5d2341d043bcab8b3740c9b3466b5ae6b"
......@@ -4277,9 +4284,10 @@ graphql@^14.4.2, graphql@^14.5.4:
dependencies:
iterall "^1.2.2"
"gridsome-plugin-rss@github:samdbeckham/gridsome-plugin-rss.git#dateField":
version "1.1.3"
resolved "https://codeload.github.com/samdbeckham/gridsome-plugin-rss/tar.gz/2f35ffdca59bde404464eae5eed8ac593bf6d6e9"
gridsome-plugin-rss@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/gridsome-plugin-rss/-/gridsome-plugin-rss-1.2.0.tgz#9614f16bf77b97b8e6471428c8487195cf7f9168"
integrity sha512-rC96wu1RhMjHnrdH2AKz6zcBkdNfGSVyULXUQeFlvp74uNT9u71roRI/JlMLayk+ViMsUnxMFSJ6ExIwHTSYZQ==
dependencies:
rss "^1.2.2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment