feat: create hayflow, a zola theme
This commit is contained in:
30
templates/base.html
Normal file
30
templates/base.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% import "macros.html" as macro -%}
|
||||
|
||||
{% set author = macro::format_name(name=config.extra.name) | striptags -%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="author" content="{{ author }}">
|
||||
<meta name="description" content="{{ author }}'s landing page">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" href="favicon.svg">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-normalize/modern-normalize.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" />
|
||||
<title>{{ author }}</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
</body>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
|
||||
<script>
|
||||
particlesJS.load('particles', 'particles.json', null);
|
||||
</script>
|
||||
|
||||
</html>
|
15
templates/cards/columns.html
Normal file
15
templates/cards/columns.html
Normal file
@ -0,0 +1,15 @@
|
||||
{{ section.content | safe }}
|
||||
|
||||
<div class="columns">
|
||||
{% for page in section.pages %}
|
||||
<div>
|
||||
<h2>{{ page.title }}</h2>
|
||||
|
||||
{% for icon in page.extra.icons | default(value=[]) %}
|
||||
<i class="{{ icon }} fa-3x"></i>
|
||||
{% endfor %}
|
||||
|
||||
{{ page.content | safe }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
19
templates/cards/list.html
Normal file
19
templates/cards/list.html
Normal file
@ -0,0 +1,19 @@
|
||||
{{ section.content | safe }}
|
||||
|
||||
{% for page in section.pages %}
|
||||
{% set_global link_after = not link_after | default(value=false) %}
|
||||
<h2>{{ page.title }}</h2>
|
||||
<div class="list">
|
||||
{% if link_after %}
|
||||
{{ page.content | safe }}
|
||||
{% endif %}
|
||||
|
||||
{% if page.extra.link %}
|
||||
<a aria-label="external link" class="list_link" href="{{ page.extra.link }}" target="_blank" rel="noopener noreferrer">Découvrir</a>
|
||||
{% endif %}
|
||||
|
||||
{% if not link_after %}
|
||||
{{ page.content | safe }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
1
templates/cards/simple.html
Normal file
1
templates/cards/simple.html
Normal file
@ -0,0 +1 @@
|
||||
{{ section.content | safe }}
|
57
templates/index.html
Normal file
57
templates/index.html
Normal file
@ -0,0 +1,57 @@
|
||||
{% extends "base.html" -%}
|
||||
|
||||
{% block content -%}
|
||||
|
||||
{% set sections = [] -%}
|
||||
{% for section in config.extra.sections | default(value=[]) -%}
|
||||
{% set_global sections = sections | concat(with=get_section(path=section ~ "/_index.md")) -%}
|
||||
{% endfor -%}
|
||||
|
||||
<div id="particles" class="fullflex"></div>
|
||||
|
||||
<div id="landing" class="fullflex">
|
||||
<div id="splash">
|
||||
|
||||
<h1 id="name">
|
||||
{{ macro::format_name(name=config.extra.name) }}
|
||||
</h1>
|
||||
|
||||
{% if config.extra.roles -%}
|
||||
<div id="roles">
|
||||
<p>
|
||||
{% for role in config.extra.roles -%}
|
||||
<span>{{ role }}</span><br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
{% if config.extra.links -%}
|
||||
<div id="links">
|
||||
<p>
|
||||
{% for link in config.extra.links -%}
|
||||
<a aria-label="external link" href="{{ link.url }}"><i class="{{ link.icon }} fa-2x"></i></a>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if sections -%}
|
||||
<div id="internal_links">
|
||||
<p>
|
||||
{% for section in sections -%}
|
||||
{% set section_name = macro::get_section_name(section=section) %}
|
||||
<a aria-label="go to {{ section_name }} section" href="#{{ section_name }}">{{ macro::get_section_title(section=section) }}</a>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% for section in sections -%}
|
||||
{{ macro::card(section=section) }}
|
||||
{% endfor -%}
|
||||
|
||||
{% endblock content %}
|
44
templates/macros.html
Normal file
44
templates/macros.html
Normal file
@ -0,0 +1,44 @@
|
||||
{% macro card(section) -%}
|
||||
{% set section_name = macro::get_section_name(section=section) -%}
|
||||
<div id="{{ section_name }}" class="fullflex">
|
||||
<div class="arrows">
|
||||
<div class="down">
|
||||
<a aria-label="Go to {{ section_name }} section" href="#{{ section_name }}"><i class="fa-solid fa-chevron-down fa-2x"></i></a>
|
||||
</div>
|
||||
<div class="up">
|
||||
<a aria-label="Go to landing section" href="#landing"><i class="fa-solid fa-chevron-up fa-2x"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h1>{{ macro::get_section_title(section=section) }}</h1>
|
||||
{% set card_type = section.extra.card_type | default(value="simple") %}
|
||||
{% if card_type == "simple" -%}
|
||||
{%- include "cards/simple.html" -%}
|
||||
{% elif card_type == "columns" -%}
|
||||
{%- include "cards/columns.html" -%}
|
||||
{% elif card_type == "list" -%}
|
||||
{%- include "cards/list.html" -%}
|
||||
{% else -%}
|
||||
<p>Unknown Card Type 🤷</p>
|
||||
{% endif -%}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
|
||||
{% macro format_name(name) -%}
|
||||
{{ config.extra.name.first | title }} <em>{{ config.extra.name.last | upper }}</em>
|
||||
{%- endmacro %}
|
||||
|
||||
|
||||
|
||||
{% macro get_section_name(section) -%}
|
||||
{{ section.path | replace(from="/", to="") }}
|
||||
{%- endmacro %}
|
||||
|
||||
|
||||
|
||||
{% macro get_section_title(section) -%}
|
||||
{{ section.title | default(value="Untitled Section") }}
|
||||
{%- endmacro %}
|
Reference in New Issue
Block a user