Compare commits
35 Commits
7a263ce2e5
...
b1b5408301
| Author | SHA1 | Date | |
|---|---|---|---|
| b1b5408301 | |||
| d206ed9f3e | |||
| 3da5952b87 | |||
| 28e3b5e1cf | |||
| 0d1e2e80eb | |||
| 19550ef1b2 | |||
| 2032e1cdc2 | |||
| 20217e0b97 | |||
| 0fa8fb35ec | |||
| 6b178bebcb | |||
| ea33963a77 | |||
| a5bb7577f3 | |||
| 676ea50de8 | |||
| 3b8d6c894a | |||
| cb73f4e7a5 | |||
| 7d26aeff65 | |||
| a70cc32441 | |||
| 3937ed4172 | |||
| 5e84ea2a06 | |||
| 312d0d37c6 | |||
| 5460d759b0 | |||
| 54e942c85f | |||
| 952502e690 | |||
| 388a4f1589 | |||
| 806d3a318f | |||
| b06b695653 | |||
| 4ff04221b0 | |||
| c5c57405b0 | |||
| 2beded7c14 | |||
| 2b7645a572 | |||
| 98a9d78273 | |||
| 0cdd2fbf64 | |||
| 431d4b0990 | |||
| 9536c9fb25 | |||
| 85ea55402e |
174
assets/scss/bergamot.scss
Normal file
174
assets/scss/bergamot.scss
Normal file
@@ -0,0 +1,174 @@
|
||||
@import "variables.scss";
|
||||
@import "mixins.scss";
|
||||
|
||||
.bergamot-exercise {
|
||||
counter-increment: bergamot-exercise;
|
||||
|
||||
.bergamot-root {
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
|
||||
.bergamot-exercise-label {
|
||||
.bergamot-exercise-number::after {
|
||||
content: "Exercise " counter(bergamot-exercise);
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.bergamot-button {
|
||||
@include bordered-block;
|
||||
padding: 0.25em;
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
background-color: inherit;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: 0.25s;
|
||||
font-family: $font-body;
|
||||
@include var(color, text-color);
|
||||
|
||||
&.bergamot-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.feather {
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.bergamot-play {
|
||||
.feather { color: $primary-color; }
|
||||
&:hover, &:focus {
|
||||
.feather { color: lighten($primary-color, 20%); }
|
||||
}
|
||||
}
|
||||
|
||||
.bergamot-reset {
|
||||
.feather { color: #0099CC; }
|
||||
&:hover, &:focus {
|
||||
.feather { color: lighten(#0099CC, 20%); }
|
||||
}
|
||||
|
||||
svg {
|
||||
fill: none;
|
||||
}
|
||||
}
|
||||
|
||||
.bergamot-close {
|
||||
.feather { color: tomato; }
|
||||
&:hover, &:focus {
|
||||
.feather { color: lighten(tomato, 20%); }
|
||||
}
|
||||
}
|
||||
|
||||
.bergamot-button-group {
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.bergamot-root {
|
||||
@include bordered-block;
|
||||
padding: 1em;
|
||||
|
||||
.bergamot-section-heading {
|
||||
margin-bottom: 0.5em;
|
||||
font-family: $font-body;
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.bergamot-section {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 10em;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
width: 100%;
|
||||
@include textual-input;
|
||||
}
|
||||
|
||||
.bergamot-rule-list {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.bergamot-rule-list katex-expression {
|
||||
margin-left: .5em;
|
||||
margin-right: .5em;
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
}
|
||||
|
||||
.bergamot-rule-section {
|
||||
.bergamot-rule-section-name {
|
||||
text-align: center;
|
||||
margin: 0.25em;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.bergamot-proof-tree {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.bergamot-error {
|
||||
@include bordered-block;
|
||||
padding: 0.5rem;
|
||||
border-color: tomato;
|
||||
background-color: rgba(tomato, 0.25);
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.bergamot-selector {
|
||||
button {
|
||||
@include var(background-color, background-color);
|
||||
@include var(color, text-color);
|
||||
@include bordered-block;
|
||||
padding: 0.5rem;
|
||||
font-family: $font-body;
|
||||
border-style: dotted;
|
||||
|
||||
&.active {
|
||||
border-color: $primary-color;
|
||||
border-style: solid;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&:not(:first-child) {
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
}
|
||||
|
||||
&:not(:last-child) {
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-right-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
button.active + button {
|
||||
border-left-color: $primary-color;
|
||||
border-left-style: solid;
|
||||
}
|
||||
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.bergamot-no-proofs {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,10 @@
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: $font-code;
|
||||
@include var(background-color, code-color);
|
||||
border: $code-border;
|
||||
padding: 0 0.25rem 0 0.25rem;
|
||||
font-family: $font-code;
|
||||
@include var(background-color, code-color);
|
||||
border: $code-border;
|
||||
padding: 0 0.25rem 0 0.25rem;
|
||||
}
|
||||
|
||||
pre code {
|
||||
@@ -40,12 +40,12 @@ pre code {
|
||||
margin-bottom: 1rem;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
border: none;
|
||||
color: inherit;
|
||||
border: none;
|
||||
|
||||
&:hover, &:focus {
|
||||
background-color: rgba($primary-color, 0.25);
|
||||
}
|
||||
&:hover, &:focus {
|
||||
background-color: rgba($primary-color, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
@@ -104,12 +104,10 @@ pre code {
|
||||
}
|
||||
|
||||
.kr, .kd, .k {
|
||||
font-weight: bold;
|
||||
@include var(color, code-keyword-color);
|
||||
}
|
||||
|
||||
.kt {
|
||||
font-weight: bold;
|
||||
@include var(color, code-type-color);
|
||||
}
|
||||
|
||||
|
||||
65
assets/scss/fonts.scss
Normal file
65
assets/scss/fonts.scss
Normal file
@@ -0,0 +1,65 @@
|
||||
@mixin font-inconsolata($weight) {
|
||||
@font-face {
|
||||
font-family: 'Inconsolata';
|
||||
font-display: swap;
|
||||
font-weight: $weight;
|
||||
src: local('Inconsolata'),
|
||||
url('../fonts/gen/Inconsolata-#{$weight}.woff2');
|
||||
}
|
||||
}
|
||||
|
||||
@mixin font-lora {
|
||||
@font-face {
|
||||
font-family: 'Lora';
|
||||
font-display: swap;
|
||||
src: local('Lora'),
|
||||
url('../fonts/gen/Lora-Regular.woff2'),
|
||||
url('../fonts/gen/Lora-Italic.woff2');
|
||||
}
|
||||
}
|
||||
|
||||
@mixin font-raleway($weight) {
|
||||
@font-face {
|
||||
font-family: 'Raleway';
|
||||
font-display: swap;
|
||||
font-weight: $weight;
|
||||
src: local('Raleway'),
|
||||
url('../fonts/gen/Raleway-#{$weight}.woff2'),
|
||||
url('../fonts/gen/Raleway-#{$weight}-Italic.woff2');
|
||||
}
|
||||
}
|
||||
|
||||
@mixin font-stixgeneral {
|
||||
@font-face {
|
||||
font-family: 'STIXGeneral';
|
||||
font-display: swap;
|
||||
src: local('STIXGeneral-Regular'),
|
||||
url('../fonts/STIXGeneral-Regular.ttf');
|
||||
}
|
||||
}
|
||||
|
||||
@include font-inconsolata(400);
|
||||
@include font-lora();
|
||||
@include font-raleway(400);
|
||||
@include font-raleway(700);
|
||||
@include font-stixgeneral();
|
||||
|
||||
/* Generated from chatgpt-adjust-fallback.py */
|
||||
|
||||
@font-face {
|
||||
font-family: "Raleway Fallback";
|
||||
src: local("Arial");
|
||||
size-adjust: 100.09%;
|
||||
ascent-override: 94.00%;
|
||||
descent-override: 23.40%;
|
||||
line-gap-override: 0.00%;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Lora Fallback";
|
||||
src: local("Times New Roman");
|
||||
size-adjust: 111.79%;
|
||||
ascent-override: 100.60%;
|
||||
descent-override: 27.40%;
|
||||
line-gap-override: 0.00%;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
}
|
||||
|
||||
@mixin below-container-width {
|
||||
@media screen and (max-width: $container-width-threshold){
|
||||
@media screen and (max-width: $container-width-threshold) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@@ -16,17 +16,17 @@
|
||||
}
|
||||
|
||||
@mixin textual-input {
|
||||
@include bordered-block;
|
||||
box-sizing: border-box;
|
||||
@include var(background-color, background-color);
|
||||
@include var(color, text-color);
|
||||
font-family: $font-body;
|
||||
padding: $input-padding;
|
||||
@include bordered-block;
|
||||
box-sizing: border-box;
|
||||
@include var(background-color, background-color);
|
||||
@include var(color, text-color);
|
||||
font-family: $font-body;
|
||||
padding: $input-padding;
|
||||
|
||||
&:active, &:focus {
|
||||
@include green-shadow;
|
||||
border-color: $primary-color;
|
||||
}
|
||||
&:active, &:focus {
|
||||
@include green-shadow;
|
||||
border-color: $primary-color;
|
||||
}
|
||||
|
||||
flex-grow: 1;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ input.stork-input {
|
||||
padding: $search-element-padding;
|
||||
}
|
||||
|
||||
.stork-message:not(:last-child), .stork-result {
|
||||
.stork-message:not(:last-child), .stork-result {
|
||||
border-bottom: $standard-border;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,169 +4,177 @@
|
||||
@import "modes.scss";
|
||||
|
||||
body {
|
||||
@include var(background-color, background-color);
|
||||
@include var(color, text-color);
|
||||
font-family: $font-body;
|
||||
font-size: 1.0rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 1rem;
|
||||
text-align: justify;
|
||||
@include var(background-color, background-color);
|
||||
@include var(color, text-color);
|
||||
font-family: $font-body;
|
||||
font-size: 1.0rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 1rem;
|
||||
text-align: justify;
|
||||
|
||||
@include below-container-width {
|
||||
text-align: left;
|
||||
}
|
||||
@include below-container-width {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-bottom: .1rem;
|
||||
margin-top: .5rem;
|
||||
font-family: $font-heading;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
margin-bottom: .1rem;
|
||||
margin-top: .5rem;
|
||||
font-family: $font-heading;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
|
||||
&:target {
|
||||
@include var(background-color, target-background-color);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
a {
|
||||
border-bottom: none;
|
||||
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
&:target {
|
||||
@include var(background-color, target-background-color);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
a {
|
||||
border-bottom: none;
|
||||
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
&:target {
|
||||
@include var(background-color, target-background-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
&:target {
|
||||
@include var(background-color, target-background-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
max-width: $container-width;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
max-width: $container-width;
|
||||
box-sizing: border-box;
|
||||
|
||||
@include below-container-width {
|
||||
padding: 0 $container-min-padding 0 $container-min-padding;
|
||||
margin: 0;
|
||||
max-width: $container-width + 2 * $container-min-padding;
|
||||
}
|
||||
@include below-container-width {
|
||||
padding: 0 $container-min-padding 0 $container-min-padding;
|
||||
margin: 0;
|
||||
max-width: $container-width + 2 * $container-min-padding;
|
||||
}
|
||||
|
||||
@include below-two-margins {
|
||||
left: -($margin-width + $margin-inner-offset + $margin-outer-offset)/2;
|
||||
}
|
||||
@include below-two-margins {
|
||||
left: -($margin-width + $margin-inner-offset + $margin-outer-offset) / 2;
|
||||
}
|
||||
|
||||
@include below-one-margin {
|
||||
left: 0;
|
||||
}
|
||||
@include below-one-margin {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.button, input[type="submit"] {
|
||||
@include var(color, text-color);
|
||||
padding: 0.5rem;
|
||||
border: 1px solid $primary-color;
|
||||
transition: color 0.25s, background-color 0.25s;
|
||||
text-align: left;
|
||||
.tag-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem 0.25rem;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
background-color: rgba($primary-color, 0.2);
|
||||
.tag {
|
||||
@include var(color, text-color);
|
||||
}
|
||||
padding: 0.5rem;
|
||||
border: 1px solid $primary-color;
|
||||
transition: color 0.25s, background-color 0.25s;
|
||||
text-align: left;
|
||||
display: block;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
background-color: rgba($primary-color, 0.2);
|
||||
@include var(color, text-color);
|
||||
}
|
||||
}
|
||||
|
||||
.input[type="text"], textarea {
|
||||
@include textual-input;
|
||||
@include textual-input;
|
||||
}
|
||||
|
||||
nav {
|
||||
width: 100%;
|
||||
margin: 0rem 0rem 1rem 0rem;
|
||||
width: 100%;
|
||||
margin: 0rem 0rem 1rem 0rem;
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
a {
|
||||
padding: 0.25rem 0.75rem 0.25rem .75rem;
|
||||
text-decoration: none;
|
||||
@include var(color, text-color);
|
||||
display: inline-block;
|
||||
border-bottom: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
a {
|
||||
padding: 0.25rem 0.75rem 0.25rem .75rem;
|
||||
text-decoration: none;
|
||||
@include var(color, text-color);
|
||||
display: inline-block;
|
||||
border-bottom: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.post-subscript {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.post-content {
|
||||
margin-top: .5rem;
|
||||
margin-top: .5rem;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 3.0rem;
|
||||
font-size: 3.0rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 2.6rem;
|
||||
font-size: 2.6rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 2.2rem;
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1.8rem;
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 1.4rem;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1.0rem;
|
||||
font-size: 1.0rem;
|
||||
}
|
||||
|
||||
a {
|
||||
@include var(color, text-color);
|
||||
text-decoration: none;
|
||||
border-bottom: .2rem solid $primary-color;
|
||||
@include var(color, text-color);
|
||||
text-decoration: none;
|
||||
border-bottom: .2rem solid $primary-color;
|
||||
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
transition: color 0.25s;
|
||||
}
|
||||
|
||||
&.external-link, &.same-page-link {
|
||||
.feather {
|
||||
fill: none;
|
||||
margin-left: 0.25rem;
|
||||
position: relative;
|
||||
top: 0.125em;
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
transition: color 0.25s;
|
||||
}
|
||||
|
||||
&.external-link, &.same-page-link {
|
||||
.feather {
|
||||
fill: none;
|
||||
margin-left: 0.25rem;
|
||||
position: relative;
|
||||
top: 0.125em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.draft-link {
|
||||
border-bottom: .2rem solid $border-color;
|
||||
border-bottom: .2rem solid $border-color;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
background-color: white;
|
||||
max-width: 100%;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
table {
|
||||
@@ -247,25 +255,25 @@ ul.post-list {
|
||||
|
||||
p.post-wordcount, p.post-status {
|
||||
text-align: center;
|
||||
margin-bottom: 0.6rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.series-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
margin-top: 1rem;
|
||||
font-size: 1.1rem;
|
||||
border-top: $standard-border;
|
||||
padding-top: 1rem;
|
||||
margin-top: 1rem;
|
||||
font-size: 1.1rem;
|
||||
border-top: $standard-border;
|
||||
padding-top: 1rem;
|
||||
|
||||
.feather {
|
||||
fill: none;
|
||||
flex-shrink: 0;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
.feather {
|
||||
fill: none;
|
||||
flex-shrink: 0;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,8 +317,8 @@ figure {
|
||||
}
|
||||
|
||||
&.fullwide {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,21 +338,20 @@ figure {
|
||||
That's because firefox reader mode doesn't play nice with them, and
|
||||
it seems to ignore all styles in <head>. Then, the inline style
|
||||
in <head> uses !important to restore the display of icons, but provides
|
||||
limited styling. Here, we finally apply the full extent of the feather
|
||||
styles.
|
||||
limited styling. Here, we finally apply the full extent of the feather styles.
|
||||
*/
|
||||
.feather {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
stroke: currentColor;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
fill: currentColor;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
stroke: currentColor;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.katex * {
|
||||
font-family: unset;
|
||||
font-family: unset;
|
||||
}
|
||||
|
||||
.block {
|
||||
@@ -356,7 +363,7 @@ figure {
|
||||
|
||||
.dialog {
|
||||
.message {
|
||||
max-width: 0.8*$container-width;
|
||||
max-width: 0.8 * $container-width;
|
||||
margin-top: 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -390,19 +397,18 @@ figure {
|
||||
flex-wrap: wrap;
|
||||
|
||||
.wrapper {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
|
||||
&.previous {
|
||||
justify-content: left;
|
||||
}
|
||||
&.previous {
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
&.next {
|
||||
justify-content: right;
|
||||
}
|
||||
&.next {
|
||||
justify-content: right;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
a, .ongoing-placeholder {
|
||||
@include bordered-block;
|
||||
padding: 0.5em 1em 0.5em 1em;
|
||||
@@ -412,16 +418,16 @@ figure {
|
||||
margin-top: 1em;
|
||||
|
||||
.feather {
|
||||
height: 1.25em;
|
||||
width: 1.25em;
|
||||
fill: none;
|
||||
&:first-child { margin-right: 0.5em; }
|
||||
&:last-child { margin-left: 0.5em; }
|
||||
height: 1.25em;
|
||||
width: 1.25em;
|
||||
fill: none;
|
||||
&:first-child { margin-right: 0.5em; }
|
||||
&:last-child { margin-left: 0.5em; }
|
||||
}
|
||||
}
|
||||
|
||||
.ongoing-placeholder {
|
||||
border-style: dashed;
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
div.title {
|
||||
@@ -470,3 +476,32 @@ blockquote {
|
||||
.early-navigation-wrapper {
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.side-by-side {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.side-by-side-item {
|
||||
flex-basis: 0;
|
||||
}
|
||||
|
||||
.internal-ref {
|
||||
text-decoration: underline;
|
||||
break-inside: avoid;
|
||||
|
||||
&:target {
|
||||
@include var(background-color, target-background-color);
|
||||
border-radius: 1rem;
|
||||
|
||||
.internal-ref-counter {
|
||||
@include var(background-color, target-background-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.internal-ref-counter {
|
||||
display: inline-block;
|
||||
border: $standard-border;
|
||||
border-radius: 0.5rem;
|
||||
padding: 0 0.25rem 0 0.25rem;
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ $background-color-dark: #1b1d1f;
|
||||
$standard-border-width: .075rem;
|
||||
$standard-border: $standard-border-width solid $border-color;
|
||||
|
||||
$font-heading: "Lora", serif;
|
||||
$font-body: "Raleway", serif;
|
||||
$font-code: "Inconsolata", monospace;
|
||||
$font-heading: "Lora", "Lora Fallback", serif;
|
||||
$font-body: "Raleway", "Raleway Fallback", sans-serif;
|
||||
$font-code: "Inconsolata", monospace, "STIXGeneral";
|
||||
|
||||
$warning-background-color: #ffee99;
|
||||
$warning-border-color: #f5c827;
|
||||
@@ -23,7 +23,7 @@ $target-background-color-dark: #55511c;
|
||||
|
||||
$code-color: #f0f0f0;
|
||||
$code-color-dark: lighten($background-color-dark, 10%);
|
||||
$code-token-color: black;
|
||||
$code-token-color: darken($primary-color, 25%);
|
||||
$code-token-color-dark: $primary-color;
|
||||
$code-highlight-color: #fffd99;
|
||||
$code-highlight-color-dark: #555538;
|
||||
|
||||
47
assets/scss/writing.scss
Normal file
47
assets/scss/writing.scss
Normal file
@@ -0,0 +1,47 @@
|
||||
@import "variables.scss";
|
||||
|
||||
body {
|
||||
background-color: #1c1e26;
|
||||
--text-color: white;
|
||||
font-family: $font-code;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
text-align: left;
|
||||
font-family: $font-code;
|
||||
}
|
||||
|
||||
h1::after {
|
||||
content: "(writing)";
|
||||
font-size: 1rem;
|
||||
margin-left: 0.5em;
|
||||
position: relative;
|
||||
bottom: -0.5em;
|
||||
color: $primary-color;
|
||||
}
|
||||
|
||||
nav .container {
|
||||
justify-content: flex-start;
|
||||
|
||||
a {
|
||||
padding-left: 0;
|
||||
margin-right: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.header-divider {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
hr {
|
||||
height: auto;
|
||||
border: none;
|
||||
|
||||
&::after {
|
||||
content: "* * *";
|
||||
color: $primary-color;
|
||||
font-size: 2rem;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
115
banner.svg
Normal file
115
banner.svg
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="297mm"
|
||||
height="210mm"
|
||||
viewBox="0 0 297 210"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.4.2 (ebf0e940, 2025-05-08)"
|
||||
sodipodi:docname="banner.svg"
|
||||
inkscape:export-filename="banner-source.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="1.7079029"
|
||||
inkscape:cx="501.78498"
|
||||
inkscape:cy="465.77591"
|
||||
inkscape:window-width="1728"
|
||||
inkscape:window-height="996"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="38"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:export-bgcolor="#ffffffff" />
|
||||
<defs
|
||||
id="defs1">
|
||||
<rect
|
||||
x="49.549049"
|
||||
y="153.15161"
|
||||
width="826.85009"
|
||||
height="237.77854"
|
||||
id="rect8" />
|
||||
<rect
|
||||
x="49.549049"
|
||||
y="111.10999"
|
||||
width="678.67182"
|
||||
height="524.01873"
|
||||
id="rect7" />
|
||||
<rect
|
||||
x="244.20348"
|
||||
y="346.16049"
|
||||
width="287.95187"
|
||||
height="438.00638"
|
||||
id="rect4" />
|
||||
<rect
|
||||
x="244.20348"
|
||||
y="346.16049"
|
||||
width="414.25137"
|
||||
height="418.77991"
|
||||
id="rect4-6" />
|
||||
<rect
|
||||
x="244.20348"
|
||||
y="346.16049"
|
||||
width="414.25137"
|
||||
height="418.77991"
|
||||
id="rect4-6-1" />
|
||||
</defs>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<circle
|
||||
style="fill:#36e281;fill-opacity:1;stroke:#36e281;stroke-width:4.33532;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path3"
|
||||
cy="91.614052"
|
||||
cx="148.5"
|
||||
r="36.96402" />
|
||||
<path
|
||||
id="path3-3-6"
|
||||
style="fill:#ffffff;stroke:#36e281;stroke-width:4.33532;stroke-dasharray:none;stroke-opacity:1;stroke-linecap:round"
|
||||
d="m 148.49869,128.57807 c -13.20597,0 -25.40879,-7.0453 -32.01177,-18.48201 -6.60299,-11.436707 -6.60299,-25.527312 0,-36.964017 6.60298,-11.436705 18.8058,-18.482007 32.01177,-18.482007"
|
||||
sodipodi:nodetypes="cssc" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
transform="matrix(-0.15711337,0,0,0.19685436,189.77821,-5.4885608)"
|
||||
id="text4-3"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:253.455px;font-family:Helvetica;-inkscape-font-specification:'Helvetica Bold';text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect4-6);display:inline;fill:#36e281;fill-opacity:1;stroke:#36e281;stroke-width:1.37953;stroke-opacity:1"><tspan
|
||||
x="244.20312"
|
||||
y="584.4805"
|
||||
id="tspan5">D</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
transform="matrix(0.15711337,0,0,0.19685436,107.21917,-5.5129228)"
|
||||
id="text4-3-2"
|
||||
style="font-size:253.455px;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect4-6-1);display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.37953;stroke-opacity:1"><tspan
|
||||
x="244.20312"
|
||||
y="584.4805"
|
||||
id="tspan7"><tspan
|
||||
style="font-weight:bold;font-family:Helvetica;-inkscape-font-specification:'Helvetica Bold'"
|
||||
id="tspan6">F</tspan></tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
transform="matrix(0.19664896,0,0,0.19664896,73.930049,102.60811)"
|
||||
id="text8"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:106.667px;font-family:Lora;-inkscape-font-specification:'Lora Bold';text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect8);display:inline;fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:22.046"><tspan
|
||||
x="49.548828"
|
||||
y="250.31931"
|
||||
id="tspan8">Daniel's Blog</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
90
chatgpt-adjust-fallback.py
Normal file
90
chatgpt-adjust-fallback.py
Normal file
@@ -0,0 +1,90 @@
|
||||
"""
|
||||
Generate @font-face settings to help make the fallback font look similar
|
||||
to the non-fallback font.
|
||||
|
||||
Genererated by ChatGTP 5.2-instant. Not human-modified.
|
||||
"""
|
||||
|
||||
from fontTools.ttLib import TTFont
|
||||
|
||||
USE_TYPO_METRICS = 1 << 7
|
||||
|
||||
def get_metrics(path):
|
||||
font = TTFont(path)
|
||||
|
||||
head = font["head"]
|
||||
os2 = font["OS/2"]
|
||||
hhea = font["hhea"]
|
||||
|
||||
use_typo = bool(os2.fsSelection & USE_TYPO_METRICS)
|
||||
|
||||
if use_typo:
|
||||
asc = os2.sTypoAscender
|
||||
desc = os2.sTypoDescender
|
||||
gap = os2.sTypoLineGap
|
||||
source = "OS/2.sTypo*"
|
||||
else:
|
||||
asc = hhea.ascent
|
||||
desc = -hhea.descent
|
||||
gap = hhea.lineGap
|
||||
source = "hhea.*"
|
||||
|
||||
# x-height ALWAYS comes from OS/2
|
||||
if not hasattr(os2, "sxHeight") or os2.sxHeight <= 0:
|
||||
raise ValueError(f"{path} has no usable sxHeight")
|
||||
|
||||
x_height = os2.sxHeight
|
||||
|
||||
print("Source", path, source)
|
||||
|
||||
return {
|
||||
"unitsPerEm": head.unitsPerEm,
|
||||
"ascender": asc,
|
||||
"descender": desc,
|
||||
"lineGap": gap,
|
||||
"xHeight": x_height,
|
||||
}
|
||||
|
||||
def compute_overrides(target, fallback):
|
||||
# size-adjust: match x-height
|
||||
size_adjust = (
|
||||
(target["xHeight"] / target["unitsPerEm"]) /
|
||||
(fallback["xHeight"] / fallback["unitsPerEm"])
|
||||
)
|
||||
|
||||
# overrides: force target vertical metrics
|
||||
ascent_override = target["ascender"] / target["unitsPerEm"]
|
||||
descent_override = abs(target["descender"]) / target["unitsPerEm"]
|
||||
line_gap_override = target["lineGap"] / target["unitsPerEm"]
|
||||
|
||||
return {
|
||||
"size_adjust": size_adjust * 100,
|
||||
"ascent_override": ascent_override * 100,
|
||||
"descent_override": descent_override * 100,
|
||||
"line_gap_override": line_gap_override * 100,
|
||||
}
|
||||
|
||||
def emit_css(family_name, local_name, values):
|
||||
return f"""
|
||||
@font-face {{
|
||||
font-family: "{family_name}";
|
||||
src: local("{local_name}");
|
||||
size-adjust: {values['size_adjust']:.2f}%;
|
||||
ascent-override: {values['ascent_override']:.2f}%;
|
||||
descent-override: {values['descent_override']:.2f}%;
|
||||
line-gap-override: {values['line_gap_override']:.2f}%;
|
||||
}}
|
||||
""".strip()
|
||||
|
||||
# ---- Example usage ----
|
||||
|
||||
target = get_metrics("static/fonts/gen/Lora-Regular.woff2")
|
||||
fallback = get_metrics("/System/Library/Fonts/Supplemental/Times New Roman.ttf")
|
||||
|
||||
values = compute_overrides(target, fallback)
|
||||
|
||||
print(emit_css(
|
||||
family_name="Lora Fallback",
|
||||
local_name="Times New Roman",
|
||||
values=values,
|
||||
))
|
||||
69
chatgpt-instance-fonts.py
Normal file
69
chatgpt-instance-fonts.py
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Instantiate variable fonts at specific weights/styles, producing static TTF files.
|
||||
No subsetting, no recursive searching—just direct calls with hardcoded axis values.
|
||||
Requires fontTools >= 4.0.
|
||||
|
||||
Genererated by ChatGTP o3-mini-high. Not human-modified.
|
||||
"""
|
||||
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.varLib.instancer import instantiateVariableFont
|
||||
|
||||
def instantiate_variable_font(input_font_path, axis_values, output_font_path):
|
||||
"""
|
||||
1) Loads a variable font from `input_font_path`.
|
||||
2) Instantiates (flattens) it at the specified axis values (e.g. {"wght": 400}).
|
||||
3) Saves the result as a static TTF at `output_font_path`.
|
||||
"""
|
||||
print(f"Instantiating {input_font_path} with axes={axis_values} -> {output_font_path}")
|
||||
vf = TTFont(input_font_path)
|
||||
static_font = instantiateVariableFont(vf, axis_values)
|
||||
static_font.flavor = "woff2"
|
||||
static_font.save(output_font_path)
|
||||
|
||||
def main():
|
||||
# Inconsolata (Variable)
|
||||
instantiate_variable_font(
|
||||
"Inconsolata-VariableFont_wdth,wght.ttf",
|
||||
{"wght": 400},
|
||||
"Inconsolata-400.woff2"
|
||||
)
|
||||
|
||||
# Lora (Variable, normal and italic)
|
||||
instantiate_variable_font(
|
||||
"Lora-VariableFont_wght.ttf",
|
||||
{"wght": 400},
|
||||
"Lora-Regular.woff2"
|
||||
)
|
||||
instantiate_variable_font(
|
||||
"Lora-Italic-VariableFont_wght.ttf",
|
||||
{"wght": 400},
|
||||
"Lora-Italic.woff2"
|
||||
)
|
||||
|
||||
# Raleway (Variable, normal and italic)
|
||||
instantiate_variable_font(
|
||||
"Raleway-VariableFont_wght.ttf",
|
||||
{"wght": 400},
|
||||
"Raleway-400.woff2"
|
||||
)
|
||||
instantiate_variable_font(
|
||||
"Raleway-VariableFont_wght.ttf",
|
||||
{"wght": 700},
|
||||
"Raleway-700.woff2"
|
||||
)
|
||||
instantiate_variable_font(
|
||||
"Raleway-Italic-VariableFont_wght.ttf",
|
||||
{"wght": 400},
|
||||
"Raleway-400-Italic.woff2"
|
||||
)
|
||||
instantiate_variable_font(
|
||||
"Raleway-Italic-VariableFont_wght.ttf",
|
||||
{"wght": 700},
|
||||
"Raleway-700-Italic.woff2"
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
13
config.toml
13
config.toml
@@ -1,7 +1,8 @@
|
||||
[params]
|
||||
katexCssUrl = "//static.danilafe.com/katex/katex.min.css"
|
||||
katexJsUrl = "//static.danilafe.com/katex/katex.min.js"
|
||||
normalizeCssUrl = "//static.danilafe.com/normalize/normalize.css"
|
||||
visNetworkJsUrl = "//static.danilafe.com/vis-network/vis-network.min.js"
|
||||
bergamotJsUrl = "//static.danilafe.com/bergamot/bergamot.js"
|
||||
bergamotObjectLanguageJsUrl = "//static.danilafe.com/bergamot/objectlang.js"
|
||||
katexCssUrl = "https://static.danilafe.com/katex/katex.min.css"
|
||||
katexJsUrl = "https://static.danilafe.com/katex/katex.min.js"
|
||||
normalizeCssUrl = "https://static.danilafe.com/normalize/normalize.css"
|
||||
visNetworkJsUrl = "https://static.danilafe.com/vis-network/vis-network.min.js"
|
||||
bergamotJsUrl = "https://static.danilafe.com/bergamot/bergamot.js"
|
||||
bergamotObjectLanguageJsUrl = "https://static.danilafe.com/bergamot/objectlang.js"
|
||||
images = ["banner.png"]
|
||||
|
||||
27
i18n/en.toml
27
i18n/en.toml
@@ -77,3 +77,30 @@
|
||||
|
||||
[ongoingSeries]
|
||||
other = "Ongoing"
|
||||
|
||||
[nextInSeries]
|
||||
other = "Next in Series"
|
||||
|
||||
[previousInSeries]
|
||||
other = "Previous in Series"
|
||||
|
||||
[comingSoon]
|
||||
other = "Coming soon!"
|
||||
|
||||
[startBergamot]
|
||||
other = "Start Bergamot"
|
||||
|
||||
[closeBergamot]
|
||||
other = "Close Bergamot"
|
||||
|
||||
[lineX]
|
||||
other = ", line {{ . }}"
|
||||
|
||||
[aroundLineX]
|
||||
other = ", around line {{ . }}"
|
||||
|
||||
[linesXThroughY]
|
||||
other = ", lines {{ .from }} through {{ .to }}"
|
||||
|
||||
[entireFile]
|
||||
other = ", entire file"
|
||||
|
||||
9
layouts/_markup/render-blockquote.html
Normal file
9
layouts/_markup/render-blockquote.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ if and (eq .Type "alert") (eq .AlertType "todo") -}}
|
||||
<div style="background-color: tomato; color: white; padding: 10px;">
|
||||
<em>TODO: </em>{{- .Text | plainify -}}
|
||||
</div>
|
||||
{{- else -}}
|
||||
<blockquote {{- with .Attributes.id }} id="{{ . }}"{{ end }}>
|
||||
{{ .Text -}}
|
||||
</blockquote>
|
||||
{{- end }}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- .Page.Scratch.SetInMap "definedSections" (printf "#%s" .Anchor) true -}}
|
||||
{{- .Page.Store.SetInMap "definedSections" (printf "#%s" .Anchor) true -}}
|
||||
<a href="#{{ .Anchor }}">
|
||||
<h{{ .Level }} id="{{ .Anchor }}">
|
||||
{{- .Text | safeHTML -}}
|
||||
@@ -1,24 +1,25 @@
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- $class := "" -}}
|
||||
{{- $icon := "" -}}
|
||||
{{- $absoluteDest := absLangURL .Destination -}}
|
||||
{{- $siteRootUrl := absLangURL "" -}}
|
||||
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
|
||||
{{- $isSamePage := hasPrefix .Destination "#" -}}
|
||||
|
||||
{{- if $isSamePage -}}
|
||||
{{- $scratch.Set "class" "same-page-link" -}}
|
||||
{{- if index (.Page.Scratch.Get "definedSections") .Destination -}}
|
||||
{{- $scratch.Set "icon" "arrow-up" -}}
|
||||
{{- $class = "same-page-link" -}}
|
||||
{{- if index (.Page.Store.Get "definedSections") .Destination -}}
|
||||
{{- $icon = "arrow-up" -}}
|
||||
{{- else -}}
|
||||
{{- /* Do not render "down" links because don't know how to distinguish unseen titles from paragraph links. */ -}}
|
||||
{{- /* $scratch.Set "icon" "arrow-down" */ -}}
|
||||
{{- /* $icon = "arrow-down" */ -}}
|
||||
{{- end -}}
|
||||
{{- else if $isExternal -}}
|
||||
{{- $scratch.Set "class" "external-link" -}}
|
||||
{{- $scratch.Set "icon" "external-link" -}}
|
||||
{{- $class = "external-link" -}}
|
||||
{{- $icon = "external-link" -}}
|
||||
{{- end -}}
|
||||
<a href="{{ .Destination | safeURL }}"
|
||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||
{{- with $scratch.Get "class" -}}
|
||||
{{- with $class -}}
|
||||
class="{{ . }}"
|
||||
{{- end -}}
|
||||
{{- if (and site.Params.externalLinksInNewTab $isExternal) -}}
|
||||
@@ -26,6 +27,6 @@
|
||||
{{- end -}}
|
||||
>
|
||||
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
||||
{{- with $scratch.Get "icon" -}}{{- partial "icon.html" . -}}{{- end -}}
|
||||
{{- with $icon -}}{{- partial "icon.html" . -}}{{- end -}}
|
||||
</a>
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
@@ -11,7 +11,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
"Languge Term": { "custom": "Bergamot Object Language" },
|
||||
"Language Term": { "custom": "Bergamot Object Language" },
|
||||
"Query": "query",
|
||||
{{ end }}
|
||||
}
|
||||
2
layouts/_partials/defercss.html
Normal file
2
layouts/_partials/defercss.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<link rel="preload" href="{{ .url }}" as="style" onload="this.onload=null;this.rel='stylesheet'"{{ with .integrity }} integrity="{{ . }}"{{ end }}{{ with .extra }} {{ . | safeHTMLAttr }}{{ end }}>
|
||||
<noscript><link rel="stylesheet" href="{{ .url }}"{{ with .integrity }} integrity="{{ . }}"{{ end }}></noscript>
|
||||
26
layouts/_partials/geturl.html
Normal file
26
layouts/_partials/geturl.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- $siteSourceUrl := site.Params.siteSourceUrl -}}
|
||||
{{- $submoduleLinks := hugo.Data.submodules -}}
|
||||
{{- $hostData := hugo.Data.hosts -}}
|
||||
{{- $lines := .lines -}}
|
||||
{{- $bestLength := -1 -}}
|
||||
{{- $bestUrl := printf "%s/code/%s" $siteSourceUrl .path -}}
|
||||
{{- $bestPath := "" -}}
|
||||
{{- $filePath := .path -}}
|
||||
{{- range $path, $url := $submoduleLinks -}}
|
||||
{{- if and (le $bestLength (len $path)) (hasPrefix $filePath $path) -}}
|
||||
{{- $bestLength = len $path -}}
|
||||
{{- $bestPath = $path -}}
|
||||
{{- $bestUrl = printf "%s%s" $url (strings.TrimPrefix $path $filePath) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if .lines -}}
|
||||
{{- /* If the user provided a line range, see if we can tack it on to the end of the link. */ -}}
|
||||
{{- range $host, $data := $hostData -}}
|
||||
{{- if hasPrefix $bestUrl $host -}}
|
||||
{{- with $data.linesSuffix -}}
|
||||
{{- $bestUrl = add $bestUrl (printf . (index $lines 0) (index $lines 1)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- return (dict "url" $bestUrl "basePath" $bestPath) -}}
|
||||
@@ -1,4 +1,3 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#1dc868">
|
||||
@@ -15,7 +14,8 @@
|
||||
|
||||
<!-- Fonts -->
|
||||
{{ if not (.Site.Params.noCss) }}
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&family=Raleway:wght@400;700&family=Lora&display=block" media="screen">
|
||||
{{ $fonts := resources.Get "scss/fonts.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $fonts.Permalink }}" integrity="{{ $fonts.Data.Integrity }}" media="screen">
|
||||
{{ end }}
|
||||
|
||||
<!-- External CSS (normalize and KaTeX -->
|
||||
@@ -30,24 +30,32 @@
|
||||
{{ end -}}
|
||||
|
||||
<!-- In-house CSS -->
|
||||
{{ $style := resources.Get "scss/style.scss" | resources.ToCSS | resources.Minify }}
|
||||
{{ $sidenotes := resources.Get "scss/sidenotes.scss" | resources.ToCSS | resources.Minify }}
|
||||
{{ $code := resources.Get "scss/code.scss" | resources.ToCSS | resources.Minify }}
|
||||
{{ $icon := resources.Get "img/favicon.png" }}
|
||||
{{ $style := resources.Get "scss/style.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
|
||||
{{ $sidenotes := resources.Get "scss/sidenotes.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
|
||||
{{ $code := resources.Get "scss/code.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
|
||||
{{ $icon := resources.Get "img/favicon.png" | resources.Fingerprint }}
|
||||
<style>.feather { display: inline !important; width: 10px; height: 10px; }</style>
|
||||
<style>img { max-width: 70%; }</style>
|
||||
{{ if not (.Site.Params.noCss) }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
{{ partial "defercss.html" (dict "url" $sidenotes.Permalink "extra" "") }}
|
||||
{{ partial "defercss.html" (dict "url" $code.Permalink "extra" "") }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">
|
||||
{{ partial "defercss.html" (dict "url" $sidenotes.Permalink "integrity" $sidenotes.Data.Integrity "extra" "") }}
|
||||
{{ partial "defercss.html" (dict "url" $code.Permalink "integrity" $code.Data.Integrity "extra" "") }}
|
||||
{{ end }}
|
||||
<link rel="icon" type="image/png" href="{{ $icon.Permalink }}">
|
||||
<link rel="icon" type="image/png" href="{{ $icon.Permalink }}" integrity="{{ $icon.Data.Integrity }}">
|
||||
|
||||
{{ if .Params.custom_js }}
|
||||
{{ range $customJs := .Params.custom_js }}
|
||||
<script src="{{ page.Resources.Get $customJs }}"></script>
|
||||
{{ with page.Resources.Get $customJs }}
|
||||
{{ $customJsResource := . | resources.Fingerprint }}
|
||||
<script src="{{ $customJsResource.Permalink }}" integrity="{{ $customJsResource.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "opengraph.html" . }}
|
||||
{{ partial "twitter_cards.html" . }}
|
||||
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
|
||||
{{ if hugo.IsServer }}
|
||||
<!-- KaTeX auto-rendering for when we don't have a post-processing step. -->
|
||||
@@ -57,16 +65,18 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.bergamot }}
|
||||
<!-- Ensure later scripts keep the KaTeX CSS even if the page has no LaTeX !-->
|
||||
<meta name="needs-latex">
|
||||
<!-- Code to support the Bergamot JS widget -->
|
||||
<script defer src="{{ .Site.Params.katexJsUrl }}" crossorigin="anonymous"></script>
|
||||
{{ $katexComponentJs := resources.Get "js/katex-component.js" | resources.Minify }}
|
||||
<script defer src="{{ $katexComponentJs.Permalink }}"></script>
|
||||
{{ $katexComponentJs := resources.Get "js/katex-component.js" | resources.Minify | resources.Fingerprint }}
|
||||
<script defer src="{{ $katexComponentJs.Permalink }}" integrity="{{ $katexComponentJs.Data.Integrity }}"></script>
|
||||
<script defer src="{{ .Site.Params.bergamotJsUrl }}"></script>
|
||||
<script defer src="{{ .Site.Params.bergamotObjectLanguageJsUrl }}"></script>
|
||||
{{ $bergamotHelpers := resources.Get "js/bergamot-helpers.js" | resources.Minify }}
|
||||
<script defer src="{{ $bergamotHelpers.Permalink }}"></script>
|
||||
{{ $bergamotStyle := resources.Get "scss/bergamot.scss" | resources.ToCSS | resources.Minify }}
|
||||
{{ partial "defercss.html" (dict "url" $bergamotStyle.Permalink "extra" "") }}
|
||||
{{ $bergamotHelpers := resources.Get "js/bergamot-helpers.js" | resources.Minify | resources.Fingerprint }}
|
||||
<script defer src="{{ $bergamotHelpers.Permalink }}" integrity="{{ $bergamotHelpers.Data.Integrity }}"></script>
|
||||
{{ $bergamotStyle := resources.Get "scss/bergamot.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
|
||||
{{ partial "defercss.html" (dict "url" $bergamotStyle.Permalink "integrity" $bergamotStyle.Data.Integrity "extra" "") }}
|
||||
{{ if .Params.bergamot.render_presets }}
|
||||
{{ range $name, $rulefile := .Params.bergamot.render_presets }}
|
||||
{{ $file := default (resources.Get $rulefile) (page.Resources.Get $rulefile) }}
|
||||
@@ -95,4 +105,3 @@
|
||||
{{ end }}
|
||||
|
||||
<title>{{ .Title }}</title>
|
||||
</head>
|
||||
11
layouts/_partials/highlightgroup.html
Normal file
11
layouts/_partials/highlightgroup.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- $highlightGroupAttrs := (printf "data-base-path=\"%s\" data-file-path=\"%v\"" .basePath .path) -}}
|
||||
{{- if (or .firstLine .lastLine) -}}
|
||||
{{- $highlightGroupAttrs = add $highlightGroupAttrs (printf " data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
|
||||
{{- end -}}
|
||||
{{- if eq (lower .language) "agda" -}}
|
||||
{{- $highlightGroupAttrs = add $highlightGroupAttrs " data-agda-block" -}}
|
||||
{{- end -}}
|
||||
{{- with .offset -}}
|
||||
{{- $highlightGroupAttrs = add $highlightGroupAttrs (printf " data-source-offset=\"%v\"" .) -}}
|
||||
{{- end -}}
|
||||
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" $highlightGroupAttrs) }}
|
||||
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
9
layouts/_partials/linerangestr.html
Normal file
9
layouts/_partials/linerangestr.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- $comment := "" -}}
|
||||
{{- if eq .from .to -}}
|
||||
{{- $comment = i18n "lineX" .to -}}
|
||||
{{- else if eq .from 0 -}}
|
||||
{{- $comment = i18n "aroundLineX" .to -}}
|
||||
{{- else -}}
|
||||
{{- $comment = i18n "linesXThroughY" . -}}
|
||||
{{- end -}}
|
||||
{{- return $comment -}}
|
||||
@@ -1,8 +1,8 @@
|
||||
{{- $term := index (.page.GetTerms "series") 0 -}}
|
||||
{{- $divider := $term.Params.divider -}}
|
||||
{{- $name := .page.Title -}}
|
||||
{{- if (and $divider (strings.Contains .page.Title $divider)) -}}
|
||||
{{- $rest := after 1 (split .page.Title $divider) -}}
|
||||
{{- .scratch.Set "name" (delimit $rest $divider) -}}
|
||||
{{- else -}}
|
||||
{{- .scratch.Set "name" .page.Title -}}
|
||||
{{- $name = delimit $rest $divider -}}
|
||||
{{- end -}}
|
||||
{{- return $name -}}
|
||||
@@ -1,11 +1,9 @@
|
||||
<li>
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- $name := .page.Title -}}
|
||||
{{- if .seriesName -}}
|
||||
{{- partial "nameinseries" (dict "page" .page "scratch" $scratch) -}}
|
||||
{{- else -}}
|
||||
{{- $scratch.Set "name" (.page.Title) -}}
|
||||
{{- $name = partial "nameinseries" (dict "page" .page) -}}
|
||||
{{- end -}}
|
||||
<a href="{{ .page.Permalink }}" class="post-title">{{ if .page.Params.favorite }}{{ partial "icon.html" "star" }}{{ end }} {{ $scratch.Get "name" }}</a>
|
||||
<a href="{{ .page.Permalink }}" class="post-title">{{ if .page.Params.favorite }}{{ partial "icon.html" "star" }}{{ end }} {{ $name }}</a>
|
||||
{{ if (not (eq .page.WordCount 0)) }}
|
||||
<p class="post-wordcount">{{ i18n "nWords" .page.WordCount }}, {{ i18n "nMinutesToRead" .page.ReadingTime }}.</p>
|
||||
{{ end }}
|
||||
@@ -14,14 +12,16 @@
|
||||
{{ partial "seriesstatus.html" .page.Params.status }}
|
||||
</p>
|
||||
{{ end }}
|
||||
<p class="post-preview">{{ .page.Summary }} {{ if .page.Truncated }}...{{ end }}</p>
|
||||
<p class="post-preview">{{ partial "summary" .page }}</p>
|
||||
{{- if .linkSeries -}}
|
||||
{{- $term := index (.page.GetTerms "series") 0 -}}
|
||||
{{- with $term -}}
|
||||
{{- if (not ($term.Param "donotunique")) -}}
|
||||
<div class="series-link">
|
||||
{{- partial "icon.html" "corner-down-right" -}}
|
||||
<p>{{- i18n "latestInSeries" }} <a href="{{ $term.Permalink }}">{{ $term.Title }}</a></p>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</li>
|
||||
@@ -2,10 +2,8 @@
|
||||
<a href="{{ .page.RelPermalink }}">
|
||||
{{ if eq .direction "previous" }}{{ partial "icon.html" "chevrons-left" }}{{ end }}
|
||||
<div class="title-subtitle">
|
||||
{{ title .direction }} in Series
|
||||
{{ $scratch := newScratch -}}
|
||||
{{- partial "nameinseries.html" (dict "page" .page "scratch" $scratch) -}}
|
||||
<div class="title">{{ $scratch.Get "name" }}</div>
|
||||
{{ i18n (printf "%sInSeries" .direction) }}
|
||||
<div class="title">{{ partial "nameinseries.html" (dict "page" .page) }}</div>
|
||||
</div>
|
||||
{{ if eq .direction "next" }}{{ partial "icon.html" "chevrons-right" }}{{ end }}
|
||||
</a>
|
||||
@@ -2,8 +2,8 @@
|
||||
<div class="ongoing-placeholder">
|
||||
{{ if eq .direction "previous" }}{{ partial "icon.html" "chevrons-left" }}{{ end }}
|
||||
<div class="title-subtitle">
|
||||
{{ title .direction }} in Series
|
||||
<div class="title">Coming soon!</div>
|
||||
{{ i18n (printf "%sInSeries" .direction) }}
|
||||
<div class="title">{{ i18n "comingSoon" }}</div>
|
||||
</div>
|
||||
{{ if eq .direction "next" }}{{ partial "icon.html" "chevrons-right" }}{{ end }}
|
||||
</div>
|
||||
5
layouts/_partials/summary.html
Normal file
5
layouts/_partials/summary.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- if .Params.summary -}}
|
||||
{{ .Params.summary | markdownify | plainify }}
|
||||
{{- else -}}
|
||||
{{ .Summary | plainify | truncate 180 }}
|
||||
{{- end -}}
|
||||
@@ -1,14 +1,14 @@
|
||||
{{- $scratch := .scratch -}}
|
||||
{{- $scratch.Set "pages" slice -}}
|
||||
{{- $pages := slice -}}
|
||||
{{- $tmpScratch := newScratch -}}
|
||||
{{- range $post := (where (where site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") -}}
|
||||
{{- $term := index ($post.GetTerms "series") 0 -}}
|
||||
{{- if $term -}}
|
||||
{{- if (and $term (not ($term.Param "donotunique"))) -}}
|
||||
{{- if not ($tmpScratch.Get $term.Permalink) -}}
|
||||
{{- $tmpScratch.Set $term.Permalink true -}}
|
||||
{{- $scratch.Add "pages" $post -}}
|
||||
{{- $pages = $pages | append $post -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $scratch.Add "pages" $post -}}
|
||||
{{- $pages = $pages | append $post -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- return $pages -}}
|
||||
@@ -11,8 +11,8 @@
|
||||
<div class="bergamot-button-group">
|
||||
{{ if or (eq (.Get "preset") "") (eq (.Get "preset") nil) }}
|
||||
{{ else }}
|
||||
<button class="bergamot-button bergamot-play" onclick='window.Bergamot.runPreset(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}", "{{ .Get "preset" }}")'>{{ partial "icon.html" "play" }}Start Bergamot</button>
|
||||
<button class="bergamot-button bergamot-close bergamot-hidden" onclick='window.Bergamot.close(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}")'>{{ partial "icon.html" "x" }}Close Bergamot</button>
|
||||
<button class="bergamot-button bergamot-play" onclick='window.Bergamot.runPreset(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}", "{{ .Get "preset" }}")'>{{ partial "icon.html" "play" }}{{ i18n "startBergamot" }}</button>
|
||||
<button class="bergamot-button bergamot-close bergamot-hidden" onclick='window.Bergamot.close(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}")'>{{ partial "icon.html" "x" }}{{ i18n "closeBergamot" }}</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
11
layouts/_shortcodes/codeblock.html
Normal file
11
layouts/_shortcodes/codeblock.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- $url := partial "geturl.html" (dict "path" (.Get 1)) -}}
|
||||
{{- $groupconfig := dict
|
||||
"url" $url.url
|
||||
"basePath" $url.basePath
|
||||
"path" (.Get 1)
|
||||
"comment" (i18n "entireFile")
|
||||
"code" (readFile (printf "code/%s" (.Get 1)))
|
||||
"language" (.Get 0)
|
||||
"opts" "linenos=table"
|
||||
-}}
|
||||
{{- partial "highlightgroup.html" $groupconfig -}}
|
||||
59
layouts/_shortcodes/codelines.html
Normal file
59
layouts/_shortcodes/codelines.html
Normal file
@@ -0,0 +1,59 @@
|
||||
{{- $source := (readFile (printf "code/%s" (.Get 1))) -}}
|
||||
{{- $allLines := split $source "\n" -}}
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- $remLines := $allLines -}}
|
||||
{{- if not (eq (int (.Get 2)) 1) -}}
|
||||
{{- $remLines = after (sub (int (.Get 2)) 1) $allLines -}}
|
||||
{{- end -}}
|
||||
{{- $lines := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) $remLines -}}
|
||||
|
||||
{{- $opts := "" -}}
|
||||
{{- if (.Get 4) -}}
|
||||
{{- $opts = printf ",%s" (.Get 4) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (.Get 5) -}}
|
||||
{{- $scratch.Set "hidden" (.Get 5) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $prefixLength := "" -}}
|
||||
{{- $joinedLines := "" -}}
|
||||
{{- if or (.Page.Params.left_align_code) (.Get 6) -}}
|
||||
{{- $prefixLength = -1 -}}
|
||||
{{- range $line := $lines -}}
|
||||
{{- $leading := sub (len $line) (len (strings.TrimLeft " " $line)) -}}
|
||||
{{- if and (ne $line "") (or (eq $prefixLength -1) (le $leading $prefixLength)) -}}
|
||||
{{- $prefixLength = $leading -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $line := $lines -}}
|
||||
{{- $joinedLines = add $joinedLines (substr $line $prefixLength) -}}
|
||||
{{- $joinedLines = add $joinedLines "\n" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $joinedLines = delimit $lines "\n" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $url := partial "geturl.html" (dict "path" (.Get 1) "lines" (slice (.Get 2) (.Get 3))) -}}
|
||||
{{- $comment := partial "linerangestr.html" (dict "from" (.Get 2) "to" (.Get 3)) -}}
|
||||
|
||||
{{- with ($scratch.Get "hidden") -}}
|
||||
<details><summary>{{- . | markdownify -}}</summary>
|
||||
{{- end -}}
|
||||
{{- $groupconfig := dict
|
||||
"url" $url.url
|
||||
"basePath" $url.basePath
|
||||
"path" (.Get 1)
|
||||
"comment" $comment
|
||||
"code" $joinedLines
|
||||
"firstLine" (int (.Get 2))
|
||||
"lastLine" (int (.Get 3))
|
||||
"language" (.Get 0)
|
||||
"offset" $prefixLength
|
||||
"opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) $opts)
|
||||
-}}
|
||||
{{- partial "highlightgroup.html" $groupconfig -}}
|
||||
{{- with ($scratch.Get "hidden") -}}
|
||||
</details>
|
||||
{{- end -}}
|
||||
2
layouts/_shortcodes/codeurl.html
Normal file
2
layouts/_shortcodes/codeurl.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{- $url := partial "geturl.html" (dict "path" (.Get 0)) -}}
|
||||
{{- $url.url -}}
|
||||
@@ -5,7 +5,6 @@
|
||||
{{- $line := .Get 4 -}}
|
||||
{{- $lines := split (trim .Inner "\n") "\n" -}}
|
||||
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- $url := printf "https://github.com/%s/blob/%s/%s#L%d" $repo $commit $file $line -}}
|
||||
{{- partial "linerangestr.html" (dict "scratch" $scratch "from" 0 "to" $line) -}}
|
||||
{{- partial "highlightgroup.html" (dict "url" $url "path" $file "comment" ($scratch.Get "comment") "code" (trim .Inner "\n") "language" $lang) -}}
|
||||
{{- $comment := partial "linerangestr.html" (dict "from" 0 "to" $line) -}}
|
||||
{{- partial "highlightgroup.html" (dict "url" $url "path" $file "comment" $comment "code" (trim .Inner "\n") "language" $lang) -}}
|
||||
12
layouts/_shortcodes/internal.html
Normal file
12
layouts/_shortcodes/internal.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $name := .Get 0 -}}
|
||||
{{- $number := 1 -}}
|
||||
{{- with .Page.Store.Get "internal-ref-counter" -}}
|
||||
{{- $number = add . 1 }}
|
||||
{{- end -}}
|
||||
{{- .Page.Store.Set "internal-ref-counter" $number -}}
|
||||
{{- .Page.Store.SetInMap "internal-ref" $name $number -}}
|
||||
|
||||
<span class="internal-ref" id="internal-ref-{{ $name }}">
|
||||
{{ .Inner }}
|
||||
<span class="internal-ref-counter">{{ $number }}</span></span>
|
||||
{{- /* chomp whitespace at the end */ -}}
|
||||
7
layouts/_shortcodes/internalref.html
Normal file
7
layouts/_shortcodes/internalref.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{- $name := .Get 0 -}}
|
||||
{{- $number := index (.Page.Store.Get "internal-ref") $name -}}
|
||||
|
||||
<a href="#internal-ref-{{ $name }}">
|
||||
{{ .Inner }}
|
||||
<span class="internal-ref-counter">{{ $number }}</span></a>
|
||||
{{- /* chomp whitespace at the end */ -}}
|
||||
9
layouts/_shortcodes/rawblock.html
Normal file
9
layouts/_shortcodes/rawblock.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- $url := partial "geturl.html" (dict "path" (.Get 0)) -}}
|
||||
{{- $groupconfig := dict
|
||||
"url" $url.url
|
||||
"basePath" $url.basePath
|
||||
"path" (.Get 0)
|
||||
"comment" (i18n "entireFile")
|
||||
"content" (safeHTML (printf "<pre><code>%s</code></pre>" (htmlEscape (readFile (printf "code/%s" (.Get 0))))))
|
||||
-}}
|
||||
{{- partial "group.html" $groupconfig -}}
|
||||
3
layouts/_shortcodes/sidebyside.html
Normal file
3
layouts/_shortcodes/sidebyside.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="side-by-side">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
3
layouts/_shortcodes/sidebysideitem.html
Normal file
3
layouts/_shortcodes/sidebysideitem.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="side-by-side-item" {{ with .Get "weight" }} style="flex-grow: {{ . }};" {{ end }}>
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
@@ -1,5 +1,6 @@
|
||||
<span class="sidenote">
|
||||
<label class="sidenote-label" for="{{- .Get 1 -}}">{{- .Get 2 | markdownify -}}</label>
|
||||
{{- /* chomp trailing whitespace */ -}}
|
||||
<input class="sidenote-checkbox" style="display: none;" type="checkbox" id="{{- .Get 1 -}}"></input>
|
||||
{{- if $offset := .Get 3 -}}
|
||||
<span class="sidenote-content sidenote-{{- .Get 0 -}}" style="margin-top: {{- $offset -}}rem">
|
||||
@@ -10,4 +11,6 @@
|
||||
{{- .Inner -}}
|
||||
<span class="sidenote-delimiter">]</span>
|
||||
</span>
|
||||
{{- /* chomp trailing whitespace */ -}}
|
||||
</span>
|
||||
{{- /* chomp trailing whitespace */ -}}
|
||||
@@ -1,6 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language.Lang }}">
|
||||
{{- partial "head.html" . -}}
|
||||
<head>
|
||||
{{- partial "head.html" . -}}
|
||||
</head>
|
||||
<body>
|
||||
{{- partial "header.html" . -}}
|
||||
<div class="container"><hr class="header-divider"></div>
|
||||
@@ -1,9 +1,9 @@
|
||||
{{ define "main" }}
|
||||
<h2>{{ .Title }}</h2>
|
||||
<div class="post-subscript">
|
||||
<p>
|
||||
<p class="tag-list">
|
||||
{{- range (.GetTerms "tags") -}}
|
||||
<a class="button" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
<a class="tag" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
{{ end -}}
|
||||
</p>
|
||||
<p>{{ i18n "postedOn" (.Date.Format "January 2, 2006") }}.</p>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{{ .Content }}
|
||||
|
||||
{{ i18n "recentPosts" }}:
|
||||
{{ partial "uniquebyseries.html" (dict "scratch" .Scratch) }}
|
||||
{{ $pages := partial "uniquebyseries.html" . }}
|
||||
<ul class="post-list">
|
||||
{{ range first 10 (.Scratch.Get "pages") }}
|
||||
{{ range first 10 $pages }}
|
||||
{{ partial "post.html" (dict "page" . "linkSeries" true) }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
@@ -1,2 +0,0 @@
|
||||
<link rel="preload" href="{{ .url }}" as="style" onload="this.onload=null;this.rel='stylesheet'" {{ .extra | safeHTMLAttr }}>
|
||||
<noscript><link rel="stylesheet" href="{{ .url }}"></noscript>
|
||||
@@ -1,27 +0,0 @@
|
||||
{{- $siteSourceUrl := site.Params.siteSourceUrl -}}
|
||||
{{- $submoduleLinks := site.Data.submodules -}}
|
||||
{{- $hostData := site.Data.hosts -}}
|
||||
{{- $scratch := .scratch -}}
|
||||
{{- $lines := .lines -}}
|
||||
{{- $scratch.Set "bestLength" -1 -}}
|
||||
{{- $scratch.Set "bestUrl" (printf "%s/code/%s" $siteSourceUrl .path) -}}
|
||||
{{- $scratch.Set "bestPath" "" -}}
|
||||
{{- $filePath := .path -}}
|
||||
{{- range $path, $url := $submoduleLinks -}}
|
||||
{{- $bestLength := $scratch.Get "bestLength" -}}
|
||||
{{- if and (le $bestLength (len $path)) (hasPrefix $filePath $path) -}}
|
||||
{{- $scratch.Set "bestLength" (len $path) -}}
|
||||
{{- $scratch.Set "bestPath" $path -}}
|
||||
{{- $scratch.Set "bestUrl" (printf "%s%s" $url (strings.TrimPrefix $path $filePath)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if .lines -}}
|
||||
{{- /* If the user provided a line range, see if we can tack it on to the end of the link. */ -}}
|
||||
{{- range $host, $data := $hostData -}}
|
||||
{{- if hasPrefix ($scratch.Get "bestUrl") $host -}}
|
||||
{{- with $data.linesSuffix -}}
|
||||
{{- $scratch.Add "bestUrl" (printf . (index $lines 0) (index $lines 1)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -1,9 +0,0 @@
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- $scratch.Set "highlightGroupAttrs" (printf "data-base-path=\"%s\" data-file-path=\"%v\"" .basePath .path) -}}
|
||||
{{- if (or .firstLine .lastLine) -}}
|
||||
{{- $scratch.Add "highlightGroupAttrs" (printf " data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
|
||||
{{- end -}}
|
||||
{{- if eq (lower .language) "agda" -}}
|
||||
{{- $scratch.Add "highlightGroupAttrs" " data-agda-block" -}}
|
||||
{{- end -}}
|
||||
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" ($scratch.Get "highlightGroupAttrs")) }}
|
||||
@@ -1,9 +0,0 @@
|
||||
{{ if eq .from .to }}
|
||||
{{ .scratch.Set "comment" (printf ", line %d" .from) }}
|
||||
{{ else }}
|
||||
{{ if eq .from 0 }}
|
||||
{{ .scratch.Set "comment" (printf ", around line %d" .to) }}
|
||||
{{ else }}
|
||||
{{ .scratch.Set "comment" (printf ", lines %d through %d" .from .to) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -17,9 +17,9 @@
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<language>{{.}}</language>{{end}}{{ with site.Params.author.email }}
|
||||
<managingEditor>{{.}}{{ with site.Params.author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with site.Params.author.email }}
|
||||
<webMaster>{{.}}{{ with site.Params.author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
@@ -30,7 +30,7 @@
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
{{ with site.Params.author.email }}<author>{{.}}{{ with site.Params.author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
</item>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<h2>{{ .Title }} </h2>
|
||||
{{ .Content }}
|
||||
|
||||
{{ $search := resources.Get "scss/search.scss" | resources.ToCSS | resources.Minify }}
|
||||
<link rel="stylesheet" href="{{ $search.Permalink }}" media="screen">
|
||||
{{ $search := resources.Get "scss/search.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $search.Permalink }}" integrity="{{ $search.Data.Integrity }}" media="screen">
|
||||
|
||||
<div class="stork-wrapper">
|
||||
<div class="stork-input-wrapper">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p>{{ partial "seriesstatus.html" .Params.status }}</p>
|
||||
<p>{{ i18n "postsFromTo" (dict "from" $startYear "to" $endYear) }}</p>
|
||||
</div>
|
||||
<p>{{ .Summary }}</p>
|
||||
<p>{{ partial "summary" . }}</p>
|
||||
|
||||
<ul class="post-list">
|
||||
{{ range $pages }}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 1)) -}}
|
||||
{{- $groupconfig := dict
|
||||
"url" ($scratch.Get "bestUrl")
|
||||
"basePath" ($scratch.Get "bestPath")
|
||||
"path" (.Get 1)
|
||||
"comment" ", entire file"
|
||||
"code" (readFile (printf "code/%s" (.Get 1)))
|
||||
"language" (.Get 0)
|
||||
"opts" "linenos=table"
|
||||
-}}
|
||||
{{- partial "highlightgroup.html" $groupconfig -}}
|
||||
@@ -1,41 +0,0 @@
|
||||
{{- $source := (readFile (printf "code/%s" (.Get 1))) -}}
|
||||
{{- $allLines := split $source "\n" -}}
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- if not (eq (int (.Get 2)) 1) -}}
|
||||
{{- $scratch.Set "remLines" (after (sub (int (.Get 2)) 1) $allLines) -}}
|
||||
{{- else -}}
|
||||
{{- $scratch.Set "remLines" $allLines -}}
|
||||
{{- end -}}
|
||||
{{- $lines := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) ($scratch.Get "remLines") -}}
|
||||
|
||||
{{- if (.Get 4) -}}
|
||||
{{- $scratch.Set "opts" (printf ",%s" (.Get 4)) -}}
|
||||
{{- else -}}
|
||||
{{- $scratch.Set "opts" "" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (.Get 5) -}}
|
||||
{{- $scratch.Set "hidden" (.Get 5) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 1) "lines" (slice (.Get 2) (.Get 3))) -}}
|
||||
{{- partial "linerangestr.html" (dict "scratch" $scratch "from" (.Get 2) "to" (.Get 3)) -}}
|
||||
|
||||
{{- with ($scratch.Get "hidden") -}}
|
||||
<details><summary>{{- . | markdownify -}}</summary>
|
||||
{{- end -}}
|
||||
{{- $groupconfig := dict
|
||||
"url" ($scratch.Get "bestUrl")
|
||||
"basePath" ($scratch.Get "bestPath")
|
||||
"path" (.Get 1)
|
||||
"comment" ($scratch.Get "comment")
|
||||
"code" (delimit $lines "\n")
|
||||
"firstLine" (int (.Get 2))
|
||||
"lastLine" (int (.Get 3))
|
||||
"language" (.Get 0)
|
||||
"opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) ($scratch.Get "opts"))
|
||||
-}}
|
||||
{{- partial "highlightgroup.html" $groupconfig -}}
|
||||
{{- with ($scratch.Get "hidden") -}}
|
||||
</details>
|
||||
{{- end -}}
|
||||
@@ -1,3 +0,0 @@
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 0)) -}}
|
||||
{{- $scratch.Get "bestUrl" -}}
|
||||
@@ -1,10 +0,0 @@
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 0) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Data.submodules) -}}
|
||||
{{- $groupconfig := dict
|
||||
"url" ($scratch.Get "bestUrl")
|
||||
"basePath" ($scratch.Get "bestPath")
|
||||
"path" (.Get 0)
|
||||
"comment" ", entire file"
|
||||
"content" (safeHTML (printf "<pre><code>%s</code></pre>" (htmlEscape (readFile (printf "code/%s" (.Get 0))))))
|
||||
-}}
|
||||
{{- partial "group.html" $groupconfig -}}
|
||||
@@ -1,3 +0,0 @@
|
||||
<div style="background-color: tomato; color: white; padding: 10px;">
|
||||
<em>TODO: </em>{{- .Inner -}}
|
||||
</div>
|
||||
34
layouts/writing/baseof.html
Normal file
34
layouts/writing/baseof.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{{- /* Note: changing the baseof template because the title, tags, etc. of a regular post are still valid. */ -}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language.Lang }}">
|
||||
<head>
|
||||
{{- partial "head.html" . -}}
|
||||
|
||||
{{ $writingcss := resources.Get "scss/writing.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $writingcss.Permalink }}" integrity="{{ $writingcss.Data.Integrity }}">
|
||||
|
||||
{{ if .Params.custom_css }}
|
||||
{{ range $customCss := .Params.custom_css }}
|
||||
{{ $renderedCustomCss := page.Resources.Get $customCss | css.Sass (dict "includePaths" (slice "themes/vanilla/assets/scss")) | resources.Minify | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $renderedCustomCss.Permalink }}" integrity="{{ $renderedCustomCss.Data.Integrity }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</head>
|
||||
<body>
|
||||
{{ with .Params.body_start_partial }}
|
||||
{{ partial . $ }}
|
||||
{{ end }}
|
||||
|
||||
{{- partial "header.html" . -}}
|
||||
<div class="container"><hr class="header-divider"></div>
|
||||
<main class="container">
|
||||
|
||||
{{- if .Draft -}}
|
||||
{{- partial "warning.html" (i18n "postDraft") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- block "main" . }}{{- end }}
|
||||
</main>
|
||||
{{- block "after" . }}{{- end }}
|
||||
</body>
|
||||
</html>
|
||||
BIN
static/banner.png
Normal file
BIN
static/banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
static/fonts/Inconsolata-VariableFont_wdth,wght.ttf
Normal file
BIN
static/fonts/Inconsolata-VariableFont_wdth,wght.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Lora-Italic-VariableFont_wght.ttf
Normal file
BIN
static/fonts/Lora-Italic-VariableFont_wght.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Lora-VariableFont_wght.ttf
Normal file
BIN
static/fonts/Lora-VariableFont_wght.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Raleway-Italic-VariableFont_wght.ttf
Normal file
BIN
static/fonts/Raleway-Italic-VariableFont_wght.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Raleway-VariableFont_wght.ttf
Normal file
BIN
static/fonts/Raleway-VariableFont_wght.ttf
Normal file
Binary file not shown.
BIN
static/fonts/STIXGeneral-Regular.ttf
Normal file
BIN
static/fonts/STIXGeneral-Regular.ttf
Normal file
Binary file not shown.
BIN
static/fonts/gen/Inconsolata-400.woff2
Normal file
BIN
static/fonts/gen/Inconsolata-400.woff2
Normal file
Binary file not shown.
BIN
static/fonts/gen/Lora-Italic.woff2
Normal file
BIN
static/fonts/gen/Lora-Italic.woff2
Normal file
Binary file not shown.
BIN
static/fonts/gen/Lora-Regular.woff2
Normal file
BIN
static/fonts/gen/Lora-Regular.woff2
Normal file
Binary file not shown.
BIN
static/fonts/gen/Raleway-400-Italic.woff2
Normal file
BIN
static/fonts/gen/Raleway-400-Italic.woff2
Normal file
Binary file not shown.
BIN
static/fonts/gen/Raleway-400.woff2
Normal file
BIN
static/fonts/gen/Raleway-400.woff2
Normal file
Binary file not shown.
BIN
static/fonts/gen/Raleway-700-Italic.woff2
Normal file
BIN
static/fonts/gen/Raleway-700-Italic.woff2
Normal file
Binary file not shown.
BIN
static/fonts/gen/Raleway-700.woff2
Normal file
BIN
static/fonts/gen/Raleway-700.woff2
Normal file
Binary file not shown.
@@ -8,7 +8,7 @@ license = "MIT"
|
||||
# homepage = "http://example.com/"
|
||||
# tags = []
|
||||
# features = []
|
||||
min_version = "0.41"
|
||||
min_version = "0.160.1"
|
||||
|
||||
[author]
|
||||
name = "Danila Fedorin"
|
||||
|
||||
Reference in New Issue
Block a user