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

Featured Medium post should be most recent post #366

Merged
merged 3 commits into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions themes/tracer/layouts/partials/home/cncf.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
<img src="/img/cncf-logo.png" alt="">
</div>
</section>

19 changes: 16 additions & 3 deletions themes/tracer/layouts/partials/home/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,23 @@ <h2 class="dark-blue">Libraries available in {{ len $languages }} languages</h2>
</p>
</div>
{{- with $hero.update -}}
<div class="update">
<a href="{{ .url }}" target="_blank">
{{ .title }}
<h4>The latest from our blog:</h4>
<div id="update" class="update">
<a href="" target="_blank">
</a>
<script type="text/javascript">
fetch('https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fmedium.com%2Ffeed%2Fopentracing')
.then(function(res) {
res.json().then(function(data) {
let item = data.items[0];
let content = `<a href="${item.link}" target="_blank">${item.title}</a>`;
document.getElementById('update').innerHTML = content;
});
}).catch(function() {
let content = `<a href="https://medium.com/opentracing" target="_blank">OpenTracing on Medium</a>`
document.getElementById('update').innerHTML = content;
});
</script>
</div>
{{- end -}}
</section>
Expand Down