From 7888168b4009a85f1b8d95df5fbfa32bd6b3353e Mon Sep 17 00:00:00 2001 From: timurgordon Date: Sun, 24 Jul 2022 20:11:32 +0200 Subject: [PATCH] add people taxonomy --- config.toml | 32 +++---------- templates/partials/memberships.html | 2 +- templates/partials/person_card.html | 18 +++---- templates/people/list.html | 74 +++++++++++++++++++++++++++++ templates/people/single.html | 52 ++++++++++++++++++++ templates/people_page.html | 4 +- templates/taxonomy_single.html | 1 + 7 files changed, 146 insertions(+), 37 deletions(-) create mode 100644 templates/people/list.html create mode 100644 templates/people/single.html diff --git a/config.toml b/config.toml index f884ad76e..a482b14b7 100644 --- a/config.toml +++ b/config.toml @@ -81,6 +81,12 @@ feed = true paginate_by = 9 paginate_path = "tags" +[[taxonomies]] +name = "people" +feed = true +paginate_by = 9 +paginate_path = "people" + [[taxonomies]] name = "memberships" feed = true @@ -90,32 +96,6 @@ paginate_path = "people/memberships" [extra] # Put all your custom variables here -[extra.taxonomies."roles"] - [extra.taxonomies."roles".Create] - icon_path = "images/icons/paint-brush-art-svgrepo-com.svg" - banner_path = "images/marius-masalar-unsplash.jpg" - title = "Create Ourworld" - description = "Become a part of a team of creators looking to shape our digital world" - - [extra.taxonomies."roles".Develop] - icon_path = "images/icons/code-svgrepo-com.svg" - banner_path = "images/marius-masalar-unsplash.jpg" - title = "Develop Ourworld" - description = "Become a part of a team of developers building our digital world" - - [extra.taxonomies."roles".Inspire] - icon_path = "images/icons/bar-svgrepo-com.svg" - banner_path = "images/marius-masalar-unsplash.jpg" - title = "Share Ourworld" - description = "Create communities and involve people in ourworld" - - [extra.taxonomies."roles".Organize] - icon_path = "images/icons/form-svgrepo-com.svg" - banner_path = "images/marius-masalar-unsplash.jpg" - title = "Run Ourworld" - description = "Become a part of the organizational team at ourworld" - - diff --git a/templates/partials/memberships.html b/templates/partials/memberships.html index e39c8466e..4c4781fb6 100644 --- a/templates/partials/memberships.html +++ b/templates/partials/memberships.html @@ -27,7 +27,7 @@
- {%- for post in paginator.pages %} + {%- for page in paginator.pages %} {% include "partials/person_card.html" %} {%- endfor %}
diff --git a/templates/partials/person_card.html b/templates/partials/person_card.html index c201b9fa8..2204df7ee 100644 --- a/templates/partials/person_card.html +++ b/templates/partials/person_card.html @@ -1,22 +1,24 @@
- - {% set url = get_url(path='/' ~ post.relative_path | replace(from='_', to='-') | replace(from='index.md', to=post.extra.imgPath)) %} - {{post.title ~ ' Picture'}} + + {% set url = get_url(path='/' ~ page.relative_path | replace(from='_', to='-') | replace(from='index.md', to=page.extra.imgPath)) %} + {{page.title ~ ' Picture'}}
-

{{post.title}}

+

{{page.title}}

- {% if post.description %} - {{post.description}} + {% if page.description %} + {{page.description}} {% else %} - {{post.content | safe}} + {{page.content | safe}} {% endif %}
diff --git a/templates/people/list.html b/templates/people/list.html new file mode 100644 index 000000000..b5ca0fcd5 --- /dev/null +++ b/templates/people/list.html @@ -0,0 +1,74 @@ +{% extends "_default/base.html" %} +{% block content %} + + +
+ {% include "partials/filter_bar.html" %} + +
+

+ {% set path_array = current_path | split(pat="/") %} + {% set taxonomy = path_array[1] %} + {% set category = path_array[2] %} + {{category | replace(from='-', to=' ' ) | title}} +

+
+
+ {% for person in terms %} + {% set page_path = person.path ~ 'index.md' | replace(from='-', to='_') | trim_start_matches(pat="/") %} + {% set page = get_page(path=page_path) %} + {% include "partials/person_card.html" %} + {% endfor %} +
+
+

+ {% if paginator.previous %} + {% include "partials/icons/svgPrevPageIcon.html" %}{% include + "partials/icons/svgPrevPageIcon.html" %} +           + {% include "partials/icons/svgPrevPageIcon.html" %} +           +           {% else %} {% + include "partials/icons/svgFirstPageIcon.html" %}{% include + "partials/icons/svgFirstPageIcon.html" %} +           {% include + "partials/icons/svgFirstPageIcon.html" %} +           +           {% endif %} {% if + paginator.next %} + {% include "partials/icons/svgNextPageIcon.html" %} +           + {% include "partials/icons/svgNextPageIcon.html" %}{% include + "partials/icons/svgNextPageIcon.html" %} + {% else %} {% include "partials/icons/svgLastPageIcon.html" %} +           {% include + "partials/icons/svgLastPageIcon.html" %}{% include + "partials/icons/svgLastPageIcon.html" %} {% endif %} +

+
+
+
+ +{% endblock content %} diff --git a/templates/people/single.html b/templates/people/single.html new file mode 100644 index 000000000..dd61eee27 --- /dev/null +++ b/templates/people/single.html @@ -0,0 +1,52 @@ +{% extends "_default/base.html" %} +{% block content %} + + +{% set page_path = current_path ~ 'index.md' | replace(from='-', to='_') | trim_start_matches(pat="/") %} +{% set page = get_page(path=page_path) %} + +
+
+
+ +
+
+
+

+ {{page.title}} +

+
+ {% include "partials/socialLinks.html" %} +
+
+
+ {{page.content | safe }} +
+
+
+
    + {% for org in page.extra.organizations %} +
  • + + + +
  • + {% endfor %} +
+
+
+ {% for tag in page.taxonomies.memberships %} + + {{tag}} + + {% endfor %} +
+
+
+
+
+
+
+
+ +{% endblock content %} \ No newline at end of file diff --git a/templates/people_page.html b/templates/people_page.html index 1354074a0..8e94af9ed 100644 --- a/templates/people_page.html +++ b/templates/people_page.html @@ -4,7 +4,7 @@
{% include "partials/filter_bar.html" %} - +

- {%- for post in paginator.pages %} + {%- for page in paginator.pages %} {% if "Engineering" == "Engineering"%} {% include "partials/person_card.html" %} {%endif%} {%- endfor %} diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index 5fb15b4cf..d34cecd2f 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -13,6 +13,7 @@ {% include "partials/tagsSidebar.html" %} {% elif current_path is containing("memberships") %} {% include "partials/memberships.html" %} + {% elif current_path is containing("people") %} {% else %} {% include "partials/newsPosts.html" %} {% include "partials/newsSidebar.html" %}