initial news page

This commit is contained in:
Justin Cooper 2018-11-26 16:43:11 -06:00
parent b1166803b0
commit b8f46203a5
4 changed files with 61 additions and 0 deletions

View file

@ -14,3 +14,4 @@
@import 'pages/home';
@import 'pages/downloads';
@import 'pages/download';
@import 'pages/news';

View file

@ -0,0 +1,15 @@
.post-list {
margin-left: 0;
list-style: none;
> li {
margin-bottom: 30px;
}
h2 {
line-height: 24px;
a {
color: #000;
}
}
}

45
news.html Normal file
View file

@ -0,0 +1,45 @@
---
layout: default
---
<div class="home">
<ul class="post-list">
{% for post in site.posts %}
<li>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
<h2>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</h2>
<article class="post-content">
{{ post.excerpt }}
</article>
</li>
{% endfor %}
</ul>
{% include paginator.html %}
</div>
<script type='text/javascript'>
window.onload = function () {
try {
var headers = document.querySelectorAll('article h2');
headers.forEach(function (hdr) {
var title = hdr.closest('li').querySelector('.post-link');
console.log(title.innerText);
console.log(hdr.innerText);
if (hdr.innerText === title.innerText) {
console.log('here');
hdr.remove();
}
});
} catch (ex) {
// ignore
}
}
</script>