Skip to content

Commit c8539f4

Browse files
committed
update hierarchy and merge
1 parent ebe7096 commit c8539f4

File tree

10 files changed

+207
-62
lines changed

10 files changed

+207
-62
lines changed

models/blog.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ order_by = -pub_date, title
1919

2020
[pagination]
2121
enabled = yes
22-
per_page = 10
22+
per_page = 12

themes/vocabulary_theme/templates/blocks/recent-posts.html

+20-18
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,28 @@ <h4 class="is-paddingless level-left">
1414
{% for post in site.query('/blog/entries') %}
1515
{% if loop.index <= 3 %}
1616
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
17-
<article class="card entry-post horizontal no-border blog-entry column is-one-third">
18-
<header>
19-
<figure class="image blog-image">
20-
{% if author.about %}
21-
{% if author.md5_hashed_email %}
22-
<img class="profile" src="https://secure.gravatar.com/avatar/{{ author.md5_hashed_email }}?size=200"
23-
alt="gravatar" />
17+
<div class="column is-one-third is-paddingless padding-horizontal-big">
18+
<article class="card entry-post horizontal no-border blog-entry">
19+
<header>
20+
<figure class="image blog-image">
21+
{% if author.about %}
22+
{% if author.md5_hashed_email %}
23+
<img class="profile" src="https://secure.gravatar.com/avatar/{{ author.md5_hashed_email }}?size=200"
24+
alt="gravatar" />
25+
{% endif %}
2426
{% endif %}
25-
{% endif %}
26-
</figure>
27-
</header>
28-
<div class="blog-content">
29-
<h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4>
30-
<span class="blog-author">by <a class="author-name" href="{{ author|url }}">{{ render_author_name(author) }}</a>
31-
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span>
32-
<div class="excerpt">
33-
{{ post.body | excerpt | string | striptags() | truncate(100) }}
27+
</figure>
28+
</header>
29+
<div class="blog-content">
30+
<h4 class="b-header"><a class="has-color-dark-slate-gray" href="{{ post|url }}">{{ post.title }}</a></h4>
31+
<span class="blog-author">by <a class="author-name" href="{{ author|url }}">{{ render_author_name(author) }}</a>
32+
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span>
33+
<div class="excerpt">
34+
{{ post.body | excerpt | string | striptags() | truncate(100) }}
35+
</div>
3436
</div>
35-
</div>
36-
</article>
37+
</article>
38+
</div>
3739
{% endif %}
3840
{% endfor %}
3941
</div>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{% extends "layout.html" %}
2+
23
{% from "macros/categories.html" import render_categories %}
3-
{% block title %}{{ this.parent.children.get('entries').title }}{% endblock %}
4-
{% block header %}{{ this.parent.children.get('entries').title }}{% endblock %}
4+
55
{% block body %}
6-
<h2>Categories</h2>
7-
{{ render_categories(this) }}
6+
<div class="all-categories">
7+
<div class="title">
8+
<h1 class="container">Categories</h1>
9+
</div>
10+
<div class="categories-list container">
11+
{{ render_categories(this) }}
12+
</div>
13+
</div>
814
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{% extends "layout.html" %}
2-
{% from "macros/categories.html" import render_categories %}
3-
{% block title %}{{ this.parent.children.get('entries').title }}{% endblock %}
4-
{% block header %}{{ this.parent.children.get('entries').title }}{% endblock %}
2+
3+
{% from "macros/series.html" import render_series %}
4+
55
{% block body %}
6-
<h2>All Series</h2>
7-
{{ render_categories(this) }}
6+
<div class="all-series">
7+
<div class="title">
8+
<h1 class="container">All Series</h1>
9+
</div>
10+
<div class="series-list container">
11+
{{ render_series(this) }}
12+
</div>
13+
</div>
814
{% endblock %}

themes/vocabulary_theme/templates/blog.html

+16-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
{% from "macros/pagination.html" import render_pagination %}
44
{% from "macros/posts.html" import render_posts %}
55

6-
{% block title %}{{ this.title }}{% endblock %}
76
{% block body %}
8-
{{ this.description }}
9-
{{ render_posts(this.pagination.items) }}
10-
{% if this.pagination.pages > 1 %}
11-
{{ render_pagination(this.pagination) }}
12-
{% endif %}
7+
<div class="blog-page">
8+
<div class="blog-page-header">
9+
<div class="container">
10+
<h1>{{ this.title }}</h1>
11+
<div class="blog-page-description column is-9 is-paddingless">{{ this.description }}</div>
12+
</div>
13+
</div>
14+
<div class="container blog-page-posts">
15+
{{ render_posts(this.pagination.items) }}
16+
<div class="pagination-wrapper">
17+
{% if this.pagination.pages > 1 %}
18+
{{ render_pagination(this.pagination) }}
19+
{% endif %}
20+
</div>
21+
</div>
22+
</div>
1323
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{% from "macros/posts.html" import render_posts %}
22

33
{% macro render_categories(categories) %}
4-
<ul class="list-unstyled">
54
{% for category in site.query(categories.path) %}
6-
<li><a href="{{ category|url }}">{{ category.name }}</a></li>
5+
<a class="button tag margin-vertical-small margin-horizontal-smaller" href="{{ category|url }}">{{ category.name }}</a>
76
{% endfor %}
8-
</ul>
97
{% endmacro %}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
{% macro render_pagination(pagination) %}
2-
<ul class="pagination table-responsive mb-2">
3-
{% if pagination.has_prev %}
4-
<li class="page-item"><a class="page-link" href="{{ pagination.prev|url }}">Previous</a></li>
5-
{% else %}
6-
<li class="page-item disabled"><a class="page-link">Previous</a></li>
7-
{% endif %}
8-
{% for p in range(pagination.pages) %}
9-
{% if pagination.current|url == pagination.for_page(p+1)|url %}
10-
<li class="page-item active"><a class="page-link" href="{{ pagination.for_page(p+1)|url}}">{{p+1}}</a></li>
2+
<nav class="pagination" role="navigation" aria-label="pagination">
3+
<ul class="pagination-list">
4+
<!-- {% if pagination.has_prev %}
5+
<li class="page-item"><a class="page-link" href="{{ pagination.prev|url }}">Previous</a></li>
116
{% else %}
12-
<li class="page-item"><a class="page-link" href="{{ pagination.for_page(p+1)|url}}">{{p+1}}</a></li>
13-
{% endif %}
14-
{% endfor %}
15-
{% if pagination.has_next %}
16-
<li class="page-item"><a class="page-link" href="{{ pagination.next|url }}">Next</a></li>
17-
{% else %}
18-
<li class="page-item disabled"><a class="page-link">Next</a></li>
19-
{% endif %}
20-
</ul>
7+
<li class="page-item disabled"><a class="page-link">Previous</a></li>
8+
{% endif %} -->
9+
{% for p in range(pagination.pages) %}
10+
{% if pagination.current|url == pagination.for_page(p+1)|url %}
11+
<li class="common">
12+
<a class="pagination-link is-current common-link" aria-label="Goto page {{p+1}}" aria-current="page" href="{{ pagination.for_page(p+1)|url}}">{{p+1}}</a>
13+
</li>
14+
{% else %}
15+
<li class="inactive">
16+
<a class="pagination-link inactive-link" aria-label="Goto page {{p+1}}" href="{{ pagination.for_page(p+1)|url}}">{{p+1}}</a>
17+
</li>
18+
{% endif %}
19+
{% endfor %}
20+
<!-- {% if pagination.has_next %}
21+
<li class="page-item"><a class="page-link" href="{{ pagination.next|url }}">Next</a></li>
22+
{% else %}
23+
<li class="page-item disabled"><a class="page-link">Next</a></li>
24+
{% endif %} -->
25+
</ul>
26+
</nav>
2127
{% endmacro %}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
{% from "macros/author_name.html" import render_author_name %}
22

33
{% macro render_posts(posts) %}
4-
<ul class="blog-index list-unstyled">
4+
<div class="columns is-multiline blog-entries">
55
{% for post in posts %}
66
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
7-
<li>
8-
<a href="{{ post|url }}">{{ post.title }}</a>
9-
<p class="text-muted small">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
10-
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</p>
11-
</li>
7+
<article class="card entry-post horizontal no-border blog-entry column is-one-third">
8+
<header>
9+
<figure class="image blog-image">
10+
{% if author.about %}
11+
{% if author.md5_hashed_email %}
12+
<img class="profile" src="https://secure.gravatar.com/avatar/{{ author.md5_hashed_email }}?size=200" alt="gravatar" />
13+
{% else %}
14+
<img class="profile" src="./blank_profile.svg" alt="gravatar" />
15+
{% endif %}
16+
{% endif %}
17+
</figure>
18+
</header>
19+
<div class="blog-content">
20+
<h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4>
21+
<span class="blog-author">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
22+
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span>
23+
<div class="excerpt">
24+
{{ post.body | excerpt | string | striptags() | truncate(100) }}
25+
</div>
26+
</div>
27+
</article>
1228
{% endfor %}
13-
</ul>
29+
</div>
1430
{% endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% from "macros/posts.html" import render_posts %}
2+
3+
{% macro render_series(series) %}
4+
{% for serie in site.query(series.path) %}
5+
<h4 class="series-link"><a class="link" href="{{ serie|url }}">{{ serie.name }}</a></h4>
6+
{% endfor %}
7+
{% endmacro %}

webpack/sass/main.scss

+94
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,47 @@ a {
131131
}
132132
}
133133

134+
.blog-entries {
135+
.blog-entry {
136+
@extend .padding-vertical-larger;
137+
@extend .padding-horizontal-big;
138+
139+
border-bottom: 0.1875rem solid $color-light-gray !important;
140+
141+
.blog-title {
142+
@extend .has-color-dark-slate-gray;
143+
}
144+
}
145+
}
146+
147+
.blog-page {
148+
.blog-page-header {
149+
@extend .padding-top-bigger;
150+
@extend .padding-bottom-xl;
151+
152+
background-color: $color-lighter-gray;
153+
154+
.container {
155+
@extend .padding-horizontal-big;
156+
}
157+
158+
.blog-page-description {
159+
@extend .padding-top-normal;
160+
@extend .body-big;
161+
}
162+
}
163+
164+
.blog-page-posts {
165+
@extend .padding-top-normal;
166+
167+
.pagination-wrapper {
168+
@extend .padding-top-xl;
169+
@extend .padding-bottom-xxl;
170+
}
171+
}
172+
}
173+
174+
134175
.single-post {
135176
.container {
136177
@extend .padding-horizontal-xxl;
@@ -251,3 +292,56 @@ a {
251292
@extend .padding-bottom-xxl;
252293
}
253294
}
295+
296+
.all-series {
297+
.title {
298+
background-color: $color-lighter-gray;
299+
300+
.container {
301+
@extend .padding-horizontal-big;
302+
@extend .padding-bottom-xl;
303+
}
304+
}
305+
306+
.series-list {
307+
@extend .padding-horizontal-big;
308+
@extend .padding-top-xl;
309+
@extend .padding-bottom-xxl;
310+
311+
.series-link {
312+
.link {
313+
@extend .has-color-dark-slate-gray;
314+
}
315+
316+
@extend .padding-bottom-big;
317+
318+
&:not(:last-of-type)::after {
319+
@extend .padding-top-big;
320+
321+
display: block;
322+
323+
content: '';
324+
325+
border-bottom: 0.1875rem solid $color-light-gray;
326+
}
327+
}
328+
}
329+
}
330+
331+
.all-categories {
332+
.title {
333+
background-color: $color-lighter-gray;
334+
overflow-wrap: break-word;
335+
336+
.container {
337+
@extend .padding-horizontal-big;
338+
@extend .padding-bottom-xl;
339+
}
340+
}
341+
342+
.categories-list {
343+
@extend .padding-horizontal-big;
344+
@extend .padding-top-xl;
345+
@extend .padding-bottom-xxl;
346+
}
347+
}

0 commit comments

Comments
 (0)