mirror of
https://github.com/SebastianStork/kita.git
synced 2026-01-21 13:21:35 +01:00
init: initial commit
This commit is contained in:
commit
e38bcddf57
48 changed files with 3752 additions and 0 deletions
4
templates/404.html
Normal file
4
templates/404.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{% extends "index.html" %}<!---->
|
||||
{% block main %}<!---->
|
||||
<h1 class="absolute inset-x-8 bottom-20 top-0 flex items-center justify-center text-9xl">404</h1>
|
||||
{% endblock main %}
|
||||
62
templates/index.html
Normal file
62
templates/index.html
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<!doctype html>
|
||||
<html class="not-ready lg:text-base" lang="{{ lang }}">
|
||||
{% include "partials/head.html" %}
|
||||
<body class="text-black duration-200 ease-out dark:text-white">
|
||||
{% include "partials/header.html" %}
|
||||
|
||||
<main
|
||||
class="prose prose-neutral relative mx-auto min-h-[calc(100%-9rem)] max-w-3xl px-4 pb-16 pt-32 dark:prose-invert"
|
||||
>
|
||||
{% block main %}
|
||||
|
||||
<!-- avatar -->
|
||||
{% if paginator.current_index == 1 %}<!---->
|
||||
{% if config.extra.profile.avatar_url or config.extra.profile.name %}
|
||||
<div class="mb-16 flex items-start">
|
||||
{% if config.extra.profile.avatar_url %}
|
||||
<div
|
||||
class="mr-5 shrink-0 rounded-full border-[0.5px] border-black/10 bg-white/50 p-3 shadow dark:bg-white/[15%]"
|
||||
>
|
||||
<img
|
||||
class="{% if config.extra.profile.avatar_invert %}dark:invert{% endif %} my-0 aspect-square w-16 rounded-full !bg-black/5 hover:animate-spin"
|
||||
src="{{ config.extra.profile.avatar_url }}"
|
||||
alt="{{ config.extra.profile.name | default(value=config.title) }}"
|
||||
/>
|
||||
</div>
|
||||
{% endif %}<!---->
|
||||
|
||||
{% if config.extra.profile.name %}
|
||||
<div>
|
||||
<h1 class="mb-2 text-3xl font-bold">{{ config.extra.profile.name }}</h1>
|
||||
<div class="mb-2 break-words">
|
||||
{{ config.extra.profile.bio | default(value=`A blog by ` ~ config.extra.profile.name) }}
|
||||
</div>
|
||||
|
||||
{% if config.extra.profile.social %}
|
||||
<nav class="flex justify-start space-x-3 dark:invert">
|
||||
{% for social in config.extra.profile.social %}
|
||||
<a
|
||||
class="h-8 w-8 text-[0] [background:var(--url)_center_center/cover_no-repeat]"
|
||||
style="--url: url(./{{ social.name }}.svg)"
|
||||
href="{{ social.url }}"
|
||||
target="_blank"
|
||||
rel="{% if social.name == `rss` %}alternate{% else %}me{% endif %}"
|
||||
>
|
||||
{{ social.name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}<!---->
|
||||
</div>
|
||||
{% endif %}<!---->
|
||||
{% endif %}<!---->
|
||||
|
||||
{% include "partials/page_list.html" %}<!---->
|
||||
{% endblock main %}
|
||||
</main>
|
||||
|
||||
{% include "partials/footer.html" %}
|
||||
</body>
|
||||
</html>
|
||||
74
templates/page.html
Normal file
74
templates/page.html
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{% extends "index.html" %}<!---->
|
||||
{% block main %}
|
||||
<article>
|
||||
<header class="mb-16">
|
||||
<h1 class="!my-0 pb-2.5">{{ page.title }}</h1>
|
||||
{% include "partials/page_info.html" %}
|
||||
</header>
|
||||
|
||||
<section>{{ page.content | safe }}</section>
|
||||
|
||||
<hr />
|
||||
|
||||
<!-- Post Taxonomies -->
|
||||
{% if page.taxonomies.tags %}
|
||||
<footer class="mt-12 flex flex-wrap">
|
||||
{% for term_name, terms in page.taxonomies %}<!---->
|
||||
<span class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 dark:bg-white/[8%]"
|
||||
>{{ term_name | title }}
|
||||
</span>
|
||||
{% for term in terms %}<!---->
|
||||
<a
|
||||
class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 no-underline dark:bg-white/[8%]"
|
||||
href="{{ get_taxonomy_url(kind=term_name, name=term) | safe }}"
|
||||
>{{ term }}</a
|
||||
>
|
||||
{% endfor %} {% endfor %}
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
<!-- Post Nav -->
|
||||
{% if not config.extra.disable_post_navigation %}<!---->
|
||||
{% if page.lower or page.higher %}
|
||||
<nav class="mt-12 flex rounded-lg bg-black/[3%] text-lg dark:bg-white/[8%]">
|
||||
{% if page.higher %}
|
||||
<a
|
||||
class="flex w-1/2 items-center rounded-l-md p-6 pr-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
|
||||
href="{{ page.higher.permalink }}"
|
||||
><span class="mr-1.5">←</span><span>{{ page.higher.title }}</span></a
|
||||
>
|
||||
{% endif %}<!---->
|
||||
{% if page.lower %}
|
||||
<a
|
||||
class="ml-auto flex w-1/2 items-center justify-end rounded-r-md p-6 pl-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
|
||||
href="{{ page.lower.permalink }}"
|
||||
><span>{{ page.lower.title }}</span><span class="ml-1.5">→</span></a
|
||||
>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}<!---->
|
||||
{% endif %}
|
||||
|
||||
<!-- giscus comment -->
|
||||
{% if config.extra.giscus.repo and page.extra.comments %}
|
||||
<div class="giscus mt-12"></div>
|
||||
<script
|
||||
src="https://giscus.app/client.js"
|
||||
data-repo="{{ config.extra.giscus.repo }}"
|
||||
data-repo-id="{{ config.extra.giscus.repo_id }}"
|
||||
data-category="{{ config.extra.giscus.category }}"
|
||||
data-category-id="{{ config.extra.giscus.category_id }}"
|
||||
data-mapping="{{ config.extra.giscus.mapping | default(value=`pathname`) }}"
|
||||
data-strict="{{ config.extra.giscus.strict | default(value=`1`) }}"
|
||||
data-reactions-enabled="{{ config.extra.giscus.reactions_enabled | default(value=`0`) }}"
|
||||
data-emit-metadata="{{ config.extra.giscus.emit_metadata | default(value=`0`) }}"
|
||||
data-input-position="{{ config.extra.giscus.input_position | default(value=`top`) }}"
|
||||
data-theme="{{ config.extra.giscus.theme | default(value=`light`) }}"
|
||||
data-lang="{{ config.extra.giscus.lang | default(value=`en`) }}"
|
||||
data-loading="{{ config.extra.giscus.loading | default(value=`lazy`) }}"
|
||||
crossorigin="anonymous"
|
||||
async
|
||||
></script>
|
||||
{% endif %}
|
||||
</article>
|
||||
{% endblock main %}
|
||||
24
templates/partials/footer.html
Normal file
24
templates/partials/footer.html
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<footer class="mx-auto flex max-w-3xl flex-wrap items-center px-8 py-4 text-sm opacity-60">
|
||||
<div class="mr-auto basis-full lg:basis-1/2">
|
||||
© {% if config.extra.footer.since %}{{ config.extra.footer.since }} - {% endif %} {{ now()
|
||||
| date(format="%Y") }}
|
||||
<a class="link" href="{{ get_url(path=``) }}"
|
||||
>{{ config.author | default(value=config.title) }}</a
|
||||
>
|
||||
{% if config.extra.footer.license %} |<!---->
|
||||
{% if config.extra.footer.license_url %}<!---->
|
||||
<a class="link" href="{{ config.extra.footer.license_url }}">
|
||||
{{ config.extra.footer.license }}
|
||||
</a>
|
||||
{% else %}<!---->
|
||||
{{ config.extra.footer.license }}<!---->
|
||||
{% endif %}<!---->
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="flex basis-full lg:basis-1/2 lg:justify-end">
|
||||
<a class="link mr-6 lg:ml-6" href="https://www.getzola.org/" rel="noopener" target="_blank"
|
||||
>Powered by Zola</a
|
||||
>
|
||||
<a class="link" href="https://github.com/st1020/kita" rel="noopener" target="_blank">✎ Kita</a>
|
||||
</div>
|
||||
</footer>
|
||||
84
templates/partials/head.html
Normal file
84
templates/partials/head.html
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
|
||||
<!-- Title -->
|
||||
<title>
|
||||
{% if page.title %}{{ config.title }} - {{ page.title }}{% else %}{{ config.title }}{% endif %}
|
||||
</title>
|
||||
|
||||
<!-- Meta -->
|
||||
<meta name="theme-color" />
|
||||
|
||||
<!-- Author -->
|
||||
{% if page %}
|
||||
<meta name="description" content="{{ page.summary | default(value=page.title) | safe }}" />
|
||||
<meta name="author" content="{{ page.extra.author | default(value=page.title) }}" />
|
||||
{% else %}
|
||||
<meta name="description" content="{{ config.description | default(value=`A personal blog`) }}" />
|
||||
<meta name="author" content="{{ config.author | default(value=config.title) }}" />
|
||||
{% endif %}
|
||||
|
||||
<!-- CSS & JS -->
|
||||
<link rel="preload stylesheet" as="style" href="{{ get_url(path=`main.css`) }}" />
|
||||
<style>
|
||||
:root {
|
||||
--bg: {{ config.extra.style.bg_color | default(value="#f4f4f5") }};
|
||||
--bg-dark: {{ config.extra.style.bg_dark_color | default(value="#18181b") }};
|
||||
--header: {{ config.extra.style.header_color | default(value="#e4e4e7") }};
|
||||
--header-dark: {{ config.extra.style.header_dark_color | default(value="#27272a") }};
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Avatar -->
|
||||
{% if config.extra.profile.avatar_url %}
|
||||
<link rel="preload" as="image" href="{{ config.extra.profile.avatar_url }}" />
|
||||
{% endif %}
|
||||
|
||||
<!-- Social List -->
|
||||
{% if config.extra.profile.social %}
|
||||
<!---->
|
||||
{% for social in config.extra.profile.social %}
|
||||
<link rel="preload" as="image" href="{{ get_url(path=social.name ~ `.svg`) }}" />
|
||||
{% endfor %}
|
||||
<!---->
|
||||
{% endif %}
|
||||
|
||||
<!-- Dark Icon -->
|
||||
<link rel="preload" as="image" href="{{ get_url(path=`theme.svg`) }}" />
|
||||
|
||||
<!-- Math -->
|
||||
{% if page.extra.math | default(value=config.extra.math) %}
|
||||
<!---->
|
||||
{% include "partials/math.html" %}
|
||||
<!---->
|
||||
{% endif %}
|
||||
<!---->
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" href="{{ get_url(path=`favicon.ico`) }}" />
|
||||
<link rel="apple-touch-icon" href="{{ get_url(path=`apple-touch-icon.png`) }}" />
|
||||
|
||||
<!-- Feeds -->
|
||||
{% if config.generate_feed %} {% if config.feed_filename == "atom.xml" %}
|
||||
<link
|
||||
rel="alternate"
|
||||
type="application/atom+xml"
|
||||
title="Atom"
|
||||
href="{{ get_url(path=`atom.xml`) }}"
|
||||
/>
|
||||
{% elif config.feed_filename == "rss.xml" %}
|
||||
<link
|
||||
rel="alternate"
|
||||
type="application/rss+xml"
|
||||
title="RSS"
|
||||
href="{{ get_url(path=`rss.xml`) }}"
|
||||
/>
|
||||
{% endif %}
|
||||
<!---->
|
||||
{% endif %}
|
||||
|
||||
<!-- Canonical -->
|
||||
<link rel="canonical" href="{{ page.permalink | default(value=get_url(path=``)) }}" />
|
||||
</head>
|
||||
79
templates/partials/header.html
Normal file
79
templates/partials/header.html
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<header
|
||||
class="{% if config.extra.style.header_blur %}blur-header{% else %}header{% endif %} fixed top-0 z-40 mx-auto min-h-[3.5rem] w-full"
|
||||
>
|
||||
<div class="mx-auto w-full max-w-4xl p-3 lg:flex lg:justify-between">
|
||||
<div class="flex justify-between">
|
||||
<div class="flex items-center">
|
||||
<a class="text-2xl font-semibold" href="{{ get_url(path=``) }}">{{ config.title }}</a>
|
||||
<div
|
||||
class="btn-dark ml-4 h-6 w-6 shrink-0 cursor-pointer text-[0] [background:url(./theme.svg)_left_center/cover_no-repeat] dark:invert dark:[background-position:right]"
|
||||
role="button"
|
||||
aria-label="Dark"
|
||||
></div>
|
||||
</div>
|
||||
{% if config.extra.menu %}
|
||||
<div
|
||||
class="btn-menu relative z-50 flex h-8 w-8 shrink-0 cursor-pointer flex-col items-center justify-center gap-2.5 lg:hidden"
|
||||
role="button"
|
||||
aria-label="Menu"
|
||||
></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<script>
|
||||
// base
|
||||
const htmlClass = document.documentElement.classList;
|
||||
setTimeout(() => {
|
||||
htmlClass.remove("not-ready");
|
||||
}, 10);
|
||||
|
||||
// mobile menu
|
||||
const btnMenu = document.querySelector(".btn-menu");
|
||||
btnMenu.addEventListener("click", () => {
|
||||
htmlClass.toggle("open");
|
||||
});
|
||||
|
||||
// dark theme
|
||||
const setDark = (isDark) => {
|
||||
htmlClass[isDark ? "add" : "remove"]("dark");
|
||||
localStorage.setItem("dark", isDark);
|
||||
};
|
||||
|
||||
// init
|
||||
const darkScheme = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
if (htmlClass.contains("dark")) {
|
||||
setDark(true);
|
||||
} else {
|
||||
const darkVal = localStorage.getItem("dark");
|
||||
setDark(darkVal ? darkVal === "true" : darkScheme.matches);
|
||||
}
|
||||
|
||||
// listen system
|
||||
darkScheme.addEventListener("change", (event) => {
|
||||
setDark(event.matches);
|
||||
});
|
||||
|
||||
// manual switch
|
||||
const btnDark = document.querySelector(".btn-dark");
|
||||
btnDark.addEventListener("click", () => {
|
||||
setDark(localStorage.getItem("dark") !== "true");
|
||||
});
|
||||
</script>
|
||||
{% if config.extra.menu %}
|
||||
<nav class="flex w-full items-center lg:w-auto">
|
||||
<ul
|
||||
class="nav-wrapper flex w-full flex-col py-2 lg:w-auto lg:flex-row lg:self-center lg:py-0"
|
||||
>
|
||||
{% for menu in config.extra.menu %}
|
||||
<li>
|
||||
<a
|
||||
class="block py-2 text-center text-lg font-medium text-black dark:text-white lg:px-3 lg:py-0"
|
||||
href="{{ menu.url }}"
|
||||
>{{ menu.name }}</a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
33
templates/partials/math.html
Normal file
33
templates/partials/math.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css"
|
||||
integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<script
|
||||
defer
|
||||
src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.js"
|
||||
integrity="sha384-G0zcxDFp5LWZtDuRMnBkk3EphCK1lhEf4UEyEM693ka574TZGwo4IWwS6QLzM/2t"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
<script
|
||||
defer
|
||||
src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/auto-render.min.js"
|
||||
integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () =>
|
||||
renderMathInElement(document.body, {
|
||||
// customised options
|
||||
// • auto-render specific keys, e.g.:
|
||||
delimiters: [
|
||||
{ left: "$$", right: "$$", display: true },
|
||||
{ left: "$", right: "$", display: false },
|
||||
],
|
||||
// • rendering keys, e.g.:
|
||||
throwOnError: false,
|
||||
}),
|
||||
);
|
||||
</script>
|
||||
13
templates/partials/page_info.html
Normal file
13
templates/partials/page_info.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<div class="text-sm antialiased opacity-60">
|
||||
{% if page.date %}
|
||||
<time>{{ page.date | date }}</time>
|
||||
<span class="mx-1">·</span>
|
||||
<span>{{ page.reading_time }}min</span>
|
||||
{% endif %}<!---->
|
||||
{% set single_author = page.extra.author | default(value=config.author) %}
|
||||
<!---->
|
||||
{% if single_author %}
|
||||
<span class="mx-1">·</span>
|
||||
<span>{{ single_author }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
49
templates/partials/page_list.html
Normal file
49
templates/partials/page_list.html
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<!-- Pages -->
|
||||
{% if pages is defined %}<!---->
|
||||
{% elif paginator is defined %}<!---->
|
||||
{% set pages = paginator.pages %}<!---->
|
||||
{% elif term is defined %}<!---->
|
||||
{% set pages = term.pages %}<!---->
|
||||
{% elif section is defined %}<!---->
|
||||
{% set pages = section.pages %}<!---->
|
||||
{% endif %}<!---->
|
||||
|
||||
{% for page in pages %}
|
||||
<section
|
||||
class="relative mb-4 rounded-lg bg-white/80 p-4 first-of-type:mt-0 last-of-type:mb-0 active:scale-95 dark:bg-white/[8%] lg:mb-6 lg:p-6"
|
||||
>
|
||||
<h2 class="!my-0 pb-1 font-bold !leading-none">{{ page.title }}</h2>
|
||||
|
||||
<div class="not-prose my-1 truncate">
|
||||
{% if page.description %}
|
||||
<p>{{ page.description }}</p>
|
||||
{% elif page.summary %}<!---->
|
||||
{{ page.summary | safe }}<!---->
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include "partials/page_info.html" %}
|
||||
|
||||
<a class="absolute inset-0 text-[0]" href="{{ page.permalink }}">{{ page.title }}</a>
|
||||
</section>
|
||||
{% endfor %}
|
||||
|
||||
<!-- Main Nav -->
|
||||
{% if paginator is defined %}
|
||||
<nav class="mt-16 flex">
|
||||
{% if paginator.previous %}
|
||||
<a
|
||||
class="rounded-full bg-black px-4 py-3 text-sm text-white no-underline shadow duration-100 active:scale-95 dark:bg-white/80 dark:text-black"
|
||||
href="{{ paginator.previous }}"
|
||||
>← Prev Page</a
|
||||
>
|
||||
{% endif %}<!---->
|
||||
{% if paginator.next %}
|
||||
<a
|
||||
class="ml-auto rounded-full bg-black px-4 py-3 text-sm text-white no-underline shadow duration-100 active:scale-95 dark:bg-white/80 dark:text-black"
|
||||
href="{{ paginator.next }}"
|
||||
>Next Page →</a
|
||||
>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
9
templates/section.html
Normal file
9
templates/section.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{% extends "index.html" %}<!---->
|
||||
{% block main %}<!---->
|
||||
<!-- Section Title -->
|
||||
<h1 class="mb-16">{{ section.title }}</h1>
|
||||
|
||||
<!-- Pages -->
|
||||
{% include "partials/page_list.html" %}<!---->
|
||||
|
||||
{% endblock main %}
|
||||
30
templates/taxonomy_list.html
Normal file
30
templates/taxonomy_list.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{% extends "index.html" %}<!---->
|
||||
{% block main %}
|
||||
<!-- Taxonomy Title -->
|
||||
<h1 class="mb-16">{{ taxonomy.name | title }}</h1>
|
||||
|
||||
<div class="not-prose flex flex-auto flex-wrap">
|
||||
{% for term in terms %}
|
||||
<div class="min-h-[18rem] w-full items-stretch p-2 md:w-1/2">
|
||||
<div class="flex h-full flex-col rounded-lg bg-black/[3%] px-5 py-1.5 dark:bg-white/[8%]">
|
||||
<h3 class="my-4 text-xl font-bold text-black dark:text-white">
|
||||
<a class="no-underline" href="{{ term.permalink }}">
|
||||
#{{ term.name }} - {{ term.page_count }}
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
{%for page in term.pages | slice(end=5) %}
|
||||
<a class="my-0.5 no-underline" href="{{ page.permalink }}">{{ page.title }}</a>
|
||||
{% endfor %}<!---->
|
||||
|
||||
{% if term.pages | length > 5 %}
|
||||
<span class="flex justify-end">
|
||||
<a class="my-1 pr-2 no-underline" href="{{ term.permalink }}">More >></a>
|
||||
</span>
|
||||
{% endif %}<!---->
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}<!---->
|
||||
</div>
|
||||
|
||||
{% endblock main %}
|
||||
9
templates/taxonomy_single.html
Normal file
9
templates/taxonomy_single.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{% extends "index.html" %}<!---->
|
||||
{% block main %}
|
||||
<!-- Term Title -->
|
||||
<h1 class="mb-16">#{{ term.name }}</h1>
|
||||
|
||||
<!-- Pages -->
|
||||
{% include "partials/page_list.html" %}<!---->
|
||||
|
||||
{% endblock main %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue