Skip to content

Commit

Permalink
Display page.category and page.date fields in the default layout
Browse files Browse the repository at this point in the history
  • Loading branch information
wandrien committed Apr 4, 2024
1 parent d48f6ae commit 16df4a4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
28 changes: 21 additions & 7 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,31 @@ <h1>{{ page.title | default: site.github.repository_name }}</h1>

<div class="container">

{% if page.tags %}
<section class="tags">
Метки:
{% for tag in page.tags %}
[<a href="/tag/{{ tag }}/">{{ tag }}</a>]
{% endfor %}
<section class="metadata">
{% if page.tags or page.category %}
<span class="tags">
{% if page.category %}
[<a href="/{{ page.category | url_encode }}/">{{ page.category }}</a>]
{% endif %}
{% for tag in page.tags %}
[<a href="/tag/{{ tag }}/">{{ tag }}</a>]
{% endfor %}
</span>
{% endif %}
</section>
{% endif %}

<section id="main_content">
{{ content }}
</section>

<section class="metadata">
{% if page.date %}
<span class="date">
{{ page.date | date: "%Y.%m.%d" }}
</span>
{% endif %}
</section>

</div>

{% if site.google_analytics %}
Expand Down Expand Up @@ -78,3 +91,4 @@ <h1>{{ page.title | default: site.github.repository_name }}</h1>

</body>
</html>
<!-- -%- indent-width: 2; use-tabs: no; -%- -->
10 changes: 9 additions & 1 deletion assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ ul li::before { margin-left: -27px; margin-right: 11px; }
ul li::before { margin-left: -37px; margin-right: 21px; }
}

.tags { font-size: 90%; opacity: 0.7;}
.metadata {
font-size: 90%; opacity: 0.7;
}
.metadata > * {
display: block;
}
.metadata .date {
text-align: right;
}

code.highlighter-rouge {
background: none !important;
Expand Down

0 comments on commit 16df4a4

Please sign in to comment.