diff --git a/content/contents.lr b/content/contents.lr index 16540d00c..608653616 100644 --- a/content/contents.lr +++ b/content/contents.lr @@ -70,5 +70,7 @@ links_plugins: +#### recent-posts #### +title: Recent Blog Post #### featured-projects #### title: Featured Projects diff --git a/content/contributing-code/contents.lr b/content/contributing-code/contents.lr index b8c968a9c..a7cd83700 100644 --- a/content/contributing-code/contents.lr +++ b/content/contributing-code/contents.lr @@ -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: -

Thank you for your interest in contributing to Creative Commons open source projects!

- -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 diff --git a/flowblocks/recent-posts.ini b/flowblocks/recent-posts.ini new file mode 100644 index 000000000..76d77851d --- /dev/null +++ b/flowblocks/recent-posts.ini @@ -0,0 +1,6 @@ +[block] +name = Recent Posts + +[fields.title] +label = Title +type = string \ No newline at end of file diff --git a/models/blog.ini b/models/blog.ini index 5c66499f3..c2520e949 100644 --- a/models/blog.ini +++ b/models/blog.ini @@ -19,4 +19,4 @@ order_by = -pub_date, title [pagination] enabled = yes -per_page = 10 +per_page = 12 diff --git a/models/home.ini b/models/home.ini index ecab21ffa..0863f30ed 100644 --- a/models/home.ini +++ b/models/home.ini @@ -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 diff --git a/models/page.ini b/models/page.ini index dcddfe824..fdfffb92d 100644 --- a/models/page.ini +++ b/models/page.ini @@ -6,6 +6,10 @@ label = {{ this.title }} label = Title type = string +[fields.description] +label = Title +type = markdown + [fields.body] label = Body type = markdown diff --git a/themes/vocabulary_theme/templates/blocks/recent-posts.html b/themes/vocabulary_theme/templates/blocks/recent-posts.html new file mode 100644 index 000000000..ca39939dc --- /dev/null +++ b/themes/vocabulary_theme/templates/blocks/recent-posts.html @@ -0,0 +1,43 @@ +{% from "macros/author_name.html" import render_author_name %} + +
+
+
+

+ {{ this.title }} +

+ + See all posts + +
+
+ {% for post in site.query('/blog/entries') %} + {% if loop.index <= 3 %} + {% set author = post.parent.parent.children.get('authors').children.get(post.author) %} +
+
+
+
+ {% if author.about %} + {% if author.md5_hashed_email %} + gravatar + {% endif %} + {% endif %} +
+
+
+

{{ post.title }}

+ by {{ render_author_name(author) }} + on {{ post.pub_date|dateformat("YYYY-MM-dd") }} +
+ {{ post.body | excerpt | string | striptags() | truncate(100) }} +
+
+
+
+ {% endif %} + {% endfor %} +
+
+
\ No newline at end of file diff --git a/themes/vocabulary_theme/templates/blog-categories.html b/themes/vocabulary_theme/templates/blog-categories.html index 2b5ee8f0a..c4dfe4eb6 100644 --- a/themes/vocabulary_theme/templates/blog-categories.html +++ b/themes/vocabulary_theme/templates/blog-categories.html @@ -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 %} -

Categories

- {{ render_categories(this) }} +
+
+

Categories

+
+
+ {{ render_categories(this) }} +
+
{% endblock %} diff --git a/themes/vocabulary_theme/templates/blog-series-list.html b/themes/vocabulary_theme/templates/blog-series-list.html index 64097ab31..7bdd92a7f 100644 --- a/themes/vocabulary_theme/templates/blog-series-list.html +++ b/themes/vocabulary_theme/templates/blog-series-list.html @@ -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 %} -

All Series

- {{ render_categories(this) }} +
+
+

All Series

+
+
+ {{ render_series(this) }} +
+
{% endblock %} diff --git a/themes/vocabulary_theme/templates/blog.html b/themes/vocabulary_theme/templates/blog.html index 81e041ee9..257c46f77 100644 --- a/themes/vocabulary_theme/templates/blog.html +++ b/themes/vocabulary_theme/templates/blog.html @@ -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 %} +
+
+
+

{{ this.title }}

+
{{ this.description }}
+
+
+
+ {{ render_posts(this.pagination.items) }} +
+ {% if this.pagination.pages > 1 %} + {{ render_pagination(this.pagination) }} + {% endif %} +
+
+
{% endblock %} diff --git a/themes/vocabulary_theme/templates/macros/categories.html b/themes/vocabulary_theme/templates/macros/categories.html index 0a67788ee..360b715e3 100644 --- a/themes/vocabulary_theme/templates/macros/categories.html +++ b/themes/vocabulary_theme/templates/macros/categories.html @@ -1,9 +1,7 @@ {% from "macros/posts.html" import render_posts %} {% macro render_categories(categories) %} - {% endmacro %} diff --git a/themes/vocabulary_theme/templates/macros/pagination.html b/themes/vocabulary_theme/templates/macros/pagination.html index c17dbe1b7..412e2910b 100644 --- a/themes/vocabulary_theme/templates/macros/pagination.html +++ b/themes/vocabulary_theme/templates/macros/pagination.html @@ -1,21 +1,27 @@ {% macro render_pagination(pagination) %} -