mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Tweak JS to work on a 2nd click, too. Tweak CSS for shorter highlight and linear transition.
36 lines
1.0 KiB
HTML
36 lines
1.0 KiB
HTML
---
|
|
layout: default
|
|
title: Home
|
|
---
|
|
<div class="newest-post">
|
|
<emph>Latest Post</emph>: {% for post in site.categories.rust-os limit:1 %}
|
|
<strong><a href="#{{ post.id }}" onclick="
|
|
post = document.getElementById('{{ post.id }}');
|
|
post.className = post.className.replace(/\b updated\b/, '');
|
|
post.offsetWidth = post.offsetWidth; // trigger reflow -> works on 2nd click, too
|
|
post.className += ' updated';
|
|
">{{post.title}}</a></strong>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="posts">
|
|
{% for post in site.categories.rust-os reversed %}
|
|
<article class="post" id="{{ post.id }}">
|
|
<h1 class="post-title">
|
|
<a href="{{ site.baseurl }}{{ post.url }}">
|
|
{{ post.title }}
|
|
</a>
|
|
</h1>
|
|
|
|
<time datetime="{{ post.date | date_to_xmlschema }}" class="post-date">{{ post.date | date_to_string }}</time>
|
|
|
|
{% if post.content contains '<!--more-->' %}
|
|
{{ post.content | split:'<!--more-->' | first }}
|
|
{% else %}
|
|
{{ post.excerpt }}
|
|
{% endif %}
|
|
</article>
|
|
<hr>
|
|
{% endfor %}
|
|
</div>
|