www_mycelium/templates/blogPage.html
2025-02-12 06:59:33 +00:00

104 lines
4.0 KiB
HTML

{% extends "_default/base.html" %}
{% block content %}
{% if page.taxonomies.people %}
{% set people = get_section(path="people/_index.md") %}
{% set pages_str = people.pages | json_encode() | as_str %}
{% if pages_str 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 -->
{% set split = page.content | split(pat="threefold.io") %}
{% if split | length < 2 %} {% set content=page.content %} {% else %} {% set content="" %} {% for part in split %} {% if
part is starting_with("/blog") %} {% set split_part=part | split(pat='/">' ) %} {% set link=split_part[0] %} {% set
link=link | replace(from="/blog/post" , to="/blog" ) %} {% set link=link | replace(from="_" , to="-" ) %} {% set
rest_part=split_part | slice(start=1) | join(sep='/">' ) %} {% set part=link ~ '/">' ~ rest_part %} {% endif %} {% if
loop.first %} {% set_global content=part%} {% else %} {% set_global content=content ~ "threefold.io" ~ part%} {% endif
%} {% endfor %} {% endif %} <main>
<div class="container mx-auto mt-16">
<div>
<article class="article lg:w-4/6 mx-auto">
<section class="post-header px-0 mb-4 border-b border-gray-600">
<h2 class="md:text-4xl text-3xl font-medium mb-2 leading-none text-gray-100">
{{ page.title }}
</h2>
<p class="md:text-lg mb-4 text-base text-gray-300">
{{ page.description }}
</p>
</section>
<section class="post-author-list mb-3 mt-2 mx-0">
<div class="flex items-center">
<div class="flex justify-between items-center">
<ul class="list-none pl-0 flex author-list m-0">
<li class="author-list-item">
{% if author %}
{% set author_img = get_url(path='/' ~ author.relative_path | replace(from='_', to='-') |
replace(from='index.md', to=author.extra.imgPath)) %}
<img src="{{author_img}}" alt="{{author.title}}" class="
h-8
w-8
sm:h-10
sm:w-10
rounded-full
bg-gray-200
border border-gray-600
" />
</li>
{% endif %}
</ul>
</div>
<div class="pl-3 flex flex-col text-xs leading-none uppercase">
{% if author %}
<a href="{{author.permalink}}" class="text-gray-400 text-xs">{{ author.title }}</a>
{% endif %}
<p class="text-gray-400 text-xs">
<time datetime="{{ page.date }}"> {{ page.date | date(format="%B %e, %Y", timezone="America/Chicago")
}}</time><br />
<span id="time"
class="time"></span>
</p>
</div>
</div>
<div class="my-2 sharethis-inline-share-buttons"></div>
</section>
{% set img_url = get_url(path='/' ~ page.relative_path | replace(from='_', to='-') | replace(from='index.md',
to=page.extra.imgPath)) %}
<img class="mb-8 mx-auto" src={{img_url}} alt="{{page.title ~ 'Picture'}}">
<div>{{ content | safe }}</div>
<section class="post-tags container relative py-10">
{% for tag in page.taxonomies.tags %}
{% set fullpath = "/tags/" ~ tag | replace(from='_', to='-' ) %}
<button class="
text-xs
bg-transparent
hover:text-gray-100
py-2
px-4
mr-2
border
hover:border-gray-100
border-gray-600
text-gray-400
rounded-full
"><a href="{{fullpath}}">{{ tag }}</a></button>
{% endfor %}
</section>
</article>
</div>
</div>
</main>
{% endblock content %}