feat: 🎉 initial commit

This commit is contained in:
Sebin Nyshkim 2024-10-11 21:47:59 +02:00
commit b3003321c9
35 changed files with 9015 additions and 0 deletions

67
src/layouts/base.njk Normal file
View file

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
{% metagen
title=title + ' - Sebin\'s Blog',
desc=description,
url=url + page.url,
twitter_card_type=twitter.cardType,
twitter_handle=twitter.account,
name=author.name,
generator='eleventy'
%}
{% ogImage "og-image.og.njk", { title: title } %}
<link rel="alternate" href="/feed.xml" type="application/atom+xml">
<link rel="stylesheet" href="{{ '/fonts/tilt-warp/tilt-warp.css' | url }}">
<link rel="stylesheet" href="{{ '/fonts/encode-sans/encode-sans.css' | url }}">
<link rel="stylesheet" href="{{ '/fonts/m-plus-1-code/m-plus-1-code.css' | url }}">
<link rel="stylesheet" href="{{ '/css/style.css' | url }}">
<link rel="stylesheet" href="{{ '/css/prism.css' | url }}">
<link rel="me" href="https://meow.social/@SebinNyshkim">
</head>
<body class="h-dvh bg-slate-300 text-slate-700 dark:bg-slate-900 dark:text-slate-300">
<header>
<div class="mx-auto max-w-screen-xl sm:px-safe-offset-4 md:px-safe-offset-6">
<nav class="eleventy-navigation flex min-h-16 items-center justify-center bg-sky-600 shadow-xl sm:m-4 sm:mx-auto sm:justify-between sm:rounded-xl dark:bg-sky-950">
<img src="/img/sebin.png" alt="it me" class="m-4 hidden max-w-14 rounded-full border-4 text-center shadow-2xl sm:block">
{{
collections.all |
eleventyNavigation |
eleventyNavigationToHtml({
listClass: "nav-list",
anchorClass: "nav-link",
activeAnchorClass: "active",
activeKey: eleventyNavigation.key
}) |
safe
}}
</nav>
</div>
</header>
<main class="mb-20 space-y-10 pt-10 *:px-safe-offset-4 sm:mb-32 sm:pt-16 md:mb-40 md:pt-20">
{{ content | safe }}
</main>
<footer class="pb-16">
<div class="mx-auto max-w-screen-xl divide-y divide-slate-400 px-safe-offset-4 md:px-safe-offset-6 dark:divide-slate-600">
<div class="flex flex-wrap gap-6 md:flex-nowrap md:gap-0"></div>
<div class="mt-16 flex justify-between gap-4 pt-10">
<div>
<p>&copy; {% year %} Sebin Nyshkim</p>
<p>Content licensed under
<a class="text-sky-600 transition-colors duration-300 hover:text-sky-400" href="https://creativecommons.org/licenses/by-sa/4.0/">
CC BY-SA 4.0
</a>
</p>
</div>
<div class="text-right">
<p>Made with
<a class="text-sky-600 transition-colors duration-300 hover:text-sky-400" href="https://11ty.dev">11ty</a>
</p>
</div>
</div>
</div>
</footer>
</body>
</html>

7
src/layouts/page.njk Normal file
View file

@ -0,0 +1,7 @@
---
layout: base.njk
---
<section class="blogpost">
{{ content | safe }}
</section>

41
src/layouts/post.njk Normal file
View file

@ -0,0 +1,41 @@
---
layout: base.njk
---
<article class="blogpost">
<h1 class="text-4xl">{{ title }}</h1>
<aside class="not-prose space-y-4 text-base">
<ul class="postmeta">
<li>
{% lucide "calendar", {"size": "20"} %}
<time datetime="{{ page.date | isoDate }}" title="{{ page.date | longDate }}">
{{ page.date | readableDate }}
</time>
</li>
<li>
{% lucide "user", {"size": "20"} %}
<a href="{{ author.href }}">{{ author.name }}</a>
</li>
<li>
{% lucide "glasses", {"size": "20"} %}
{{ content | readingtime }}
</li>
</ul>
{% if tags.length > 0 %}
<ul class="tags">
{% for tag in tags %}
<li class="tag">
{% lucide "tag", {"size": "20"} %}
{{ tag }}
</li>
{%- endfor %}
</ul>
{% endif %}
</aside>
{% if image and image.src != '' %}
<img src="{{ image.src }}" alt="{{ image.alt }}">
{% endif %}
{{ content | safe }}
</article>

58
src/layouts/postlist.njk Normal file
View file

@ -0,0 +1,58 @@
---
layout: base.njk
---
<section class="blogpost">
<h1>{{ title }}</h1>
<p>Everything I have written, from newest to oldest.</p>
</section>
{{ content | safe }}
{% if pagination.pages.length > 1 %}
<nav>
<ol class="pagination">
<li>
{% if page.url != pagination.href.first %}
<a href="{{ pagination.href.first }}">{% lucide "chevron-first" %}</a>
{% else %}
<span>{% lucide "chevron-first" %}</span>
{% endif %}
</li>
<li>
{% if pagination.href.previous %}
<a href="{{ pagination.href.previous }}">{% lucide "chevron-left" %}</a>
{% else %}
<span>{% lucide "chevron-left" %}</span>
{% endif %}
</li>
{%- for pageEntry in pagination.pages %}
<li>
<a
href="{{ pagination.hrefs[ loop.index0 ] }}"
{% if page.url == pagination.hrefs[ loop.index0 ] %}
aria-current="page"
{% endif %}
>
{{ loop.index }}
</a>
</li>
{%- endfor %}
<li>
{% if pagination.href.next %}
<a href="{{ pagination.href.next }}">{% lucide "chevron-right" %}</a>
{% else %}
<span>{% lucide "chevron-right" %}</span>
{% endif %}
</li>
<li>
{% if page.url != pagination.href.last %}
<a href="{{ pagination.href.last }}">{% lucide "chevron-last" %}</a>
{% else %}
<span>{% lucide "chevron-last" %}</span>
{% endif %}
</li>
</ol>
</nav>
{% endif %}