Skip to content

Commit 64e325e

Browse files
committed
Add Blog section to site
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
1 parent 7fe5512 commit 64e325e

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ juice_extra_menu = [
5454
{ title = "About", link = "/about", external = false },
5555
{ title = "Docs", link = "https://bootc-dev.github.io/bootc/", external = true },
5656
{ title = "News", link = "/news", external = false },
57+
{ title = "Blog", link = "/blog", external = false },
5758
{ title = "GitHub", link = "https://github.com/bootc-dev/bootc", external = true },
5859
]
5960
favicon = "favicon.ico"

content/blog/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+++
2+
title = "Blog"
3+
weight = 8
4+
sort_by = "date"
5+
template = "blog.html"
6+
page_template = "blog-page.html"
7+
+++
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% import "_macros.html" as macros %}
2+
{% extends "base.html" %}
3+
4+
{% block header %}
5+
<header class="box-shadow">
6+
{{ macros::render_header() }}
7+
</header>
8+
{% endblock header %}
9+
10+
{% block content %}
11+
<div class="heading-text">{{ page.description }}</div>
12+
{{ page.content | safe }}
13+
{% endblock content %}

themes/juice/templates/blog.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% extends "base.html" %}
2+
3+
{% block header %}
4+
<header class="box-shadow">
5+
{{ macros::render_header() }}
6+
</header>
7+
{% endblock header %}
8+
9+
{% block content %}
10+
<h1 class="title">
11+
{{ section.title }}
12+
</h1>
13+
<ul>
14+
<!-- If you are using pagination, section.pages will be empty. You need to use the paginator object -->
15+
{% for page in section.pages %}
16+
<li><a href="{{ page.permalink | safe }}">{{ page.date }} - {{ page.title }}</a></li>
17+
{% endfor %}
18+
</ul>
19+
{% endblock content %}
20+
21+
{% block sidebar %}
22+
<div class="sidebar">
23+
<h2 class="title is-2 is-block-fullhd is-skipped">Archive</h2>
24+
<ul class="link-list archive">
25+
{% set all_content = get_section(path="blog/_index.md") %}
26+
{% for post in all_content.pages %}
27+
<li><a href="{{ post.permalink }}" title="{{ post.title }}">{{ post.title }}</a></li>
28+
{% endfor %}
29+
</ul>
30+
</div>
31+
{% endblock sidebar %}

0 commit comments

Comments
 (0)