Skip to content

Commit 8a4f856

Browse files
committed
Resolve conflicts
2 parents 6171368 + 260b225 commit 8a4f856

File tree

16 files changed

+395
-63
lines changed

16 files changed

+395
-63
lines changed

content/contents.lr

+2
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,7 @@ links_plugins:
7070
<h5 class="link-heading"><a href="https://opensource.creativecommons.org/ccsearch-browser-extension/" class="has-text-forest-green">CC Search Browser Extension</a></h5>
7171
<p class="link-caption">Search the Catalog using our Extension.</p>
7272
</div>
73+
#### recent-posts ####
74+
title: Recent Blog Post
7375
#### featured-projects ####
7476
title: Featured Projects

content/contributing-code/contents.lr

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ _template: page-with-toc.html
44
---
55
title: Contribution Guidelines
66
---
7+
description: We do all of our development [on GitHub](https://github.com/creativecommons/). If you are not familiar with GitHub or pull requests, [here is an excellent guide to get started](https://guides.github.com/activities/hello-world/).
8+
---
79
body:
810

9-
<p class="lead">Thank you for your interest in contributing to Creative Commons open source projects!</p>
10-
11-
We do all of our development [on GitHub](https://github.com/creativecommons/). If you are not familiar with GitHub or pull requests, [here is an excellent guide to get started](https://guides.github.com/activities/hello-world/).
1211

1312
## Finding an issue
1413

flowblocks/recent-posts.ini

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[block]
2+
name = Recent Posts
3+
4+
[fields.title]
5+
label = Title
6+
type = string

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

models/home.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ type = string
99
[fields.block_content]
1010
label = Block Content
1111
type = flow
12-
flow_blocks = hero, get-involved, featured-projects
12+
flow_blocks = hero, get-involved, recent-posts, featured-projects

models/page.ini

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ label = {{ this.title }}
66
label = Title
77
type = string
88

9+
[fields.description]
10+
label = Title
11+
type = markdown
12+
913
[fields.body]
1014
label = Body
1115
type = markdown
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{% from "macros/author_name.html" import render_author_name %}
2+
3+
<section class="recent-posts">
4+
<div class="container">
5+
<div class="level">
6+
<h4 class="is-paddingless level-left">
7+
{{ this.title }}
8+
</h4>
9+
<span class="level-right">
10+
<a class="posts-link" href="/blog">See all posts <i class="icon angle-right"></i></a>
11+
</span>
12+
</div>
13+
<div class="columns">
14+
{% for post in site.query('/blog/entries') %}
15+
{% if loop.index <= 3 %}
16+
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
17+
<div class="column is-one-third is-paddingless padding-horizontal-big padding-top-bigger">
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 %}
26+
{% endif %}
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>
36+
</div>
37+
</article>
38+
</div>
39+
{% endif %}
40+
{% endfor %}
41+
</div>
42+
</div>
43+
</section>
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 %}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,65 @@
11
{% extends "layout.html" %}
2-
{% block title %}{{ this.title }}{% endblock %}
2+
33
{% block body %}
4-
<div class="card toc-card bg-light">
5-
<div class="card-body">
6-
<ul class="toc list-unstyled">
7-
{% for item in this.body.toc %}
8-
<li><a href="#{{ item.anchor }}">{{ item.title }}</a></li>
9-
{% if item.children %}
10-
<ul class="toc list-unstyled pl-4">
11-
{% for subitem in item.children %}
12-
<li><a href="#{{ subitem.anchor }}">{{ subitem.title }}</a></li>
13-
{% endfor %}
14-
</ul>
4+
<div class="code-guidelines">
5+
<header class="code-guidelines-title">
6+
<div class="container is-paddingless">
7+
<h1>{{ this.title }}</h1>
8+
<div class="description column is-9 is-paddingless">
9+
{{ this.description }}
10+
</div>
11+
</div>
12+
</header>
13+
<div class="container code-guidelines-body">
14+
<div class="columns">
15+
<div class="column is-one-quarter">
16+
<div class="row">
17+
{% if this.is_child_of('/contributing-code') %}
18+
<aside class="menu sidebar-menu">
19+
<ul class="menu-list">
20+
<li>
21+
<a class="{% if this.is_child_of('/contributing-code/projects') %} is-active {% endif%} link" href="{{ '/contributing-code/projects'|url }}">Project List</a>
22+
</li>
23+
<hr class="divider">
24+
<li>
25+
<a class="{% if this.is_child_of('/contributing-code') %} is-active {% endif%} link" href="{{ '/contributing-code'|url }}">Contribution Guidelines</a>
26+
<ul>
27+
<li><a class="{% if this.is_child_of('/contributing-code/pr-guidelines') %} is-active {% endif%} link" href="{{ '/contributing-code/pr-guidelines'|url }}"><i class="icon circle-filled"></i>PR Guidelines</a></li>
28+
<li><a class="{% if this.is_child_of('/contributing-code/github-repo-guidelines') %} is-active {% endif%} link" href="{{ '/contributing-code/github-repo-guidelines'|url }}"><i class="icon circle-filled"></i>Github Repo Guidelines</a></li>
29+
</ul>
30+
</li>
31+
<hr class="divider">
32+
<li>
33+
<a class="link" href="{{ '/contributing-code/cc-search'|url }}">CC Search</a>
34+
</li>
35+
</ul>
36+
</aside>
1537
{% endif %}
16-
{% endfor %}
17-
</ul>
38+
</div>
39+
<div class="row">
40+
<h4 class="b-header">On this page</h4>
41+
<aside class="menu table-of-contents">
42+
<ul class="menu-list">
43+
{% for item in this.body.toc %}
44+
<li>
45+
<a class="link" href="#{{ item.anchor }}">{{ item.title }}</a>
46+
{% if item.children %}
47+
<ul>
48+
{% for subitem in item.children %}
49+
<li><a class="link" href="#{{ subitem.anchor }}"><i class="icon circle-filled"></i>{{ subitem.title }}</a></li>
50+
{% endfor %}
51+
</ul>
52+
{% endif %}
53+
</li>
54+
{% endfor %}
55+
</ul>
56+
</aside>
57+
</div>
58+
</div>
59+
<div class="column markdown content">
60+
{{ this.body }}
61+
</div>
62+
</div>
1863
</div>
1964
</div>
20-
{{ this.body }}
2165
{% endblock %}

0 commit comments

Comments
 (0)