Compare commits

...

11 Commits

Author SHA1 Message Date
BBaoVanC ac580e1995
WIP 2023-01-22 18:57:52 -06:00
BBaoVanC cee1cd3a82
WIP 2023-01-22 18:57:52 -06:00
BBaoVanC 3fae019148
Finish support for list page subtitle
Fixes #27 (as long as I didn't miss anything)
2023-01-22 16:43:09 -06:00
BBaoVanC 8ef1e3840a
Change color when hovering over share buttons 2023-01-22 16:31:08 -06:00
BBaoVanC 629b3758b9
Change print button to an <a> to match the rest of the buttons
Also makes it have pointer cursor
2023-01-22 16:28:24 -06:00
BBaoVanC 9412906b4f
Make the left bar of blockquote lined up with rest of text 2023-01-22 16:26:43 -06:00
BBaoVanC f8cfad647f
Fix contrast of code block Copy button 2023-01-22 16:23:03 -06:00
BBaoVanC b200623dca
Fix keyboard accessibility of code block copy button 2023-01-22 16:22:51 -06:00
BBaoVanC 80f5994d96
Improve code block copy text
- Use JS to get it directly from the code block instead of needing a
  separate `pre.code-raw` to get it from. That makes it possible to:
- bashsession: Don't copy prompt or command output
2023-01-22 00:09:34 -06:00
BBaoVanC 342710a755
Reduce gap between elements in subsections list 2023-01-21 23:34:34 -06:00
BBaoVanC 8eb642dbc8
Remove <hr> separator before footer 2023-01-21 23:32:32 -06:00
16 changed files with 345 additions and 20 deletions

View File

@ -46,6 +46,7 @@
--text-gray-1: #919191; /* lch(60, 0, X) */
--link-0: #3a94fb; /* lch(60, 60, 270) */
--link-1: #4ea1ff; /* lch(65, 60, 270) -- out of sRGB */
--figure-border: #1f5593; /* lch(35, 40, 270) */
@ -116,6 +117,23 @@
/* Fonts */
@font-face {
/*font-family: Jost;*/
font-family: sans-serif;
font-display: swap;
font-style: normal;
src: url("/font/jost/Jost-VariableFont_wght.woff2") format("woff2");
}
@font-face {
/*font-family: JetBrainsMono;*/
font-family: monospace;
font-display: swap;
src: url("/font/jetbrainsmono/JetBrainsMono_wght.woff2") format("woff2");
}
/* Post layout (in list pages) */
.list-page-content {
display: flex;
@ -272,7 +290,7 @@
.sections {
display: flex;
flex-direction: column;
gap: 40px;
gap: 10px;
}
.section {
@ -423,16 +441,15 @@
justify-content: center;
}
.share-buttons button,
.share-buttons a {
background-color: var(--background-2);
color: var(--text-2);
padding: 4px;
border-radius: 8px;
}
.share-buttons button {
border: none;
.share-buttons a:hover {
background-color: var(--background-3);
color: var(--text-3);
}
.share-buttons svg {
@ -570,7 +587,9 @@ html {
body {
background-color: var(--background-0);
color: var(--text-0);
font-family: "Open Sans", "Noto Sans", sans-serif;
/*font-family: "Jost", "Open Sans", "Noto Sans", sans-serif;*/
font-family: sans-serif;
font-size: 16px;
margin: 20px;
max-width: 720px;
overflow-wrap: break-word;
@ -583,6 +602,7 @@ body {
}
footer {
margin-top: 20px;
text-align: center;
}
@ -630,6 +650,7 @@ a:hover {
blockquote {
border-left: 5px solid var(--background-2);
padding-left: 15px;
margin-left: 0;
}
hr {
@ -700,10 +721,12 @@ table.markdown {
}
.code-block > .code-header > .code-type {
border-top-left-radius: 8px;
font-family: monospace;
margin: auto 0;
}
/* 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 {
cursor: pointer;
}
@ -738,6 +761,12 @@ table.markdown {
overflow-wrap: break-word;
}
.code-block > .code-header > .code-type,
pre,
code {
/*font-family: JetBrainsMono;*/
font-size: 12px;
}
code {
border-radius: 5px;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,10 @@
# This is the official list of project authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS.txt file.
# See the latter for an explanation.
#
# Names should be added to this file as:
# Name or Organization <email address>
JetBrains <>
Philipp Nurullin <philipp.nurullin@jetbrains.com>
Konstantin Bulenkov <kb@jetbrains.com>

Binary file not shown.

View File

@ -0,0 +1,93 @@
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
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:
https://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Binary file not shown.

93
static/font/jost/OFL.txt Normal file
View File

@ -0,0 +1,93 @@
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 license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

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.