Skip to content

Commit 9261871

Browse files
committed
Add & configure RSS, add RSS button to Footer
1 parent 6dcef07 commit 9261871

File tree

5 files changed

+126
-1
lines changed

5 files changed

+126
-1
lines changed

gatsby-config.js

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,60 @@ module.exports = {
1010
facebookUsername: `@vladaverett`,
1111
},
1212
plugins: [
13+
{
14+
resolve: `gatsby-plugin-feed`,
15+
options: {
16+
query: `
17+
{
18+
site {
19+
siteMetadata {
20+
title
21+
description
22+
siteUrl
23+
site_url: siteUrl
24+
}
25+
}
26+
}
27+
`,
28+
feeds: [
29+
{
30+
serialize: ({ query: { site, allMdx } }) => {
31+
return allMdx.nodes.map(node => {
32+
return Object.assign({}, node.frontmatter, {
33+
description: node.excerpt,
34+
date: node.frontmatter.date,
35+
title: node.frontmatter.titleDetailed || node.frontmatter.title,
36+
url: site.siteMetadata.siteUrl + node.frontmatter.slug,
37+
guid: site.siteMetadata.siteUrl + node.frontmatter.slug,
38+
custom_elements: [{ "content:encoded": node.excerpt }],
39+
})
40+
})
41+
},
42+
query: `
43+
{
44+
allMdx(
45+
sort: { frontmatter: { index: DESC } }
46+
limit: 20
47+
) {
48+
nodes {
49+
excerpt
50+
frontmatter {
51+
titleDetailed
52+
title
53+
date
54+
slug
55+
index
56+
}
57+
}
58+
}
59+
}
60+
`,
61+
output: "/rss.xml",
62+
title: "avrtt.blog RSS Feed",
63+
},
64+
],
65+
},
66+
},
1367
{
1468
resolve: `gatsby-plugin-sitemap`,
1569
options: {
@@ -163,4 +217,4 @@ module.exports = {
163217
},
164218
},
165219
],
166-
}
220+
}

package-lock.json

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"d3": "^7.9.0",
4747
"framer-motion": "^11.3.31",
4848
"gatsby": "^5.13.7",
49+
"gatsby-plugin-feed": "^5.14.0",
4950
"gatsby-plugin-image": "^3.13.1",
5051
"gatsby-plugin-manifest": "^5.13.1",
5152
"gatsby-plugin-mdx": "^5.13.1",

src/components/Footer/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Email from "./email.svg";
66
import Map from "./map.svg";
77
import YouTube from "./youtube.svg";
88
import Facebook from "./facebook.svg";
9+
import RSS from "./rss.svg";
910
import { footerYear } from "../../data/lastUpdated";
1011
import { freelanceStatus, location } from "../../data/announcements"
1112
import { startHoursUTC, endHoursUTC } from '../../utils/freelance';
@@ -57,6 +58,9 @@ const Footer = () => {
5758
<a className={styles.footerLink} href="https://www.google.com/maps/d/viewer?mid=1X9b0bo11WcY9on87ZQXoB3YUkccwnK49&ll=0.3349379679001004%2C0&z=2">
5859
<img src={Map} className={styles.linkImg} alt="map-logo"/>
5960
</a>
61+
<a className={styles.footerLink} href="/rss.xml">
62+
<img src={RSS} className={styles.linkImg} alt="rss-logo"/>
63+
</a>
6064
</div>
6165

6266
{/* badges on the left */}

src/components/Footer/rss.svg

Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)