Skip to content

Commit

Permalink
Do some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoverbear committed Dec 15, 2024
1 parent d0eae9e commit 231666f
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 96 deletions.
9 changes: 6 additions & 3 deletions templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@

{%- set commit = load_data(path=".git/refs/heads/root", required=false) -%}
{%- if commit -%}
<pre
class="artifact"><a id="commit" href="https://github.com/Hoverbear/hoverbear.org/commit/{{commit}}">{{ commit }}</a></pre>
<pre class="artifact">
<a id="commit" href="https://github.com/Hoverbear/hoverbear.org/commit/{{commit}}">{{ commit }}</a>
</pre>
{%- else -%}
<pre class="artifact"><a id="commit" href="https://github.com/Hoverbear/hoverbear.org/">development</a></pre>
<pre class="artifact">
<a id="commit" href="https://github.com/Hoverbear/hoverbear.org/">development</a>
</pre>
{%- endif -%}
</body>

Expand Down
4 changes: 2 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- extends "default.html" -%}

{%- block body -%}
{% include "partials/splash.html" %}
{% include "partials/header.html" %}
{% include "partials/splash.html" %}
{% include "partials/header.html" %}
{%- endblock body -%}
18 changes: 9 additions & 9 deletions templates/page.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% extends "default.html" %}

{% block body %}
{% include "partials/hero.html" %}
{% include "partials/header.html" %}
{% include "partials/hero.html" %}
{% include "partials/header.html" %}

<main>
{% include "partials/toc.html" %}
{% block main %}
{{ page.content | safe }}
{% endblock main %}
</main>
{% include "partials/footer.html" %}
<main>
{% include "partials/toc.html" %}
{% block main %}
{{ page.content | safe }}
{% endblock main %}
</main>
{% include "partials/footer.html" %}
{% endblock body %}
130 changes: 93 additions & 37 deletions templates/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,50 @@
<head>
<!-- Fun compatability things -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta
charset="utf-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0">
<!-- (1) Optimize for mobile versions: http://goo.gl/EOpFl -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- (1) force latest IE rendering engine: bit.ly/1c8EiC9 -->
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta
http-equiv="X-UA-Compatible"
content="IE=edge"> <!-- (1) force latest IE rendering engine: bit.ly/1c8EiC9 -->
<meta
name="HandheldFriendly"
content="True" />
<meta
name="MobileOptimized"
content="320" />

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Hoverbear" />
<meta
name="apple-mobile-web-app-capable"
content="yes">
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent">
<meta
name="apple-mobile-web-app-title"
content="Hoverbear" />

<link rel="icon" type="image/png" href="{{ config.base_url }}/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="{{ config.base_url }}/favicon.svg" />
<link rel="shortcut icon" href="{{ config.base_url }}/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ config.base_url }}/apple-touch-icon.png" />
<link rel="manifest" href="{{ config.base_url }}/site.webmanifest" />
<link
rel="icon"
type="image/png"
href="{{ config.base_url }}/favicon-96x96.png"
sizes="96x96" />
<link
rel="icon"
type="image/svg+xml"
href="{{ config.base_url }}/favicon.svg" />
<link
rel="shortcut icon"
href="{{ config.base_url }}/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="{{ config.base_url }}/apple-touch-icon.png" />
<link
rel="manifest"
href="{{ config.base_url }}/site.webmanifest" />

<!-- Information about this site -->
{%- if page -%}
Expand All @@ -33,63 +62,90 @@
content="{{ description }}" />

<!-- Various Twitter related content. -->
<meta name="twitter:card" content="summary_large_image">
<meta
name="twitter:card"
content="summary_large_image">

{%- if page.extra.image.path -%}
{%- set image = colocated_asset::colocated_asset(path=page.extra.image.path) | trim -%}
{%- set image = colocated_asset::colocated_asset(path=page.extra.image.path) | trim -%}
{% elif section.extra.image.path %}
{%- set image = colocated_asset::colocated_asset(path=section.extra.image.path) | trim -%}
{%- set image = colocated_asset::colocated_asset(path=section.extra.image.path) | trim -%}
{%- else -%}
{%- set image = '../static/' ~ config.extra.cover.path -%}
{%- set image = '../static/' ~ config.extra.cover.path -%}
{%- endif -%}

{% set image_3840 = resize_image(
path=image,
width=3840,
height=2160,
op='fit_width'
path=image,
width=3840,
height=2160,
op='fit_width'
) %}
<meta name="twitter:image" content="{{ image_3840.url }}" />
<meta property='og:image' content="{{ image_3840.url }}" />
<meta name="twitter:site" content="@{{ config.extra.twitter }}" />
<meta name="twitter:creator" content="@{{ config.extra.twitter }}" />
<link rel="me" href="{{ config.extra.mastodon_link }}">
<meta
name="twitter:image"
content="{{ image_3840.url }}" />
<meta
property='og:image'
content="{{ image_3840.url }}" />
<meta
name="twitter:site"
content="@{{ config.extra.twitter }}" />
<meta
name="twitter:creator"
content="@{{ config.extra.twitter }}" />
<link
rel="me"
href="{{ config.extra.mastodon_link }}">

<meta name="twitter:title"
<meta
name="twitter:title"
content="{{ title | striptags }}" />
<meta property='og:title'
<meta
property='og:title'
content="{{ title | striptags }}" />

<meta property='og:url'
<meta
property='og:url'
content="{{ page.permalink | default(value=section.permalink | default(value=config.base_url)) | striptags }}" />

<meta name="twitter:description"
<meta
name="twitter:description"
content="{{ description | striptags }}" />
<meta property='og:description'
content="{{ description | striptags }}" />


<!-- Talk about the homepage and the rss feed. -->
<link rel="canonical"
<link
rel="canonical"
href="{{ page.permalink | default(value=section.permalink | default(value=config.base_url)) | striptags }}">
<link rel="alternate" type="application/rss+xml" href="{{ config.base_url }}/rss.xml">
<link
rel="alternate"
type="application/rss+xml"
href="{{ config.base_url }}/rss.xml">

<!-- Stylesheets are fun -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link
rel="preconnect"
href="https://fonts.gstatic.com">
<link
href="https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Delius&family=Kode+Mono&family=Noto+Sans&display=swap"
rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen" href="{{ config.base_url }}/main.css" />
<link rel="stylesheet"
type="text/css" media="screen" href="{{ config.base_url }}/main.css" />

<!-- Katex -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
integrity="sha384-D+9gmBxUQogRLqvARvNLmA9hS2x//eK1FhVb9PiU86gmcrBrJAQT8okdJ4LMp2uv" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
<script defer
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
integrity="sha384-483A6DwYfKeDa0Q52fJmxFXkcPCFfnXMoXblOkJ4JcA8zATN6Tm78UNL72AKk+0O"
crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js"
<script defer
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js"
integrity="sha384-yACMu8JWxKzSp/C1YV86pzGiQ/l1YUfE8oPuahJQxzehAjEt2GiQuy/BIvl9KyeF" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

Expand Down
12 changes: 6 additions & 6 deletions templates/section.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% extends "page.html" %}

{% block body %}
{{ section.content | safe }}
{{ section.content | safe }}

{% for post in section.pages %}
<section>
{{ post.content | safe }}
</section>
{% endfor %}
{% for post in section.pages %}
<section>
{{ post.content | safe }}
</section>
{% endfor %}
{% endblock body %}
8 changes: 4 additions & 4 deletions templates/shortcodes/code_file.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{%- import "macros/code.html" as code -%}

{{ code::file(
path=path,
code_lang=code_lang | default(value=''),
colocated=colocated | default(value=false),
show_path_with_prefix=show_path_with_prefix | default(value=false)
path=path,
code_lang=code_lang | default(value=''),
colocated=colocated | default(value=false),
show_path_with_prefix=show_path_with_prefix | default(value=false)
) }}
10 changes: 5 additions & 5 deletions templates/shortcodes/internationalized_hoverbear.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% set internationalized_hoverbear = load_data(path="static/internationalized-hoverbear.json") %}
{%- for lang, data in internationalized_hoverbear -%}
{%- if loop.first != true and internationalized_hoverbear | length > 2 -%},{%- endif -%}
{%- if loop.last and internationalized_hoverbear | length > 1 -%}&nbsp;and{%- endif -%}
&nbsp;{{ data.display }}
{%- if data.display != data.pronounce %} (<i>{{ data.pronounce }}</i>){%- endif -%}
&nbsp;in {{ lang | capitalize }}
{%- if loop.first != true and internationalized_hoverbear | length > 2 -%},{%- endif -%}
{%- if loop.last and internationalized_hoverbear | length > 1 -%}&nbsp;and{%- endif -%}
&nbsp;{{ data.display }}
{%- if data.display != data.pronounce %} (<i>{{ data.pronounce }}</i>){%- endif -%}
&nbsp;in {{ lang | capitalize }}
{%- endfor -%}
6 changes: 3 additions & 3 deletions templates/shortcodes/youtube.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div {% if class %}class="{{class}}" {% endif %}></div>
<iframe src="https://www.youtube-nocookie.com/embed/{{id}}{% if autoplay %}?autoplay=1{% endif %}" frameborder="0"
webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
<iframe src="https://www.youtube-nocookie.com/embed/{{id}}{% if autoplay %}?autoplay=1{% endif %}" frameborder="0"
webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
</div>
36 changes: 18 additions & 18 deletions templates/tags/list.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{% extends "page.html" %}

{% block main %}
{% for term in terms %}
<section>
<h2><a href="{{ term.permalink }}">{{ term.name }}</a></h2>
<ul>
{%- for post in term.pages -%}
<li><a href="{{ post.permalink }}">
<strong>{{ post.title }}</strong>
</a>{% if post.description %}: {{ post.description }}{%- endif -%}
&nbsp;(posted <time datetime="{{ post.date | date(format=" %Y-%m-%d %H:%M") }}">{{ post.date |
date(format="%Y-%m-%d") }}</time>)
</li>
{% endfor %}
</ul>
</section>
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
{% for term in terms %}
<section>
<h2><a href="{{ term.permalink }}">{{ term.name }}</a></h2>
<ul>
{%- for post in term.pages -%}
<li><a href="{{ post.permalink }}">
<strong>{{ post.title }}</strong>
</a>{% if post.description %}: {{ post.description }}{%- endif -%}
&nbsp;(posted <time datetime="{{ post.date | date(format=" %Y-%m-%d %H:%M") }}">{{ post.date |
date(format="%Y-%m-%d") }}</time>)
</li>
{% endfor %}
</ul>
</section>
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
{% endblock main %}
18 changes: 9 additions & 9 deletions templates/tags/single.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% extends "page.html" %}

{% block main %}
<section>
<h2><a href="{{ term.permalink }}">{{ term.name }}</a></h2>
{% for post in term.pages %}
{{ post::metadata(post=post) }}
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
</section>
<section>
<h2><a href="{{ term.permalink }}">{{ term.name }}</a></h2>
{% for post in term.pages %}
{{ post::metadata(post=post) }}
{% if loop.last != true %}
<hr>
{% endif %}
{% endfor %}
</section>
{% endblock main %}

0 comments on commit 231666f

Please sign in to comment.