2 Commits

Author SHA1 Message Date
4808585bd0 WIP 2023-01-21 23:19:49 -06:00
a7ff8afb9f WIP 2023-01-21 23:19:32 -06:00
16 changed files with 114 additions and 163 deletions

View File

@ -46,7 +46,6 @@
--text-gray-1: #919191; /* lch(60, 0, X) */ --text-gray-1: #919191; /* lch(60, 0, X) */
--link-0: #3a94fb; /* lch(60, 60, 270) */ --link-0: #3a94fb; /* lch(60, 60, 270) */
--link-1: #4ea1ff; /* lch(65, 60, 270) -- out of sRGB */
--figure-border: #1f5593; /* lch(35, 40, 270) */ --figure-border: #1f5593; /* lch(35, 40, 270) */
@ -119,31 +118,17 @@
/* Fonts */ /* Fonts */
@font-face { @font-face {
font-family: "Open Sans"; /*font-family: Jost;*/
font-family: sans-serif;
font-display: swap; font-display: swap;
font-style: normal; font-style: normal;
src: url("/font/opensans/OpenSans-VariableFont_wdth,wght-9f637b868d10819aa0085e6cf7f70953411c8905c4055c069adbe8acc708feef.woff2") format("woff2"); src: url("/font/jost/Jost-VariableFont_wght.woff2") format("woff2");
} }
@font-face { @font-face {
font-family: JetBrainsMono; /*font-family: JetBrainsMono;*/
font-family: monospace;
font-display: swap; font-display: swap;
src: url("/font/jetbrainsmono/JetBrainsMono_wght-e190ee6595a3b9bd25278613a6f5d3766ee1a708f300ed44fa63dbe84051498f.woff2") format("woff2"); src: url("/font/jetbrainsmono/JetBrainsMono_wght.woff2") format("woff2");
}
:root {
--font-sans: "Open Sans", "Noto Sans", sans-serif;
--font-mono: JetBrainsMono, monospace;
}
html {
font-family: var(--font-sans);
}
pre, code, kbd, samp, textarea {
font-family: var(--font-mono);
font-size: 0.75em;
}
pre > code {
/* otherwise it ends up being 0.75^2 em */
font-size: unset;
} }
@ -304,7 +289,7 @@ pre > code {
.sections { .sections {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 40px;
} }
.section { .section {
@ -455,15 +440,16 @@ pre > code {
justify-content: center; justify-content: center;
} }
.share-buttons button,
.share-buttons a { .share-buttons a {
background-color: var(--background-2); background-color: var(--background-2);
color: var(--text-2); color: var(--text-2);
padding: 4px; padding: 4px;
border-radius: 8px; border-radius: 8px;
} }
.share-buttons a:hover {
background-color: var(--background-3); .share-buttons button {
color: var(--text-3); border: none;
} }
.share-buttons svg { .share-buttons svg {
@ -601,6 +587,9 @@ html {
body { body {
background-color: var(--background-0); background-color: var(--background-0);
color: var(--text-0); color: var(--text-0);
/*font-family: "Jost", "Open Sans", "Noto Sans", sans-serif;*/
font-family: sans-serif;
font-size: 16px;
margin: 20px; margin: 20px;
max-width: 720px; max-width: 720px;
overflow-wrap: break-word; overflow-wrap: break-word;
@ -613,7 +602,6 @@ body {
} }
footer { footer {
margin-top: 20px;
text-align: center; text-align: center;
} }
@ -661,7 +649,6 @@ a:hover {
blockquote { blockquote {
border-left: 5px solid var(--background-2); border-left: 5px solid var(--background-2);
padding-left: 15px; padding-left: 15px;
margin-left: 0;
} }
hr { hr {
@ -735,9 +722,6 @@ table.markdown {
margin: auto 0; margin: auto 0;
} }
/* TODO: make the code copy button prettier */ /* TODO: make the code copy button prettier */
.code-block > .code-header > .code-copy-button {
color: var(--link-1);
}
.code-block > .code-header > .code-copy-button:hover { .code-block > .code-header > .code-copy-button:hover {
cursor: pointer; cursor: pointer;
} }
@ -773,6 +757,11 @@ table.markdown {
} }
.code-block > .code-header > .code-type, .code-block > .code-header > .code-type,
pre,
code {
/*font-family: JetBrainsMono;*/
font-size: 12px;
}
code { code {
border-radius: 5px; border-radius: 5px;
} }

View File

@ -12,19 +12,14 @@ window.onscroll = function() {
window.onload = () => { window.onload = () => {
document.querySelectorAll(".code-block").forEach(codeBlock => { document.querySelectorAll(".code-block").forEach(codeBlock => {
const button = codeBlock.querySelector(".code-header > .code-copy-button"); const button = codeBlock.querySelector(".code-header > .code-copy-button");
// TODO: maybe get this from HTMLElement.innerText on the actual code block content element
// lang will not be unset because we default it to text // but it's hard to select it; `data-lang` attribute might not always be there (if lang is unset)
// clone it so it doesn't change the actual DOM element const rawCode = codeBlock.querySelector("pre.code-raw").innerText;
const codeElem = codeBlock.querySelector("code[data-lang]").cloneNode(true);
// bashsession: remove command output lines
codeElem.querySelectorAll(".go").forEach(e => e.parentNode.removeChild(e));
// bashsession: remove prompt symbol
codeElem.querySelectorAll(".gp").forEach(e => e.parentNode.removeChild(e));
const rawCode = codeElem.innerText;
const originalCopyText = button.innerHTML; const originalCopyText = button.innerHTML;
button.onclick = event => { button.onclick = event => {
navigator.clipboard.writeText(rawCode); navigator.clipboard.writeText(rawCode);
console.log(rawCode);
// TODO: maybe we could add a fancier indicator, like a flash or something // TODO: maybe we could add a fancier indicator, like a flash or something
event.target.innerHTML = "Copied!"; event.target.innerHTML = "Copied!";
setTimeout(() => { setTimeout(() => {

View File

@ -1,15 +1,13 @@
{{ $type := "text" }}
{{ with .Type }}
{{ $type = . }}
{{ end }}
<div class="code-block"> <div class="code-block">
<div class="code-header"> <div class="code-header">
<pre class="code-type">{{ $type }}</pre> <span class="code-type">{{ .Type }}</span>
<a href="javascript:void(0)" class="code-copy-button"> <a class="code-copy-button">
{{ i18n "copy_to_clipboard" }} {{ i18n "copy_to_clipboard" }}
</a> </a>
</div> </div>
{{/* a div.highlight is already created by highlight function */}} {{/* a div.highlight is already created by highlight function */}}
{{ highlight .Inner $type }} {{ highlight .Inner .Type }}
{{/* for copy to clipboard */}}
<pre class="code-raw" style="display: none;">{{ .Inner }}</pre>
</div> </div>

View File

@ -21,6 +21,7 @@
</main> </main>
{{ if or .Site.Copyright .Site.Params.footer }} {{ if or .Site.Copyright .Site.Params.footer }}
<hr>
<footer> <footer>
<small> <small>
{{ with .Site.Copyright }} {{ with .Site.Copyright }}

View File

@ -5,10 +5,6 @@
{{ partial "rss-link.html" . }} {{ partial "rss-link.html" . }}
</h1> </h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="list-page-content"> <div class="list-page-content">
{{ with .Sections }} {{ with .Sections }}
<div class="sections"> <div class="sections">

View File

@ -4,10 +4,6 @@
{{ .Title | markdownify }} {{ .Title | markdownify }}
</h1> </h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="page-list"> <div class="page-list">
{{ with .Paginator.Pages }} {{ with .Paginator.Pages }}
{{ range . }} {{ range . }}

View File

@ -54,10 +54,9 @@
*/}} */}}
{{ if .Site.Params.shareButtons.print }} {{ if .Site.Params.shareButtons.print }}
<a class="print-share" <button class="print-share"
href="javascript:void(0)"
onclick="window.print(); share_event('Print');"> onclick="window.print(); share_event('Print');">
{{- partial "icon.html" "printer" -}} {{- partial "icon.html" "printer" -}}
</a> </button>
{{ end }} {{ end }}
</div> </div>

View File

@ -4,10 +4,6 @@
{{ .Title | markdownify }} {{ .Title | markdownify }}
</h1> </h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="series-taxonomy-list"> <div class="series-taxonomy-list">
{{ with .Pages }} {{ with .Pages }}
{{ range . }} {{ range . }}

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
Copyright 2020 The Open Sans Project Authors (https://github.com/googlefonts/opensans) Copyright 2020 The Jost Project Authors (https://github.com/indestructible-type)
This Font Software is licensed under the SIL Open Font License, Version 1.1. This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: This license is copied below, and is also available with a FAQ at:

View File

@ -0,0 +1,81 @@
Jost Variable Font
==================
This download contains Jost as both variable fonts and static fonts.
Jost is a variable font with this axis:
wght
This means all the styles are contained in these files:
Jost-VariableFont_wght.ttf
Jost-Italic-VariableFont_wght.ttf
If your app fully supports variable fonts, you can now pick intermediate styles
that arent available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Jost:
static/Jost-Thin.ttf
static/Jost-ExtraLight.ttf
static/Jost-Light.ttf
static/Jost-Regular.ttf
static/Jost-Medium.ttf
static/Jost-SemiBold.ttf
static/Jost-Bold.ttf
static/Jost-ExtraBold.ttf
static/Jost-Black.ttf
static/Jost-ThinItalic.ttf
static/Jost-ExtraLightItalic.ttf
static/Jost-LightItalic.ttf
static/Jost-Italic.ttf
static/Jost-MediumItalic.ttf
static/Jost-SemiBoldItalic.ttf
static/Jost-BoldItalic.ttf
static/Jost-ExtraBoldItalic.ttf
static/Jost-BlackItalic.ttf
Get started
-----------
1. Install the font files you want to use
2. Use your app's font picker to view the font family and all the
available styles
Learn more about variable fonts
-------------------------------
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts
In desktop apps
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
Online
https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
Installing fonts
MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
Android Apps
https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.
You can use them in your products & projects print or digital,
commercial or otherwise.
This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.

View File

@ -1,100 +0,0 @@
Open Sans Variable Font
=======================
This download contains Open Sans as both variable fonts and static fonts.
Open Sans is a variable font with these axes:
wdth
wght
This means all the styles are contained in these files:
OpenSans-VariableFont_wdth,wght.ttf
OpenSans-Italic-VariableFont_wdth,wght.ttf
If your app fully supports variable fonts, you can now pick intermediate styles
that arent available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Open Sans:
static/OpenSans_Condensed/OpenSans_Condensed-Light.ttf
static/OpenSans_Condensed/OpenSans_Condensed-Regular.ttf
static/OpenSans_Condensed/OpenSans_Condensed-Medium.ttf
static/OpenSans_Condensed/OpenSans_Condensed-SemiBold.ttf
static/OpenSans_Condensed/OpenSans_Condensed-Bold.ttf
static/OpenSans_Condensed/OpenSans_Condensed-ExtraBold.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Light.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Regular.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Medium.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBold.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Bold.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBold.ttf
static/OpenSans/OpenSans-Light.ttf
static/OpenSans/OpenSans-Regular.ttf
static/OpenSans/OpenSans-Medium.ttf
static/OpenSans/OpenSans-SemiBold.ttf
static/OpenSans/OpenSans-Bold.ttf
static/OpenSans/OpenSans-ExtraBold.ttf
static/OpenSans_Condensed/OpenSans_Condensed-LightItalic.ttf
static/OpenSans_Condensed/OpenSans_Condensed-Italic.ttf
static/OpenSans_Condensed/OpenSans_Condensed-MediumItalic.ttf
static/OpenSans_Condensed/OpenSans_Condensed-SemiBoldItalic.ttf
static/OpenSans_Condensed/OpenSans_Condensed-BoldItalic.ttf
static/OpenSans_Condensed/OpenSans_Condensed-ExtraBoldItalic.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-LightItalic.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Italic.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-BoldItalic.ttf
static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf
static/OpenSans/OpenSans-LightItalic.ttf
static/OpenSans/OpenSans-Italic.ttf
static/OpenSans/OpenSans-MediumItalic.ttf
static/OpenSans/OpenSans-SemiBoldItalic.ttf
static/OpenSans/OpenSans-BoldItalic.ttf
static/OpenSans/OpenSans-ExtraBoldItalic.ttf
Get started
-----------
1. Install the font files you want to use
2. Use your app's font picker to view the font family and all the
available styles
Learn more about variable fonts
-------------------------------
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts
In desktop apps
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
Online
https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
Installing fonts
MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
Android Apps
https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.
You can use them in your products & projects print or digital,
commercial or otherwise.
This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.