Added comments powered by utterances

This commit is contained in:
2023-08-24 14:26:20 +03:00
parent dfecd6c7eb
commit d2e7a5403e
8 changed files with 343 additions and 314 deletions
-1
View File
@@ -15,7 +15,6 @@ highlight_code = true
highlight_theme = "gruvbox-dark" highlight_theme = "gruvbox-dark"
[link_checker] [link_checker]
skip_anchor_prefixes = ["https://github.com/"]
[extra] [extra]
author = "Ian Andwati" author = "Ian Andwati"
-29
View File
@@ -1,29 +0,0 @@
pre {
display: block;
padding: 0.25rem 1.25rem;
font-size: 85%;
border-left: 0.25rem solid var(--primary-accent-color);
}
code {
padding: 0 0.4rem;
// background-color: #3c3836;
background-color: var(--inline-code-background-color);
/* Inline code blocks look less aggresive with a little rounding. */
border-radius: 2px;
}
pre, code {
overflow: auto;
font-family: var(--default-mono-font);
}
/* Without this the <code> tag gains a little padding that offsets text by like
2 pixels. Let's *not* do that. */
pre > code {
padding: 0;
background-color: var(--code-background-color);
// Code inside a pre block doesn't need rounded borders.
border-radius: unset;
}
-16
View File
@@ -1,16 +0,0 @@
.pagination{
display: flex;
justify-content: space-between;
align-items: center;
list-style: none;
.page-item .disabled{
opacity: 0.5;
pointer-events: none;
}
.page-numbers{
font-size: 0.9rem;
color: var(--link-color);
}
}
+330 -263
View File
@@ -4,277 +4,344 @@
- Support footnotes or asides for notes sections. - Support footnotes or asides for notes sections.
- Serve fonts from the local server rather than Google's API. - Serve fonts from the local server rather than Google's API.
- Support a "display title" in an [extra] section to allow for <br> elements - Support a "display title" in an [extra] section to allow for <br> elements
or other manual control over title display. */ or other manual control over title display.
@charset "utf-8"; */
@use '_pagination.scss';
@use '_codeblocks.scss'; @charset "utf-8";
@use "parts/pagination.scss";
@import url('https://fonts.googleapis.com/css?family=Noto+Sans|Noto+Serif|Noto+Sans+Mono'); @use "parts/codeblocks.scss";
@import url("https://fonts.googleapis.com/css?family=Noto+Sans|Noto+Serif|Noto+Sans+Mono");
:root {
/* Fonts and Text Sizes */ :root {
--default-serif-font: "Noto Serif", serif; /* Fonts and Text Sizes */
--default-sans-font: "Noto Sans", sans-serif; --default-serif-font: "Noto Serif", serif;
--default-mono-font: "Noto Sans Mono", monospace; --default-sans-font: "Noto Sans", sans-serif;
--default-font-size: 16px; --default-mono-font: "Noto Sans Mono", monospace;
--header-font-size: 2.0em; --default-font-size: 16px;
/* Not sure I like this as the default, but it keeps inline code blocks from --header-font-size: 2em;
/* Not sure I like this as the default, but it keeps inline code blocks from
overlapping. */ overlapping. */
--default-line-height: 1.5; --default-line-height: 1.5;
/* Gruvbox Dark Colors */ /* Gruvbox Dark Colors */
--background-color: #1d2021; --background-color: #1d2021;
--foreground-color: #ebdbb2; --foreground-color: #ebdbb2;
--link-color: #458588; --link-color: #458588;
--muted-color: #928374; --muted-color: #928374;
--primary-accent-color: #b16286; --primary-accent-color: #b16286;
--secondary-accent-color: #689d6a; --secondary-accent-color: #689d6a;
--code-background-color: #282828; --code-background-color: #282828;
--inline-code-background-color: #3c3836; --inline-code-background-color: #3c3836;
} }
.accent { .accent {
color: var(--primary-accent-color); color: var(--primary-accent-color);
} }
/* Required for sticky footer. */ /* Required for sticky footer. */
html, body { html,
height: 100%; body {
} height: 100%;
}
body {
display: flex; /* Required for sticky footer. */ body {
flex-direction: column; /* Required for sticky footer. */ display: flex; /* Required for sticky footer. */
margin: 0; flex-direction: column; /* Required for sticky footer. */
line-height: var(--default-line-height); margin: 0;
font-size: var(--default-font-size); line-height: var(--default-line-height);
font-family: var(--default-serif-font); font-size: var(--default-font-size);
background-color: var(--background-color); font-family: var(--default-serif-font);
color: var(--foreground-color); background-color: var(--background-color);
border-top: 0.5em solid var(--primary-accent-color); color: var(--foreground-color);
} border-top: 0.5em solid var(--primary-accent-color);
}
main {
flex: 1 0 auto; /* Required for sticky footer. */ main {
} flex: 1 0 auto; /* Required for sticky footer. */
}
/* FIXME: For reasons that utterly bewilder me, an <article> with this id needs
/* FIXME: For reasons that utterly bewilder me, an <article> with this id needs
to be inside a <main> with no id. I have a strong feeling I've done to be inside a <main> with no id. I have a strong feeling I've done
something wrong here. */ something wrong here. */
#content { #content {
max-width: 48em; max-width: 48em;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding-right: 1.4em; padding-right: 1.4em;
padding-left: 1.4em; padding-left: 1.4em;
padding-bottom: 1.4em; padding-bottom: 1.4em;
} }
header { header {
overflow: hidden; /* FIXME: This WILL cut off titles that are too long! */ overflow: hidden; /* FIXME: This WILL cut off titles that are too long! */
margin-top: 1.4em; margin-top: 1.4em;
margin-bottom: 1.4em; margin-bottom: 1.4em;
margin-left: 1em; margin-left: 1em;
margin-right: 1em; margin-right: 1em;
} }
header > h1 { header > h1 {
text-align: center; text-align: center;
font-size: var(--header-font-size); font-size: var(--header-font-size);
font-family: var(--default-sans-font); font-family: var(--default-sans-font);
padding-top: 2.8rem; padding-top: 2.8rem;
margin-top: 0; margin-top: 0;
margin-bottom: 0.7rem; margin-bottom: 0.7rem;
} }
header .post-meta { header .post-meta {
text-align: center; text-align: center;
padding-top: 0.5em; padding-top: 0.5em;
padding-bottom: 0.9em; padding-bottom: 0.9em;
margin-bottom: 0; margin-bottom: 0;
} }
.post-meta time { .post-meta time {
// TODO: This color doesn't look great in with a light color scheme... // TODO: This color doesn't look great in with a light color scheme...
color: var(--muted-color); color: var(--muted-color);
} }
h2, h3, h4, h5, h6 { h2,
padding-top: 1.2rem; h3,
margin-bottom: 0.2rem; h4,
} h5,
h6 {
padding-top: 1.2rem;
p { margin-bottom: 0.2rem;
padding-top: 0.4em; }
margin-bottom: 1em;
} p {
padding-top: 0.4em;
blockquote { margin-bottom: 1em;
/* Default text uses serif, so use sans-serif to differentiate quoted text. */ }
font-family: var(--default-sans-font);
font-style: italic; blockquote {
/* Indent blockquotes, but align the start with where text in code begins. */ /* Default text uses serif, so use sans-serif to differentiate quoted text. */
margin: 0 1.25rem; font-family: var(--default-sans-font);
padding-left: 1.25rem; font-style: italic;
padding-right: 1.25rem; /* Indent blockquotes, but align the start with where text in code begins. */
border-left: 3px solid var(--secondary-accent-color); margin: 0 1.25rem;
} padding-left: 1.25rem;
padding-right: 1.25rem;
a { border-left: 3px solid var(--secondary-accent-color);
color: var(--link-color); }
text-decoration: none;
} a {
color: var(--link-color);
/* ---- Anchor links --------------------------------------------------------*/ text-decoration: none;
}
/* Add a # to the left of a subheading when it references an internal link... */
:where(h2, h3, h4, h5, h6) > a[href^="#"]::before { /* ---- Anchor links --------------------------------------------------------*/
content: "#";
display: inline-block; /* Add a # to the left of a subheading when it references an internal link... */
width: 1.2rem; :where(h2, h3, h4, h5, h6) > a[href^="#"]::before {
margin-left: -1.2rem; content: "#";
opacity: 0; display: inline-block;
} width: 1.2rem;
margin-left: -1.2rem;
/* ... but only display the internal anchor link when hovered over. */ opacity: 0;
:where(h2, h3, h4, h5, h6):hover > a[href^="#"]::before { }
opacity: 1;
} /* ... but only display the internal anchor link when hovered over. */
:where(h2, h3, h4, h5, h6):hover > a[href^="#"]::before {
/* When internal links are linked directly, display with the accent color. */ opacity: 1;
:where(h2, h3, h4, h5, h6):target > a[href^="#"]::before { }
opacity: 1;
color: var(--primary-accent-color); /* When internal links are linked directly, display with the accent color. */
} :where(h2, h3, h4, h5, h6):target > a[href^="#"]::before {
opacity: 1;
/* ---- Media ---------------------------------------------------------------*/ color: var(--primary-accent-color);
}
img, video {
/* Media should fill the width of its container if possible. */ /* ---- Media ---------------------------------------------------------------*/
width: 100%;
height: auto; img,
} video {
/* Media should fill the width of its container if possible. */
figure { width: 100%;
/* Don't add margins to figures. */ height: auto;
margin: 0; }
}
figure {
figcaption { /* Don't add margins to figures. */
/* De-emphasize figure captions. */ margin: 0;
font-size: 0.85rem; }
color: var(--muted-color);
} figcaption {
/* De-emphasize figure captions. */
/* ---- Tables --------------------------------------------------------------*/ font-size: 0.85rem;
color: var(--muted-color);
table { }
/* FIXME: Use flexbox for centering? Frankly, this is still bad on mobile.
/* ---- Tables --------------------------------------------------------------*/
table {
/* FIXME: Use flexbox for centering? Frankly, this is still bad on mobile.
display: flex; display: flex;
justify-content: center; justify-content: center;
*/ */
display: block; display: block;
overflow-x: auto; overflow-x: auto;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
text-align: left; text-align: left;
border-collapse: collapse; border-collapse: collapse;
} }
/* Headers in a row (column scoped) get a colored bottom border. */ /* Headers in a row (column scoped) get a colored bottom border. */
th[scope="col"] { th[scope="col"] {
padding-top: 0.4em; padding-top: 0.4em;
border-bottom: 3px solid var(--secondary-accent-color); border-bottom: 3px solid var(--secondary-accent-color);
} }
/* Headers in a column (row scoped) get a colored right border. */ /* Headers in a column (row scoped) get a colored right border. */
th[scope="row"] { th[scope="row"] {
border-right: 3px solid var(--secondary-accent-color); border-right: 3px solid var(--secondary-accent-color);
} }
td { td {
text-align: center; text-align: center;
border: 1px solid var(--muted-color); border: 1px solid var(--muted-color);
} }
th, td { th,
vertical-align: bottom; td {
padding-left: 0.4em; vertical-align: bottom;
padding-right: 0.4em; padding-left: 0.4em;
border: 1px solid var(--muted-color); padding-right: 0.4em;
} border: 1px solid var(--muted-color);
}
/* ---- Footer, nav, and copyright ------------------------------------------*/
/* ---- Footer, nav, and copyright ------------------------------------------*/
footer {
border-top: 0.5em solid var(--primary-accent-color); footer {
text-align: center; border-top: 0.5em solid var(--primary-accent-color);
/* FIXME: Using the code background color could look awkward if a post ends text-align: center;
/* FIXME: Using the code background color could look awkward if a post ends
in a code snippet. */ in a code snippet. */
background-color: var(--code-background-color); background-color: var(--code-background-color);
padding: 1.4em; padding: 1.4em;
flex-shrink: 0; /* Required for sticky footer. */ flex-shrink: 0; /* Required for sticky footer. */
} }
footer a { footer a {
color: var(--secondary-accent-color); color: var(--secondary-accent-color);
} }
/* Give footer nav links some breathing room. */ /* Give footer nav links some breathing room. */
footer > nav > a { footer > nav > a {
// margin: 0 1.4em; // margin: 0 1.4em;
margin: 0 0.4em; margin: 0 0.4em;
} }
/* FIXME: This could probably go away with global margin/padding adjustments. */ /* FIXME: This could probably go away with global margin/padding adjustments. */
footer p { footer p {
padding-top: 0; padding-top: 0;
} }
footer p, footer a { footer p,
font-family: var(--default-sans-font); footer a {
/* It doesn't seem as though Google fonts support direct usage of OpenType font-family: var(--default-sans-font);
/* It doesn't seem as though Google fonts support direct usage of OpenType
features like 'c2sc' and 'smcp'. features like 'c2sc' and 'smcp'.
FIXME: It's not clear why numerals don't seem to obey this property. */ FIXME: It's not clear why numerals don't seem to obey this property. */
font-variant-caps: all-small-caps; font-variant-caps: all-small-caps;
} }
/* ---- Media Queries ------------------------------------------------------ */ .pagination {
display: flex;
@media(min-width: 470px) { justify-content: space-between;
:root { --default-font-size: 17px; } align-items: center;
/* Above this size, increase the header margins. Smaller sizes benefit from list-style: none;
.page-item .disabled {
opacity: 0.5;
pointer-events: none;
}
.page-numbers {
font-size: 0.9rem;
color: var(--link-color);
}
}
pre {
display: block;
padding: 0.25rem 1.25rem;
font-size: 85%;
border-left: 0.25rem solid var(--primary-accent-color);
}
code {
padding: 0 0.4rem;
// background-color: #3c3836;
background-color: var(--inline-code-background-color);
/* Inline code blocks look less aggresive with a little rounding. */
border-radius: 2px;
}
pre,
code {
overflow: auto;
font-family: var(--default-mono-font);
}
/* Without this the <code> tag gains a little padding that offsets text by like
2 pixels. Let's *not* do that. */
pre > code {
padding: 0;
background-color: var(--code-background-color);
// Code inside a pre block doesn't need rounded borders.
border-radius: unset;
}
/* ---- Media Queries ------------------------------------------------------ */
@media (min-width: 470px) {
:root {
--default-font-size: 17px;
}
/* Above this size, increase the header margins. Smaller sizes benefit from
extra breathing room in the title. */ extra breathing room in the title. */
header { header {
margin-left: 2.8em; margin-left: 2.8em;
margin-right: 2.8em; margin-right: 2.8em;
} }
} }
@media(min-width: 625px) { @media (min-width: 625px) {
:root { --default-font-size: 18px; } :root {
} --default-font-size: 18px;
}
@media(min-width: 802px) { }
:root { --default-font-size: 19px; }
} @media (min-width: 802px) {
:root {
@media(min-width: 1003px) { --default-font-size: 19px;
:root { --default-font-size: 20px; } }
} }
@media(min-width: 1225px) { @media (min-width: 1003px) {
:root { --default-font-size: 21px; } :root {
/* On larger devices, give the anchor link some more space. */ --default-font-size: 20px;
:where(h2, h3, h4, h5, h6) > a[href^="#"]::before { }
width: 1.8rem; }
margin-left: -1.8rem;
} @media (min-width: 1225px) {
} :root {
--default-font-size: 21px;
@media(min-width: 1496px) { }
:root { --default-font-size: 22px; } /* On larger devices, give the anchor link some more space. */
} :where(h2, h3, h4, h5, h6) > a[href^="#"]::before {
width: 1.8rem;
margin-left: -1.8rem;
}
}
@media (min-width: 1496px) {
:root {
--default-font-size: 22px;
}
}
+9
View File
@@ -0,0 +1,9 @@
<div>
<script src="https://utteranc.es/client.js"
repo="andwati/andwati.com"
issue-term="title"
theme="gruvbox-dark"
crossorigin="anonymous"
async>
</script>
</div>
+2
View File
@@ -1,5 +1,6 @@
{% macro paginate() %} {% macro paginate() %}
{% if paginator %} {% if paginator %}
<div>
<ul class="pagination"> <ul class="pagination">
{% if paginator.previous %} {% if paginator.previous %}
<li class="page-item page-prev"> <li class="page-item page-prev">
@@ -21,5 +22,6 @@
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
</div>
{% endif %} {% endif %}
{% endmacro paginate %} {% endmacro paginate %}
+2
View File
@@ -29,5 +29,7 @@
{{ page.content | safe }} {{ page.content | safe }}
</article> </article>
</main> </main>
{% include "comments.html" %}
{% include "footer.html" %} {% include "footer.html" %}
{% endblock content %} {% endblock content %}
-5
View File
@@ -7,11 +7,6 @@
<h1>Posts</h1> <h1>Posts</h1>
</header> </header>
{% for page in paginator.pages %}{{ post_macros::snippet(page=page) }}{% endfor %} {% for page in paginator.pages %}{{ post_macros::snippet(page=page) }}{% endfor %}
<!--<div class="pagination">
{% if paginator.previous %}<a href="{{ paginator.previous }}" class="page-item previous">Previous</a>{% endif %}
{% if paginator.next %}<a href="{{ paginator.next }}" class="page-item next">Next</a>{% endif %}
</div>
-->
{% if paginator %}{{ paginate_macro::paginate() }}{% endif %} {% if paginator %}{{ paginate_macro::paginate() }}{% endif %}
</main> </main>
{% include "footer.html" %} {% include "footer.html" %}