improve formatting script and handle formatting errors
This commit is contained in:
@@ -2,8 +2,11 @@
|
||||
{% block content %}
|
||||
|
||||
{% if page.taxonomies.people %}
|
||||
{% set author_path = 'people/' ~ page.taxonomies.people[0] ~ '/index.md' %}
|
||||
{% set author = get_page(path=author_path) %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% if people.pages is containing(page.taxonomies.people[0]) %}
|
||||
{% set author_path = 'people/' ~ page.taxonomies.people[0] ~ '/index.md' %}
|
||||
{% set author = get_page(path=author_path) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Default page template for blog posts and basic informative markdown files -->
|
||||
|
||||
@@ -17,6 +17,9 @@ and a side nav for category and featured post navigation
|
||||
{%- set_global featured = page %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% if not featured %}
|
||||
{%- set_global featured = section.pages[0] %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include "partials/featuredBlog.html" %}
|
||||
|
||||
@@ -17,6 +17,9 @@ and a side nav for category and featured post navigation
|
||||
{%- set_global featured = page %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% if not featured %}
|
||||
{%- set_global featured = section.pages[0] %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include "partials/featuredNews.html" %}
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
<!-- Takes the path of a page and checks if it exists
|
||||
- if exists sets the page
|
||||
-->
|
||||
{% macro get_if_exists(path, type="text") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(person.name) %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
{% endif %}
|
||||
{{ page }}
|
||||
{% endmacro get_if_exists %}
|
||||
|
||||
{% macro page_list(type="text") %}
|
||||
<div id="list"></div>
|
||||
{% if section.extra.group_pages_by %}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
{% if post.date %}
|
||||
{% if post.taxonomies.people %}
|
||||
{% set author_path = 'people/' ~ post.taxonomies.people[0] ~ '/index.md' %}
|
||||
{% set author = get_page(path=author_path) %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(post.taxonomies.people[0]) %}
|
||||
{% set author_path = 'people/' ~ post.taxonomies.people[0] ~ '/index.md' %}
|
||||
{% set author = get_page(path=author_path) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="flex flex-col rounded-lg shadow-lg overflow-hidden">
|
||||
|
||||
@@ -18,11 +18,15 @@
|
||||
<div class="mt-12 grid gap-5 max-w-lg mx-auto lg:grid-cols-2 xl:grid-cols-4 lg:max-w-none">
|
||||
{% 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) %}
|
||||
{% if page.extra.private >= 0 %}
|
||||
{% include "partials/person_card.html" %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(person.name) %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
{% if page.extra.private >= 0 %}
|
||||
{% include "partials/person_card.html" %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr class="mt-6" />
|
||||
<p class="text-center text-sm mt-2 mb-16">
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
{% block content %}
|
||||
|
||||
{% set page_path = term.path ~ 'index.md' | replace(from='-', to='_') | trim_start_matches(pat="/") %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(term.name) %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
|
||||
|
||||
<div class="container sm:pxi-0 lg:w-5/6 mx-auto min-h-screen overflow-x-hidden pt-24">
|
||||
<div class="flex flex-row flex-wrap items-start mx-4 sm:mx-0">
|
||||
@@ -47,5 +51,6 @@
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user