Skip to content

Commit

Permalink
#365 - on load, fetch latest medium posts and display on landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
austinlparker committed Nov 5, 2018
1 parent f0d8f95 commit a05a7d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
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>

20 changes: 17 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,24 @@ <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 }}
<div id="update" class="update">
<a href="" target="_blank">
</a>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script type="text/javascript">
$(function() {
var $content = $('#update');
var data = {
rss_url: 'https://medium.com/feed/opentracing'
};
$.get('https://api.rss2json.com/v1/api.json', data, function(response) {
if (response.status == 'ok') {
var output = '<a href="' + response.items[0].link + '" target="_blank">' + response.items[0].title + '</a>'
$content.html(output);
}
});
});
</script>
</div>
{{- end -}}
</section>
Expand Down

0 comments on commit a05a7d9

Please sign in to comment.