Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Proposal: Static Medium feed #276

wants to merge 2 commits into from

Conversation

tcrowe
Copy link

@tcrowe tcrowe commented Jan 3, 2020

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.

Screen Shot 2020-01-03 at 1 33 08 PM

With a blocker this section will still render.

Screen Shot 2020-01-03 at 1 28 05 PM

Checklist

  • Have you assigned/claimed the issues you've resolved in this pull request?
  • Have the issues been moved to the QA column of the NavCoin Websites project?
  • Have you checked there are no merge conflicts?
  • Have you tested the changes work across both mobile and desktop?

Mobile emulator view

Screen Shot 2020-01-03 at 1 39 55 PM

@tcrowe tcrowe changed the title Proposal: Static medium feed Proposal: Static Medium feed Jan 3, 2020
@@ -6,7 +6,7 @@ HUGO_VERSION = "0.53"

[build]
publish = "public"
command = "gulp sass && hugo"
command = "gulp sass && npm run data-medium && hugo"
Copy link
Author

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",
Copy link
Author

@tcrowe tcrowe Jan 3, 2020

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 }}
Copy link
Author

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">
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant