Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruvi16 committed Jul 8, 2020
2 parents 6171368 + 260b225 commit 8a4f856
Show file tree
Hide file tree
Showing 16 changed files with 395 additions and 63 deletions.
2 changes: 2 additions & 0 deletions content/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@ links_plugins:
<h5 class="link-heading"><a href="https://opensource.creativecommons.org/ccsearch-browser-extension/" class="has-text-forest-green">CC Search Browser Extension</a></h5>
<p class="link-caption">Search the Catalog using our Extension.</p>
</div>
#### recent-posts ####
title: Recent Blog Post
#### featured-projects ####
title: Featured Projects
5 changes: 2 additions & 3 deletions content/contributing-code/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ _template: page-with-toc.html
---
title: Contribution Guidelines
---
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/).
---
body:

<p class="lead">Thank you for your interest in contributing to Creative Commons open source projects!</p>

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/).

## Finding an issue

Expand Down
6 changes: 6 additions & 0 deletions flowblocks/recent-posts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[block]
name = Recent Posts

[fields.title]
label = Title
type = string
2 changes: 1 addition & 1 deletion models/blog.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ order_by = -pub_date, title

[pagination]
enabled = yes
per_page = 10
per_page = 12
2 changes: 1 addition & 1 deletion models/home.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ type = string
[fields.block_content]
label = Block Content
type = flow
flow_blocks = hero, get-involved, featured-projects
flow_blocks = hero, get-involved, recent-posts, featured-projects
4 changes: 4 additions & 0 deletions models/page.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ label = {{ this.title }}
label = Title
type = string

[fields.description]
label = Title
type = markdown

[fields.body]
label = Body
type = markdown
43 changes: 43 additions & 0 deletions themes/vocabulary_theme/templates/blocks/recent-posts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% from "macros/author_name.html" import render_author_name %}

<section class="recent-posts">
<div class="container">
<div class="level">
<h4 class="is-paddingless level-left">
{{ this.title }}
</h4>
<span class="level-right">
<a class="posts-link" href="/blog">See all posts <i class="icon angle-right"></i></a>
</span>
</div>
<div class="columns">
{% for post in site.query('/blog/entries') %}
{% if loop.index <= 3 %}
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
<div class="column is-one-third is-paddingless padding-horizontal-big padding-top-bigger">
<article class="card entry-post horizontal no-border blog-entry">
<header>
<figure class="image blog-image">
{% if author.about %}
{% if author.md5_hashed_email %}
<img class="profile" src="https://secure.gravatar.com/avatar/{{ author.md5_hashed_email }}?size=200"
alt="gravatar" />
{% endif %}
{% endif %}
</figure>
</header>
<div class="blog-content">
<h4 class="b-header"><a class="has-color-dark-slate-gray" href="{{ post|url }}">{{ post.title }}</a></h4>
<span class="blog-author">by <a class="author-name" href="{{ author|url }}">{{ render_author_name(author) }}</a>
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span>
<div class="excerpt">
{{ post.body | excerpt | string | striptags() | truncate(100) }}
</div>
</div>
</article>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</section>
14 changes: 10 additions & 4 deletions themes/vocabulary_theme/templates/blog-categories.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{% extends "layout.html" %}

{% from "macros/categories.html" import render_categories %}
{% block title %}{{ this.parent.children.get('entries').title }}{% endblock %}
{% block header %}{{ this.parent.children.get('entries').title }}{% endblock %}

{% block body %}
<h2>Categories</h2>
{{ render_categories(this) }}
<div class="all-categories">
<div class="title">
<h1 class="container">Categories</h1>
</div>
<div class="categories-list container">
{{ render_categories(this) }}
</div>
</div>
{% endblock %}
16 changes: 11 additions & 5 deletions themes/vocabulary_theme/templates/blog-series-list.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{% extends "layout.html" %}
{% from "macros/categories.html" import render_categories %}
{% block title %}{{ this.parent.children.get('entries').title }}{% endblock %}
{% block header %}{{ this.parent.children.get('entries').title }}{% endblock %}

{% from "macros/series.html" import render_series %}

{% block body %}
<h2>All Series</h2>
{{ render_categories(this) }}
<div class="all-series">
<div class="title">
<h1 class="container">All Series</h1>
</div>
<div class="series-list container">
{{ render_series(this) }}
</div>
</div>
{% endblock %}
22 changes: 16 additions & 6 deletions themes/vocabulary_theme/templates/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
{% from "macros/pagination.html" import render_pagination %}
{% from "macros/posts.html" import render_posts %}

{% block title %}{{ this.title }}{% endblock %}
{% block body %}
{{ this.description }}
{{ render_posts(this.pagination.items) }}
{% if this.pagination.pages > 1 %}
{{ render_pagination(this.pagination) }}
{% endif %}
<div class="blog-page">
<div class="blog-page-header">
<div class="container">
<h1>{{ this.title }}</h1>
<div class="blog-page-description column is-9 is-paddingless">{{ this.description }}</div>
</div>
</div>
<div class="container blog-page-posts">
{{ render_posts(this.pagination.items) }}
<div class="pagination-wrapper">
{% if this.pagination.pages > 1 %}
{{ render_pagination(this.pagination) }}
{% endif %}
</div>
</div>
</div>
{% endblock %}
4 changes: 1 addition & 3 deletions themes/vocabulary_theme/templates/macros/categories.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% from "macros/posts.html" import render_posts %}

{% macro render_categories(categories) %}
<ul class="list-unstyled">
{% for category in site.query(categories.path) %}
<li><a href="{{ category|url }}">{{ category.name }}</a></li>
<a class="button tag margin-vertical-small margin-horizontal-smaller" href="{{ category|url }}">{{ category.name }}</a>
{% endfor %}
</ul>
{% endmacro %}
42 changes: 24 additions & 18 deletions themes/vocabulary_theme/templates/macros/pagination.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
{% macro render_pagination(pagination) %}
<ul class="pagination table-responsive mb-2">
{% if pagination.has_prev %}
<li class="page-item"><a class="page-link" href="{{ pagination.prev|url }}">Previous</a></li>
{% else %}
<li class="page-item disabled"><a class="page-link">Previous</a></li>
{% endif %}
{% for p in range(pagination.pages) %}
{% if pagination.current|url == pagination.for_page(p+1)|url %}
<li class="page-item active"><a class="page-link" href="{{ pagination.for_page(p+1)|url}}">{{p+1}}</a></li>
<nav class="pagination" role="navigation" aria-label="pagination">
<ul class="pagination-list">
<!-- {% if pagination.has_prev %}
<li class="page-item"><a class="page-link" href="{{ pagination.prev|url }}">Previous</a></li>
{% else %}
<li class="page-item"><a class="page-link" href="{{ pagination.for_page(p+1)|url}}">{{p+1}}</a></li>
{% endif %}
{% endfor %}
{% if pagination.has_next %}
<li class="page-item"><a class="page-link" href="{{ pagination.next|url }}">Next</a></li>
{% else %}
<li class="page-item disabled"><a class="page-link">Next</a></li>
{% endif %}
</ul>
<li class="page-item disabled"><a class="page-link">Previous</a></li>
{% endif %} -->
{% for p in range(pagination.pages) %}
{% if pagination.current|url == pagination.for_page(p+1)|url %}
<li class="common">
<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>
</li>
{% else %}
<li class="inactive">
<a class="pagination-link inactive-link" aria-label="Goto page {{p+1}}" href="{{ pagination.for_page(p+1)|url}}">{{p+1}}</a>
</li>
{% endif %}
{% endfor %}
<!-- {% if pagination.has_next %}
<li class="page-item"><a class="page-link" href="{{ pagination.next|url }}">Next</a></li>
{% else %}
<li class="page-item disabled"><a class="page-link">Next</a></li>
{% endif %} -->
</ul>
</nav>
{% endmacro %}
30 changes: 23 additions & 7 deletions themes/vocabulary_theme/templates/macros/posts.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
{% from "macros/author_name.html" import render_author_name %}

{% macro render_posts(posts) %}
<ul class="blog-index list-unstyled">
<div class="columns is-multiline blog-entries">
{% for post in posts %}
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
<li>
<a href="{{ post|url }}">{{ post.title }}</a>
<p class="text-muted small">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</p>
</li>
<article class="card entry-post horizontal no-border blog-entry column is-one-third">
<header>
<figure class="image blog-image">
{% if author.about %}
{% if author.md5_hashed_email %}
<img class="profile" src="https://secure.gravatar.com/avatar/{{ author.md5_hashed_email }}?size=200" alt="gravatar" />
{% else %}
<img class="profile" src="./blank_profile.svg" alt="gravatar" />
{% endif %}
{% endif %}
</figure>
</header>
<div class="blog-content">
<h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4>
<span class="blog-author">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span>
<div class="excerpt">
{{ post.body | excerpt | string | striptags() | truncate(100) }}
</div>
</div>
</article>
{% endfor %}
</ul>
</div>
{% endmacro %}
7 changes: 7 additions & 0 deletions themes/vocabulary_theme/templates/macros/series.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% from "macros/posts.html" import render_posts %}

{% macro render_series(series) %}
{% for serie in site.query(series.path) %}
<h4 class="series-link"><a class="link" href="{{ serie|url }}">{{ serie.name }}</a></h4>
{% endfor %}
{% endmacro %}
74 changes: 59 additions & 15 deletions themes/vocabulary_theme/templates/page-with-toc.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,65 @@
{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}

{% block body %}
<div class="card toc-card bg-light">
<div class="card-body">
<ul class="toc list-unstyled">
{% for item in this.body.toc %}
<li><a href="#{{ item.anchor }}">{{ item.title }}</a></li>
{% if item.children %}
<ul class="toc list-unstyled pl-4">
{% for subitem in item.children %}
<li><a href="#{{ subitem.anchor }}">{{ subitem.title }}</a></li>
{% endfor %}
</ul>
<div class="code-guidelines">
<header class="code-guidelines-title">
<div class="container is-paddingless">
<h1>{{ this.title }}</h1>
<div class="description column is-9 is-paddingless">
{{ this.description }}
</div>
</div>
</header>
<div class="container code-guidelines-body">
<div class="columns">
<div class="column is-one-quarter">
<div class="row">
{% if this.is_child_of('/contributing-code') %}
<aside class="menu sidebar-menu">
<ul class="menu-list">
<li>
<a class="{% if this.is_child_of('/contributing-code/projects') %} is-active {% endif%} link" href="{{ '/contributing-code/projects'|url }}">Project List</a>
</li>
<hr class="divider">
<li>
<a class="{% if this.is_child_of('/contributing-code') %} is-active {% endif%} link" href="{{ '/contributing-code'|url }}">Contribution Guidelines</a>
<ul>
<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>
<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>
</ul>
</li>
<hr class="divider">
<li>
<a class="link" href="{{ '/contributing-code/cc-search'|url }}">CC Search</a>
</li>
</ul>
</aside>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="row">
<h4 class="b-header">On this page</h4>
<aside class="menu table-of-contents">
<ul class="menu-list">
{% for item in this.body.toc %}
<li>
<a class="link" href="#{{ item.anchor }}">{{ item.title }}</a>
{% if item.children %}
<ul>
{% for subitem in item.children %}
<li><a class="link" href="#{{ subitem.anchor }}"><i class="icon circle-filled"></i>{{ subitem.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</aside>
</div>
</div>
<div class="column markdown content">
{{ this.body }}
</div>
</div>
</div>
</div>
{{ this.body }}
{% endblock %}
Loading

0 comments on commit 8a4f856

Please sign in to comment.