init commit
This commit is contained in:
commit
52b82fe03f
13 changed files with 372 additions and 0 deletions
11
templates/404.html
Normal file
11
templates/404.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Not Found - {{ config.title }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<article class="not-found">
|
||||
<h1>404</h1>
|
||||
<p>Page not found.</p>
|
||||
<p><a href="{{ get_url(path='/') }}">Return home</a></p>
|
||||
</article>
|
||||
{% endblock content %}
|
||||
35
templates/base.html
Normal file
35
templates/base.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ lang | default(value="en") }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
|
||||
<meta name="description" content="{% block description %}{{ config.description }}{% endblock description %}">
|
||||
<link rel="stylesheet" href="{{ get_url(path='style.css') }}">
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path='rss.xml') }}">
|
||||
<!-- KaTeX for math rendering -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"
|
||||
onload="renderMathInElement(document.body, {
|
||||
delimiters: [
|
||||
{left: '$$', right: '$$', display: true},
|
||||
{left: '$', right: '$', display: false}
|
||||
]
|
||||
});"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav>
|
||||
<a href="{{ get_url(path='/') }}" class="site-title">{{ config.title }}</a>
|
||||
<a href="{{ get_url(path='blog') }}">Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
{% block content %}{% endblock content %}
|
||||
</main>
|
||||
<footer>
|
||||
<p>© {{ now() | date(format="%Y") }} {{ config.extra.author }}</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
20
templates/index.html
Normal file
20
templates/index.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<article class="homepage">
|
||||
{{ section.content | safe }}
|
||||
</article>
|
||||
|
||||
<section class="recent-posts">
|
||||
<h2>Recent Posts</h2>
|
||||
{% set blog = get_section(path="blog/_index.md") %}
|
||||
<ul class="post-list">
|
||||
{% for page in blog.pages | slice(end=5) %}
|
||||
<li>
|
||||
<time datetime="{{ page.date }}">{{ page.date | date(format="%Y-%m-%d") }}</time>
|
||||
<a href="{{ page.permalink }}">{{ page.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endblock content %}
|
||||
17
templates/page.html
Normal file
17
templates/page.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ page.title }} - {{ config.title }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<header class="post-header">
|
||||
<h1>{{ page.title }}</h1>
|
||||
{% if page.date %}
|
||||
<time datetime="{{ page.date }}">{{ page.date | date(format="%B %d, %Y") }}</time>
|
||||
{% endif %}
|
||||
</header>
|
||||
<div class="content">
|
||||
{{ page.content | safe }}
|
||||
</div>
|
||||
</article>
|
||||
{% endblock content %}
|
||||
33
templates/section.html
Normal file
33
templates/section.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ section.title }} - {{ config.title }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ section.title }}</h1>
|
||||
|
||||
{% if section.content %}
|
||||
<div class="section-content">
|
||||
{{ section.content | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<ul class="post-list">
|
||||
{% for page in section.pages %}
|
||||
<li>
|
||||
<time datetime="{{ page.date }}">{{ page.date | date(format="%Y-%m-%d") }}</time>
|
||||
<a href="{{ page.permalink }}">{{ page.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if paginator %}
|
||||
<nav class="pagination">
|
||||
{% if paginator.previous %}
|
||||
<a href="{{ paginator.previous }}">← Newer</a>
|
||||
{% endif %}
|
||||
{% if paginator.next %}
|
||||
<a href="{{ paginator.next }}">Older →</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue