Skip to content

Commit 54dc324

Browse files
committed
Added functionality for blog to be part of series
1 parent 91afdd3 commit 54dc324

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

content/blog/entries/2019-09-25-ccgn-redesign/contents.lr

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Giving more visibility for the local chapters’ infrastructure, this entire sec
4646

4747
## Keeping forward the global network website
4848

49-
This is certainly not the end of our revamp of the CC Global Network website, we're always working on giving the members a better experience by fixing bugs and updating the interface. If you have any feedback, feature request, or bug report please feel free to [open an issue](https://github.com/creativecommons/commoners/issues) in the [Commoners repository](https://github.com/creativecommons/commoners) on Github or reach out to us on Slack.
49+
This is certainly not the end of our revamp of the CC Global Network website, we're always working on giving the members a better experience by fixing bugs and updating the interface. If you have any feedback, feature request, or bug report please feel free to [open an issue](https://github.com/creativecommons/commoners/issues) in the [Commoners repository](https://github.com/creativecommons/commoners) on Github or reach out to us on Slack.

models/blog-series.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[model]
2-
name = Single Series
2+
name = Blog Series
33
label = {{ this.name }}
44
hidden = yes
55

templates/blog-post.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66

77
{% set author = this.parent.parent.children.get('authors').children.get(this.author) %}
88

9-
{% set series = this.parent.parent.children.get('series').children.get(this.series) %}
10-
119
{% block title %}{{ this.title }}{% endblock %}
1210
{% block header %}{{ this.parent.title }}{% endblock %}
1311
{% block body %}
1412
<h2 class="mb-0">{{ this.title }}</h2>
1513
{{ check_file('content' + this.parent.parent.path + '/authors/' + this.author + '/contents.lr') }}
1614
<p class="meta text-muted mt-0 mb-2">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
1715
on {{ this.pub_date|dateformat('EEEE, yyyy-''MM-d') }}</p>
18-
{% if this.series|length %}
16+
{% if this.series|length %}
17+
{% set series = this.parent.parent.children.get('series').children.get(this.series) %}
1918
<div class="card bg-light mb-2">
2019
<div class="card-body p-2">
2120
<p class="meta my-0"><span class="mr-2"><strong>This blog is part of the series:</strong></span>
@@ -41,22 +40,23 @@ <h2 class="mb-0">{{ this.title }}</h2>
4140
</div>
4241
</div>
4342
{% if this.series|length %}
44-
<table class="table table-sm table-striped mt-3" id="series">
45-
<thead class="thead-dark">
43+
<table class="table table-striped table-sm mt-3" id="series">
44+
<thead>
4645
<tr>
4746
<th>
48-
All posts under the Series "<span style="font-size:1.15rem">{{ this.series }}<span>"
47+
All posts in this series "<span style="font-size:1.15rem">{{ this.series }}<span>"
4948
</th>
5049
</tr>
5150
</thead>
5251
<tbody>
5352
{% for post in series.children %}
54-
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
5553
<tr>
5654
<td>
57-
<a href="{{ post|url }}">{{ post.title }}</a>
58-
<p class="text-muted small">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
59-
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</p>
55+
{% if post.path==this.path %}
56+
{{ post.title }}
57+
{% else %}
58+
<a href="{{ post|url }}">{{ post.title }}</a>
59+
{% endif %}
6060
</td>
6161
</tr>
6262
{% endfor %}

templates/blog-series.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block title %}{{ this.name + ' - ' + this.parent.parent.children.get('entries').title }}{% endblock %}
66
{% block header %}{{ this.parent.parent.children.get('entries').title }}{% endblock %}
77
{% block body %}
8-
<h2>All posts under Series "{{ this.name }}"</h2>
8+
<h2>All posts in Series "{{ this.name }}"</h2>
99
{{ render_posts(this.children) }}
1010
<hr>
1111
<strong><a href="{{ this.parent|url }}">All Series</a></strong>

0 commit comments

Comments
 (0)