jae-blog/templates/index.html

69 lines
2.4 KiB
HTML
Raw Normal View History

2024-05-01 23:12:52 +03:00
{%- import "macros.askama" as macros -%}
2024-04-18 04:05:38 +03:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="{{ title }}" />
<meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ description }}" />
2024-07-01 03:16:17 +03:00
{% match color %} {% when Some with (color) %}
<meta name="theme-color" content="{{ color }}" />
{% when None %} {% endmatch %}
2024-04-18 04:05:38 +03:00
<title>{{ title }}</title>
<link rel="stylesheet" href="/static/style.css" />
2024-05-26 20:23:40 +03:00
{% if rss %}
<link rel="alternate" type="application/rss+xml" title="{{ title }}" href="/feed.xml" />
2024-07-01 03:16:17 +03:00
{% endif %}
<!-- prettier-br -->
{% if js %}
2024-08-01 00:25:42 +03:00
<script src="/static/date.js" defer></script>
<script src="/static/sort.js" defer></script>
<script src="/static/main.js" defer></script>
2024-05-26 20:23:40 +03:00
{% endif %}
2024-04-18 04:05:38 +03:00
</head>
<body>
<main>
<h1>{{ title }}</h1>
<p>{{ description }}</p>
<h2>posts</h2>
<div>
2024-08-01 00:25:42 +03:00
{% if posts.is_empty() %}<!-- prettier-br -->
there are no posts right now. check back later!<!-- prettier-br -->
{% else %}<!-- prettier-br -->
{% if js %}<!-- prettier-br -->
<form id="sort" style="display: none">
sort by: <br />
2024-08-01 00:25:42 +03:00
<input type="radio" name="sort" id="sort-date" value="date" {% if sort == Sort::Date %} checked {% endif %} />
<label for="sort-date">date</label>
<input type="radio" name="sort" id="sort-name" value="name" {% if sort == Sort::Name %} checked {% endif %} />
<label for="sort-name">name</label>
</form>
2024-05-04 00:24:29 +03:00
{% endif %}<!-- prettier-br -->
2024-08-01 00:25:42 +03:00
<div id="posts">
{% for post in posts %}
<div class="post">
<a href="/posts/{{ post.name }}"><b>{{ post.title }}</b></a>
<span class="post-author">- by {{ post.author }}</span>
<br />
{{ post.description }}<br />
{% call macros::table(post) %}
</div>
{% endfor %}
2024-05-01 23:12:52 +03:00
</div>
2024-08-01 00:25:42 +03:00
{% endif %}<!-- prettier-br -->
2024-04-18 04:05:38 +03:00
</div>
2024-05-01 23:12:52 +03:00
{% let tags = posts|collect_tags %}<!-- prettier-br -->
{% if !tags.is_empty() %}
<h2>tags</h2>
2024-08-01 00:31:58 +03:00
<b><a href="/">clear tags</a></b>
<br />
2024-05-01 23:12:52 +03:00
{% endif %}<!-- prettier-br -->
{% for tag in tags %}
<a href="/?tag={{ tag.0 }}" title="view all posts with this tag">{{ tag.0 }}</a>
<span class="post-author">- {{ tag.1 }} post{% if tag.1 != 1 %}s{%endif %}</span><br />
{% endfor %}
2024-04-18 04:05:38 +03:00
</main>
</body>
</html>