Skip to content

Commit 0dcbf41

Browse files
committed
resolve conflicts
2 parents 0ff986f + 8bae84e commit 0dcbf41

File tree

9 files changed

+187
-44
lines changed

9 files changed

+187
-44
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
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
@@ -130,6 +130,47 @@ a {
130130
}
131131
}
132132

133+
.blog-entries {
134+
.blog-entry {
135+
@extend .padding-vertical-larger;
136+
@extend .padding-horizontal-big;
137+
138+
border-bottom: 0.1875rem solid $color-light-gray !important;
139+
140+
.blog-title {
141+
@extend .has-color-dark-slate-gray;
142+
}
143+
}
144+
}
145+
146+
.blog-page {
147+
.blog-page-header {
148+
@extend .padding-top-bigger;
149+
@extend .padding-bottom-xl;
150+
151+
background-color: $color-lighter-gray;
152+
153+
.container {
154+
@extend .padding-horizontal-big;
155+
}
156+
157+
.blog-page-description {
158+
@extend .padding-top-normal;
159+
@extend .body-big;
160+
}
161+
}
162+
163+
.blog-page-posts {
164+
@extend .padding-top-normal;
165+
166+
.pagination-wrapper {
167+
@extend .padding-top-xl;
168+
@extend .padding-bottom-xxl;
169+
}
170+
}
171+
}
172+
173+
133174
.single-post {
134175
.container {
135176
@extend .padding-horizontal-xxl;
@@ -251,6 +292,59 @@ a {
251292
}
252293
}
253294

295+
.all-series {
296+
.title {
297+
background-color: $color-lighter-gray;
298+
299+
.container {
300+
@extend .padding-horizontal-big;
301+
@extend .padding-bottom-xl;
302+
}
303+
}
304+
305+
.series-list {
306+
@extend .padding-horizontal-big;
307+
@extend .padding-top-xl;
308+
@extend .padding-bottom-xxl;
309+
310+
.series-link {
311+
.link {
312+
@extend .has-color-dark-slate-gray;
313+
}
314+
315+
@extend .padding-bottom-big;
316+
317+
&:not(:last-of-type)::after {
318+
@extend .padding-top-big;
319+
320+
display: block;
321+
322+
content: '';
323+
324+
border-bottom: 0.1875rem solid $color-light-gray;
325+
}
326+
}
327+
}
328+
}
329+
330+
.all-categories {
331+
.title {
332+
background-color: $color-lighter-gray;
333+
overflow-wrap: break-word;
334+
335+
.container {
336+
@extend .padding-horizontal-big;
337+
@extend .padding-bottom-xl;
338+
}
339+
}
340+
341+
.categories-list {
342+
@extend .padding-horizontal-big;
343+
@extend .padding-top-xl;
344+
@extend .padding-bottom-xxl;
345+
}
346+
}
347+
254348
.code-guidelines {
255349
.code-guidelines-title {
256350
background-color: $color-lighter-gray;

0 commit comments

Comments
 (0)