New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Static Medium feed #276
Conversation
@@ -6,7 +6,7 @@ HUGO_VERSION = "0.53" | |||
|
|||
[build] | |||
publish = "public" | |||
command = "gulp sass && hugo" | |||
command = "gulp sass && npm run data-medium && hugo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Netlify will download the feed. You can do it manually with npm run data-medium
. This should probably go into the readme or combined into package.json scripts.
@@ -23,6 +23,7 @@ | |||
"webpack-cli": "^3.3.5" | |||
}, | |||
"scripts": { | |||
"data-medium": "mkdir -p data && node tools/rss-to-json.js https://medium.com/feed/nav-coin ./data/medium.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Download into Hugo's data directory
<h3>Loading...</h3> | ||
</div> | ||
<div id="latest-news" class="card-container"> | ||
{{ range first 8 .Site.Data.medium.items }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit 8 from Hugo data
@@ -0,0 +1,15 @@ | |||
<div class="homepage-news-card"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just ported from the React js.
Description
#267 adds the Medium RSS feed and components. This PR just makes it static. No request needs to be made if you do it like this.
The parser is moved to
./tools/rss-to-json.js
and might be reused if other feeds are tapped. Netlify should pull the data before hugo renders.If you like this approach the React stuff can be backed up and used as a starting point for #269.
Issues Resolved
None are resolved. #265 #267 related.
Preview Links
https://deploy-preview-276--navhub.netlify.com/
It has the same appearance.
With a blocker this section will still render.
Checklist
Mobile emulator view