Skip to content

Commit

Permalink
Add explanatory text above the cards on /projects page
Browse files Browse the repository at this point in the history
  • Loading branch information
christianfosli committed Apr 8, 2024
1 parent 150e2c1 commit 8ea17f0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
8 changes: 7 additions & 1 deletion content/projects/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
+++
title = "Projects"
sort_by = "weight"
template = "cards.html"
template = "cards-with-pre-text.html"

[extra]
pre_cards_text = """
Here is an overview of most of my hobby projects.
Note that projects I have worked on professionally (i.e. for clients) are not shown here.
"""
+++
41 changes: 41 additions & 0 deletions templates/cards-with-pre-text.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends "base.html" %}

<!-- Based on cards.html from apollo, but with an explanatory text before the cards come -->

{% block main_content %}
{% if section.extra.section_path -%}
{% set section = get_section(path=section.extra.section_path) %}
{% endif -%}

{{ post_macros::page_header(title=section.title) }}

<main>
<p>
{{ section.extra.pre_cards_text }}
</p>

{%- if paginator %}
{%- set show_pages = paginator.pages -%}
{% else %}
{%- set show_pages = section.pages -%}
{% endif -%}

{{ post_macros::cards_posts(pages=show_pages) }}
</main>

{% if paginator %}
<ul class="pagination">
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
</span>
{% endif %}

{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
{% endif %}
</ul>
{% endif %}
{% endblock main_content %}

0 comments on commit 8ea17f0

Please sign in to comment.