Create a bunch of templates

This commit is contained in:
c0de 2023-12-28 21:14:10 -06:00
parent 0ed2e1ee7b
commit 4edd2fb59d
9 changed files with 397 additions and 7 deletions

13
templates/base.html Normal file
View File

@ -0,0 +1,13 @@
{% include 'header.html' %}
{% include 'body_top.html' %}
{% include 'navbar.html' %}
<main>
{% include 'call_to_action.html' %}
{% include 'gallery.html' %}
</main>
{% include 'footer.html' %}
{% include 'body_bottom.html' %}

View File

@ -0,0 +1,9 @@
{% if static.scripts.bootstrap %}
<script
src="{{ static.scripts.bootstrap.src | default('') }}"
integrity="{{ static.scripts.bootstrap.integrity | default('') }}"
crossorigin="{{ static.scripts.bootstrap.crossorigin | default('anonymous' if static.scripts.bootstrap.integrity else '') }}"
></script>
{% endif %}
</body>
</html>

53
templates/body_top.html Normal file
View File

@ -0,0 +1,53 @@
<body>
<!-- Bootstrap Color Picker -->
<svg xmlns="http://www.w3.org/2000/svg" class="d-none">
<symbol id="check2" viewBox="0 0 16 16">
<path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/>
</symbol>
<symbol id="circle-half" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
</symbol>
<symbol id="moon-stars-fill" viewBox="0 0 16 16">
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
</symbol>
<symbol id="sun-fill" viewBox="0 0 16 16">
<path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
</symbol>
</svg>
<div class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle">
<button class="btn btn-bd-primary py-2 dropdown-toggle d-flex align-items-center"
id="bd-theme"
type="button"
aria-expanded="false"
data-bs-toggle="dropdown"
aria-label="Toggle theme (auto)">
<svg class="bi my-1 theme-icon-active" width="1em" height="1em"><use href="#circle-half"></use></svg>
<span class="visually-hidden" id="bd-theme-text">Toggle theme</span>
</button>
<ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="bd-theme-text">
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
<svg class="bi me-2 opacity-50 theme-icon" width="1em" height="1em"><use href="#sun-fill"></use></svg>
Light
<svg class="bi ms-auto d-none" width="1em" height="1em"><use href="#check2"></use></svg>
</button>
</li>
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false">
<svg class="bi me-2 opacity-50 theme-icon" width="1em" height="1em"><use href="#moon-stars-fill"></use></svg>
Dark
<svg class="bi ms-auto d-none" width="1em" height="1em"><use href="#check2"></use></svg>
</button>
</li>
<li>
<button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="auto" aria-pressed="true">
<svg class="bi me-2 opacity-50 theme-icon" width="1em" height="1em"><use href="#circle-half"></use></svg>
Auto
<svg class="bi ms-auto d-none" width="1em" height="1em"><use href="#check2"></use></svg>
</button>
</li>
</ul>
</div>
<!-- End Bootstrap Color Picker -->

View File

@ -0,0 +1,45 @@
<!--
#~ Var | Required | Default ~#
active | no | false
header | yes | none
lead_text | yes | none
action_buttons (list, optional)
n. (list index)
- href | no | #
- theme | no | primary
- icon | no | none
- text | yes | none
... (etc)
-->
{% if active | default(false) %}
<section class="py-5 text-center container">
<div class="row py-lg-5">
<div class="col-lg-6 col-md-8 mx-auto">
<h1 class="fw-light">{{ header }}</h1>
<p class="lead text-body-secondary">{{ lead_text }}</p>
{% if action_buttons %}
<p>
{% for button in action_buttons %}
<a
href="{{ button.href | default('#') }}"
class="btn btn-{{ button.theme | default('primary') }} my-2 d-inline-flex"
>
{{ button.text }}
{% if button.icon %}
<svg
class="bi"
width="{{ button.icon.width }}"
height="{{ button.icon.height }}"
>
<use xlink:href="#{{ button.icon.name }}"/>
</svg>
{% endif %}
</a>
{% endfor %}
</p>
{% endif %}
</div>
</div>
</section>
{% endif %}

View File

@ -1,8 +1,40 @@
<div class="col-md-3">
<a href="{{FULLLINK}}" target="{{FULLLINK}}">
<div class="card mb-3 bg-dark text-white">
<div class="card-header">{{TITLE}}</div>
<img class="card-img" width="250" src="{{THUMBNAIL}}" />
</div>
</a>
<div class="col">
<div class="card shadow-sm">
<div class="card-header text-end">
<a
href="#"
class="btn btn-light"
data-bs-toggle="tooltip"
data-bs-placement="top"
data-bs-title="Add a reaction"
>
<i class="bi bi-heart-fill" style="font-size: 1rem; color: pink;"></i>
</a>
</div>
<img
class="card-image-top"
width="{{ width | default('100%') }}"
height="{{ height | default('225') }}"
src="{{ src }}"
alt="{{ alt_text if alt_text else title }}"
/>
<div class="card-body">
<h5 class="card-title text-center">{{ title }}</h5>
<p class="card-text">{{ description | default('') }}</p>
</div>
<div class="card-footer text-body-secondary text-end">
{% if reactions %}
{% for reaction in reactions %}
{# TODO: limit total number of reactions shown #}
<span class="badge rounded-pill">
<svg class="bi" width="1rem" height="1rem"><use xlink:href="#{{ reaction }}" /></svg>
</span>
{% endfor %}
{% endif %}
</div>
</div>
</div>

View File

@ -0,0 +1,23 @@
<div class="col">
<div class="card" aria-hidden="true">
<div class="card-header">
<div class="d-flex align-items-center">
<strong role="status">Loading...</strong>
<div class="spinner-border ms-auto" aria-hidden="true"></div>
</div>
</div>
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Loading..." preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">Loading...</text></svg>
<div class="card-body">
<h5 class="card-title placeholder-glow">
<span class="placeholder col-6"></span>
</h5>
<p class="card-text placeholder-glow">
<span class="placeholder col-7"></span>
<span class="placeholder col-4"></span>
<span class="placeholder col-4"></span>
<span class="placeholder col-6"></span>
<span class="placeholder col-8"></span>
</p>
</div>
</div>
</div>

23
templates/footer.html Normal file
View File

@ -0,0 +1,23 @@
<!--
#~ Var | Required | Default ~#
main_line | no | none
extra_lines (list)
- (text to print) | no | none
-->
<footer class="text-body-secondary py-5">
<div class="container">
<p class="float-end mb-1">
<a href="#">Back to top</a>
</p>
<p class="mb-1">{{ main_line | default('') }}</p>
{% if extra_lines %}
{% for line in extra_lines %}
{% if line %}
<p class="mb-0">{{ line }}</p>
{% endif %}
{% endfor %}
{% endif %}
</div>
</footer>

130
templates/header.html Normal file
View File

@ -0,0 +1,130 @@
<!--
#~ Var | Required | Default ~#
language | no | en
css_theme_name | no | auto
canonical_url | yes | none
page_title | yes | none
static (list)
- scripts (list)
- bootstrap (used in footer.html)
- src | yes | none
- integrity | no | empty
- crossorigin | no | empty if no integrity, anonymous otherwise
- theme
- src | yes | none
- integrity | no | empty
- crossorigin | no | empty if no integrity, anonymous otherwise
- css (list)
- bootstrap
- src | yes | none
- integrity | no | empty
- crossorigin | no | empty if no integrity, anonymous otherwise
- theme
- src | yes | none
- integrity | no | empty
- crossorigin | no | empty if no integrity, anonymous otherwise
- icons
- src | yes | none
- integrity | no | empty
- crossorigin | no | empty if no integrity, anonymous otherwise
meta_list
n. (list index)
- name | yes | none
- content | yes | none
... (etc)
favicon_list (list of dicts)
n. (list index)
- rel | no | icon
- src | yes | none
- sizes | no | none
- type | no | none
- color | no | none
... (etc)
-->
<!doctype html>
<html
lang="{{ language | default('en') }}"
data-bs-theme="{{ css_theme_name | default('auto') }}"
>
<head>
{% if static.scripts.theme %}
<script
src="{{ static.scripts.theme.src | default('') }}"
integrity="{{ static.scripts.theme.integrity | default('') }}"
crossorigin="{{ static.scripts.theme.crossorigin | default('anonymous' if static.scripts.theme.integrity else '') }}"
></script>
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="canonical" href="{{ canonical_url }}" />
<title>{{ page_title }}</title>
{% if meta_list %}
<!-- meta-tags -->
{% for meta in meta_list %}
<meta name="{{ meta.name }}" content="{{ meta.content }}" />
{% endfor %}
{% endif %}
<!--
#~ These are to be provided by the meta_list above, at minimum ~#
<meta charset="{{ meta.charset | default('utf-8') }}" />
<meta name="description" content="{{ page_description | default('') }}" />
<meta name="generator" content="{{ content_generator | default('') }}" />
<meta name="author" content="{{ page_author | default('') }}" />
<meta name="theme-color" content="#712cf9" />
-->
{% if favicon_list %}
<!-- Favicons -->
{% for icon in favicon_list %}
<link
rel="{{ icon.rel | default('icon') }}"
href="{{ icon.src }}"
sizes="{{ icon.sizes | default('') }}"
type="{{ icon.type | default('') }}"
color="{{ icon.color | default('') }}"
/>
{% endfor %}
{% endif %}
<!--
#~ These are to be provided by the favicon_list above ~#
<link rel="apple-touch-icon" href="/docs/5.3/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="/docs/5.3/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="/docs/5.3/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="manifest" href="/docs/5.3/assets/img/favicons/manifest.json">
<link rel="mask-icon" href="/docs/5.3/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
<link rel="icon" href="/docs/5.3/assets/img/favicons/favicon.ico">
-->
{% if static.css.bootstrap %}
<link
rel="stylesheet"
href="{{ static.css.bootstrap.src }}"
integrity="{{ static.css.bootstrap.integrity | default('') }}"
crossorigin="{{ static.css.bootstrap.crossorigin | default('anonymous' if static.css.bootstrap.integrity else '') }}"
/>
{% endif %}
{% if static.css.theme %}
<link
rel="stylesheet"
href="{{ static.css.theme.src }}"
integrity="{{ static.css.theme.integrity | default('') }}"
crossorigin="{{ static.css.theme.crossorigin | default('anonymous' if static.css.theme.integrity else '') }}"
/>
{% endif %}
{% if static.css.icons %}
<link
rel="stylesheet"
href="{{ static.css.icons.src }}"
integrity="{{ static.css.icons.integrity | default('') }}"
crossorigin="{{ static.css.icons.crossorigin | default('anonymous' if static.css.icons.integrity else '') }}"
/>
{% endif %}
</head>

62
templates/navbar.html Normal file
View File

@ -0,0 +1,62 @@
<!--
#~ Var | Required | Default ~#
theme | no | dark
text_theme | no | white
page_title | yes | none
left_header | no | About
left_text | no | none
right_header | no | none
link_list
n. (list index)
- href | yes | none
- text | yes | none
... (etc)
-->
<header data-bs-theme="{{ theme | default('dark') }}">
<div class="collapse text-bg-{{ theme | default('dark') }}" id="navbarHeader">
<div class="container">
<div class="row">
<div class="col-sm-8 col-md-7 py-4">
<h4>{{ left_header | default('About') }}</h4>
<p class="text-body-secondary">{{ left_text | default('') }}</p>
</div>
<div class="col-sm-4 offset-md-1 py-4">
<h4>{{ right_header | default('') }}</h4>
{% if link_list %}
<ul class="list-unstyled">
{% for link in link_list %}
{% if link.href and link.text %}
<li><a href={{ link.href }} class="text-{{ text_theme | default('white') }}">
{% if link.icon %}
<svg
class="bi"
width="{{ link.icon.width }}"
height="{{ link.icon.height }}"
>
<use xlink:href="#{{ link.icon.name }}"/>
</svg>
{% endif %}
{{ link.text }}
</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
</div>
</div>
</div>
<div class="navbar navbar-{{ theme | default('dark') }} bg-{{ theme | default('dark') }} shadow-sm">
<div class="container">
<a href="#" class="navbar-brand d-flex align-items-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="me-2" viewBox="0 0 24 24"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>
<strong>{{ page_title }}</strong>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</header>