Fancier hr, goatcounter analytics, simplify bg-color variable, add default value for the locale setting

This commit is contained in:
David Lapshin
2024-05-16 17:20:34 +03:00
parent bcabba7a64
commit a108cc7501
6 changed files with 35 additions and 14 deletions

View File

@ -103,12 +103,20 @@ show_source = false
# These variables are also used for Mastodon verification, # These variables are also used for Mastodon verification,
# the needed rel="me" link is set in the head based on these. # the needed rel="me" link is set in the head based on these.
[extra.comments] [extra.comments]
# Your Mastodon API host; instance that you have an account on # Your Mastodon API host; instance that you have an account on.
host = "vmst.io" host = "vmst.io"
# Your Mastodon username; used to determine who the original poster is # Your Mastodon username; used to determine who the original poster is.
user = "daudix" user = "daudix"
# Whether to show the QR code to Mastodon post # Whether to show the QR code to Mastodon post
show_qr = true show_qr = true
# BCP 47 locale used for comment timestamps; # BCP 47 locale used for comment timestamps;
# See https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry # See https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
locale = "en-IE" # Default: "en-IE"
# locale = "YOUR_LOCALE"
# GoatCounter analytics; enabled only if present in config.
[extra.goatcounter]
# Your GoatCounter server; goatcounter.com is used by default.
# host = "YOUR_SERVER"
# Your GoatCounter username
user = "daudix"

View File

@ -112,7 +112,7 @@ primary_color_alpha = "COLOR_CODE"
- [alavi.me](https://alavi.me) - [alavi.me](https://alavi.me)
- [bano.dev](https://bano.dev) - [bano.dev](https://bano.dev)
- [blog.pansi21.xyz](https://blog.pansi21.xyz) - [blog.pansi21.xyz](https://blog.pansi21.xyz)
- [daudix.codeberg.page](https://daudix.codeberg.page) (obviously) - [daudix.codeberg.page](https://daudix.codeberg.page) <small>(obviously)</small>
- [daveparr.info](https://www.daveparr.info) - [daveparr.info](https://www.daveparr.info)
- [digital-horror.com](https://digital-horror.com) - [digital-horror.com](https://digital-horror.com)
- [enriquekesslerm.com](https://enriquekesslerm.com) - [enriquekesslerm.com](https://enriquekesslerm.com)

View File

@ -62,8 +62,7 @@ body {
// LAYOUT // LAYOUT
.container { .container {
margin-right: auto; margin: 0 auto;
margin-left: auto;
width: min(var(--container-width), 90%); width: min(var(--container-width), 90%);
} }
@ -125,9 +124,20 @@ dl {
hr { hr {
margin: 2rem auto; margin: 2rem auto;
border: 0; border: none;
border-top: 1px solid var(--fg-muted-2); border-top: 3px double var(--fg-muted-2);
width: 100%; overflow: visible;
color: var(--fg-muted-4);
font-size: 1.5rem;
text-align: center;
&::after {
position: relative;
top: -1.5rem;
background: var(--bg-color);
padding: 0 0.25rem;
content: "☙❧";
}
} }
blockquote { blockquote {

View File

@ -1,6 +1,6 @@
:root { :root {
// COLORS // COLORS
--bg-color: var(--bg-color-l); --bg-color: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), var(--primary-color);
--fg-color: rgba(0, 0, 0, 0.8); --fg-color: rgba(0, 0, 0, 0.8);
--fg-muted-1: rgba(0, 0, 0, 0.05); --fg-muted-1: rgba(0, 0, 0, 0.05);
--fg-muted-2: rgba(0, 0, 0, 0.1); --fg-muted-2: rgba(0, 0, 0, 0.1);
@ -21,8 +21,6 @@
// VARIABLES // VARIABLES
--active: 0.9; --active: 0.9;
--bg-color-d: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)), var(--primary-color);
--bg-color-l: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), var(--primary-color);
--blur: saturate(180%) blur(10px); --blur: saturate(180%) blur(10px);
--container-width: 720px; --container-width: 720px;
--edge-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1); --edge-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);
@ -39,7 +37,7 @@
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
// COLORS // COLORS
--bg-color: var(--bg-color-d); --bg-color: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)), var(--primary-color);
--fg-color: rgb(255, 255, 255); --fg-color: rgb(255, 255, 255);
--fg-muted-1: rgba(255, 255, 255, 0.05); --fg-muted-1: rgba(255, 255, 255, 0.05);
--fg-muted-2: rgba(255, 255, 255, 0.1); --fg-muted-2: rgba(255, 255, 255, 0.1);

View File

@ -185,7 +185,7 @@
permalink.setAttribute("rel", "external nofollow"); permalink.setAttribute("rel", "external nofollow");
permalink.textContent = new Date( permalink.textContent = new Date(
status.created_at status.created_at
).toLocaleString("{{ config.extra.comments.locale }}", { ).toLocaleString("{{ config.extra.comments.locale | default(value='en-IE') }}", {
dateStyle: "long", dateStyle: "long",
timeStyle: "short", timeStyle: "short",
}); });

View File

@ -37,6 +37,11 @@
<script src="{{ get_url(path='copy-button.js') }}"></script> <script src="{{ get_url(path='copy-button.js') }}"></script>
{% endif %} {% endif %}
{% if config.extra.goatcounter %}
<script data-goatcounter="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count" async src="//gc.zgo.at/count.js"></script>
<noscript><img src="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count?p={{ current_path | default(value='/') | safe }}"></noscript>
{% endif %}
{% if config.extra.comments %} {% if config.extra.comments %}
<link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" /> <link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" />
{% endif %} {% endif %}