Compare commits
8 Commits
98a9d78273
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 952502e690 | |||
| 388a4f1589 | |||
| 806d3a318f | |||
| b06b695653 | |||
| 4ff04221b0 | |||
| c5c57405b0 | |||
| 2beded7c14 | |||
| 2b7645a572 |
@@ -15,10 +15,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: $font-code;
|
font-family: $font-code;
|
||||||
@include var(background-color, code-color);
|
@include var(background-color, code-color);
|
||||||
border: $code-border;
|
border: $code-border;
|
||||||
padding: 0 0.25rem 0 0.25rem;
|
padding: 0 0.25rem 0 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre code {
|
pre code {
|
||||||
@@ -40,12 +40,12 @@ pre code {
|
|||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
&:hover, &:focus {
|
&:hover, &:focus {
|
||||||
background-color: rgba($primary-color, 0.25);
|
background-color: rgba($primary-color, 0.25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
@@ -104,12 +104,10 @@ pre code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.kr, .kd, .k {
|
.kr, .kd, .k {
|
||||||
font-weight: bold;
|
|
||||||
@include var(color, code-keyword-color);
|
@include var(color, code-keyword-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.kt {
|
.kt {
|
||||||
font-weight: bold;
|
|
||||||
@include var(color, code-type-color);
|
@include var(color, code-type-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +1,44 @@
|
|||||||
@mixin font-inconsolata($weight) {
|
@mixin font-inconsolata($weight) {
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Inconsolata';
|
font-family: 'Inconsolata';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: $weight;
|
font-weight: $weight;
|
||||||
src: local('Inconsolata'),
|
src: local('Inconsolata'),
|
||||||
url('../fonts/Inconsolata-VariableFont_wdth,wght.ttf');
|
url('../fonts/gen/Inconsolata-#{$weight}.woff2');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin font-lora {
|
@mixin font-lora {
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Lora';
|
font-family: 'Lora';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
src: local('Lora'),
|
src: local('Lora'),
|
||||||
url('../fonts/Lora-VariableFont_wght.ttf'),
|
url('../fonts/gen/Lora-Regular.woff2'),
|
||||||
url('../fonts/Lora-Italic-VariableFont_wght.ttf');
|
url('../fonts/gen/Lora-Italic.woff2');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin font-raleway($weight) {
|
@mixin font-raleway($weight) {
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Raleway';
|
font-family: 'Raleway';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: $weight;
|
font-weight: $weight;
|
||||||
src: local('Raleway'),
|
src: local('Raleway'),
|
||||||
url('../fonts/Raleway-VariableFont_wght.ttf'),
|
url('../fonts/gen/Raleway-#{$weight}.woff2'),
|
||||||
url('../fonts/Raleway-Italic-VariableFont_wght.ttf');
|
url('../fonts/gen/Raleway-#{$weight}-Italic.woff2');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin font-stixgeneral {
|
@mixin font-stixgeneral {
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'STIXGeneral';
|
font-family: 'STIXGeneral';
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
src: local('STIXGeneral-Regular'),
|
src: local('STIXGeneral-Regular'),
|
||||||
url('../fonts/STIXGeneral-Regular.ttf');
|
url('../fonts/STIXGeneral-Regular.ttf');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include font-inconsolata(400);
|
@include font-inconsolata(400);
|
||||||
@include font-inconsolata(700);
|
|
||||||
@include font-lora();
|
@include font-lora();
|
||||||
@include font-raleway(400);
|
@include font-raleway(400);
|
||||||
@include font-raleway(700);
|
@include font-raleway(700);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@mixin below-container-width {
|
@mixin below-container-width {
|
||||||
@media screen and (max-width: $container-width-threshold){
|
@media screen and (max-width: $container-width-threshold) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,17 +16,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@mixin textual-input {
|
@mixin textual-input {
|
||||||
@include bordered-block;
|
@include bordered-block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@include var(background-color, background-color);
|
@include var(background-color, background-color);
|
||||||
@include var(color, text-color);
|
@include var(color, text-color);
|
||||||
font-family: $font-body;
|
font-family: $font-body;
|
||||||
padding: $input-padding;
|
padding: $input-padding;
|
||||||
|
|
||||||
&:active, &:focus {
|
&:active, &:focus {
|
||||||
@include green-shadow;
|
@include green-shadow;
|
||||||
border-color: $primary-color;
|
border-color: $primary-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ input.stork-input {
|
|||||||
padding: $search-element-padding;
|
padding: $search-element-padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stork-message:not(:last-child), .stork-result {
|
.stork-message:not(:last-child), .stork-result {
|
||||||
border-bottom: $standard-border;
|
border-bottom: $standard-border;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,169 +4,169 @@
|
|||||||
@import "modes.scss";
|
@import "modes.scss";
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@include var(background-color, background-color);
|
@include var(background-color, background-color);
|
||||||
@include var(color, text-color);
|
@include var(color, text-color);
|
||||||
font-family: $font-body;
|
font-family: $font-body;
|
||||||
font-size: 1.0rem;
|
font-size: 1.0rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
|
|
||||||
@include below-container-width {
|
@include below-container-width {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
margin-bottom: .1rem;
|
margin-bottom: .1rem;
|
||||||
margin-top: .5rem;
|
margin-top: .5rem;
|
||||||
font-family: $font-heading;
|
font-family: $font-heading;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
&:target {
|
&:target {
|
||||||
@include var(background-color, target-background-color);
|
@include var(background-color, target-background-color);
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: $primary-color;
|
color: $primary-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
&:target {
|
&:target {
|
||||||
@include var(background-color, target-background-color);
|
@include var(background-color, target-background-color);
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: $container-width;
|
max-width: $container-width;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
@include below-container-width {
|
@include below-container-width {
|
||||||
padding: 0 $container-min-padding 0 $container-min-padding;
|
padding: 0 $container-min-padding 0 $container-min-padding;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
max-width: $container-width + 2 * $container-min-padding;
|
max-width: $container-width + 2 * $container-min-padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include below-two-margins {
|
@include below-two-margins {
|
||||||
left: -($margin-width + $margin-inner-offset + $margin-outer-offset)/2;
|
left: -($margin-width + $margin-inner-offset + $margin-outer-offset) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include below-one-margin {
|
@include below-one-margin {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.button, input[type="submit"] {
|
.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;
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover, &:focus {
|
|
||||||
background-color: rgba($primary-color, 0.2);
|
|
||||||
@include var(color, text-color);
|
@include var(color, text-color);
|
||||||
}
|
padding: 0.5rem;
|
||||||
|
border: 1px solid $primary-color;
|
||||||
|
transition: color 0.25s, background-color 0.25s;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover, &:focus {
|
||||||
|
background-color: rgba($primary-color, 0.2);
|
||||||
|
@include var(color, text-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input[type="text"], textarea {
|
.input[type="text"], textarea {
|
||||||
@include textual-input;
|
@include textual-input;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0rem 0rem 1rem 0rem;
|
margin: 0rem 0rem 1rem 0rem;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
padding: 0.25rem 0.75rem 0.25rem .75rem;
|
padding: 0.25rem 0.75rem 0.25rem .75rem;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@include var(color, text-color);
|
@include var(color, text-color);
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-subscript {
|
.post-subscript {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
margin-top: .5rem;
|
margin-top: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 3.0rem;
|
font-size: 3.0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 2.6rem;
|
font-size: 2.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 2.2rem;
|
font-size: 2.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
font-size: 1.8rem;
|
font-size: 1.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h5 {
|
h5 {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h6 {
|
h6 {
|
||||||
font-size: 1.0rem;
|
font-size: 1.0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@include var(color, text-color);
|
@include var(color, text-color);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-bottom: .2rem solid $primary-color;
|
border-bottom: .2rem solid $primary-color;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: $primary-color;
|
color: $primary-color;
|
||||||
transition: color 0.25s;
|
transition: color 0.25s;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.external-link, &.same-page-link {
|
&.external-link, &.same-page-link {
|
||||||
.feather {
|
.feather {
|
||||||
fill: none;
|
fill: none;
|
||||||
margin-left: 0.25rem;
|
margin-left: 0.25rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 0.125em;
|
top: 0.125em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.draft-link {
|
.draft-link {
|
||||||
border-bottom: .2rem solid $border-color;
|
border-bottom: .2rem solid $border-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
@@ -247,25 +247,25 @@ ul.post-list {
|
|||||||
|
|
||||||
p.post-wordcount, p.post-status {
|
p.post-wordcount, p.post-status {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 0.6rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.series-link {
|
.series-link {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
border-top: $standard-border;
|
border-top: $standard-border;
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
|
|
||||||
.feather {
|
.feather {
|
||||||
fill: none;
|
fill: none;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 1em;
|
width: 1em;
|
||||||
height: 1em;
|
height: 1em;
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,8 +309,8 @@ figure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.fullwide {
|
&.fullwide {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,21 +330,20 @@ figure {
|
|||||||
That's because firefox reader mode doesn't play nice with them, and
|
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
|
it seems to ignore all styles in <head>. Then, the inline style
|
||||||
in <head> uses !important to restore the display of icons, but provides
|
in <head> uses !important to restore the display of icons, but provides
|
||||||
limited styling. Here, we finally apply the full extent of the feather
|
limited styling. Here, we finally apply the full extent of the feather styles.
|
||||||
styles.
|
|
||||||
*/
|
*/
|
||||||
.feather {
|
.feather {
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
stroke: currentColor;
|
stroke: currentColor;
|
||||||
stroke-width: 2;
|
stroke-width: 2;
|
||||||
stroke-linecap: round;
|
stroke-linecap: round;
|
||||||
stroke-linejoin: round;
|
stroke-linejoin: round;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.katex * {
|
.katex * {
|
||||||
font-family: unset;
|
font-family: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
@@ -356,7 +355,7 @@ figure {
|
|||||||
|
|
||||||
.dialog {
|
.dialog {
|
||||||
.message {
|
.message {
|
||||||
max-width: 0.8*$container-width;
|
max-width: 0.8 * $container-width;
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -390,19 +389,18 @@ figure {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
&.previous {
|
&.previous {
|
||||||
justify-content: left;
|
justify-content: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.next {
|
&.next {
|
||||||
justify-content: right;
|
justify-content: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
a, .ongoing-placeholder {
|
a, .ongoing-placeholder {
|
||||||
@include bordered-block;
|
@include bordered-block;
|
||||||
padding: 0.5em 1em 0.5em 1em;
|
padding: 0.5em 1em 0.5em 1em;
|
||||||
@@ -412,16 +410,16 @@ figure {
|
|||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
|
||||||
.feather {
|
.feather {
|
||||||
height: 1.25em;
|
height: 1.25em;
|
||||||
width: 1.25em;
|
width: 1.25em;
|
||||||
fill: none;
|
fill: none;
|
||||||
&:first-child { margin-right: 0.5em; }
|
&:first-child { margin-right: 0.5em; }
|
||||||
&:last-child { margin-left: 0.5em; }
|
&:last-child { margin-left: 0.5em; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ongoing-placeholder {
|
.ongoing-placeholder {
|
||||||
border-style: dashed;
|
border-style: dashed;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.title {
|
div.title {
|
||||||
@@ -476,26 +474,26 @@ blockquote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.side-by-side-item {
|
.side-by-side-item {
|
||||||
flex-basis: 0;
|
flex-basis: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.internal-ref {
|
.internal-ref {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
break-inside: avoid;
|
break-inside: avoid;
|
||||||
|
|
||||||
&:target {
|
&:target {
|
||||||
@include var(background-color, target-background-color);
|
@include var(background-color, target-background-color);
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
|
|
||||||
.internal-ref-counter {
|
.internal-ref-counter {
|
||||||
@include var(background-color, target-background-color);
|
@include var(background-color, target-background-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.internal-ref-counter {
|
.internal-ref-counter {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border: $standard-border;
|
border: $standard-border;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
padding: 0 0.25rem 0 0.25rem;
|
padding: 0 0.25rem 0 0.25rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ $target-background-color-dark: #55511c;
|
|||||||
|
|
||||||
$code-color: #f0f0f0;
|
$code-color: #f0f0f0;
|
||||||
$code-color-dark: lighten($background-color-dark, 10%);
|
$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-token-color-dark: $primary-color;
|
||||||
$code-highlight-color: #fffd99;
|
$code-highlight-color: #fffd99;
|
||||||
$code-highlight-color-dark: #555538;
|
$code-highlight-color-dark: #555538;
|
||||||
|
|||||||
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()
|
||||||
9
layouts/_default/_markup/render-blockquote.html
Normal file
9
layouts/_default/_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,24 +1,25 @@
|
|||||||
{{- $scratch := newScratch -}}
|
{{- $class := "" -}}
|
||||||
|
{{- $icon := "" -}}
|
||||||
{{- $absoluteDest := absLangURL .Destination -}}
|
{{- $absoluteDest := absLangURL .Destination -}}
|
||||||
{{- $siteRootUrl := absLangURL "" -}}
|
{{- $siteRootUrl := absLangURL "" -}}
|
||||||
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
|
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
|
||||||
{{- $isSamePage := hasPrefix .Destination "#" -}}
|
{{- $isSamePage := hasPrefix .Destination "#" -}}
|
||||||
|
|
||||||
{{- if $isSamePage -}}
|
{{- if $isSamePage -}}
|
||||||
{{- $scratch.Set "class" "same-page-link" -}}
|
{{- $class = "same-page-link" -}}
|
||||||
{{- if index (.Page.Scratch.Get "definedSections") .Destination -}}
|
{{- if index (.Page.Scratch.Get "definedSections") .Destination -}}
|
||||||
{{- $scratch.Set "icon" "arrow-up" -}}
|
{{- $icon = "arrow-up" -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- /* Do not render "down" links because don't know how to distinguish unseen titles from paragraph links. */ -}}
|
{{- /* 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 -}}
|
{{- end -}}
|
||||||
{{- else if $isExternal -}}
|
{{- else if $isExternal -}}
|
||||||
{{- $scratch.Set "class" "external-link" -}}
|
{{- $class = "external-link" -}}
|
||||||
{{- $scratch.Set "icon" "external-link" -}}
|
{{- $icon = "external-link" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<a href="{{ .Destination | safeURL }}"
|
<a href="{{ .Destination | safeURL }}"
|
||||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||||
{{- with $scratch.Get "class" -}}
|
{{- with $class -}}
|
||||||
class="{{ . }}"
|
class="{{ . }}"
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if (and site.Params.externalLinksInNewTab $isExternal) -}}
|
{{- if (and site.Params.externalLinksInNewTab $isExternal) -}}
|
||||||
@@ -26,6 +27,6 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
>
|
>
|
||||||
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
||||||
{{- with $scratch.Get "icon" -}}{{- partial "icon.html" . -}}{{- end -}}
|
{{- with $icon -}}{{- partial "icon.html" . -}}{{- end -}}
|
||||||
</a>
|
</a>
|
||||||
{{- /* chomp trailing newline */ -}}
|
{{- /* chomp trailing newline */ -}}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<!-- Fonts -->
|
<!-- Fonts -->
|
||||||
{{ if not (.Site.Params.noCss) }}
|
{{ if not (.Site.Params.noCss) }}
|
||||||
{{ $fonts := resources.Get "scss/fonts.scss" | resources.ToCSS | resources.Minify }}
|
{{ $fonts := resources.Get "scss/fonts.scss" | css.Sass | resources.Minify }}
|
||||||
<link rel="stylesheet" href="{{ $fonts.Permalink }}" media="screen">
|
<link rel="stylesheet" href="{{ $fonts.Permalink }}" media="screen">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@
|
|||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
<!-- In-house CSS -->
|
<!-- In-house CSS -->
|
||||||
{{ $style := resources.Get "scss/style.scss" | resources.ToCSS | resources.Minify }}
|
{{ $style := resources.Get "scss/style.scss" | css.Sass | resources.Minify }}
|
||||||
{{ $sidenotes := resources.Get "scss/sidenotes.scss" | resources.ToCSS | resources.Minify }}
|
{{ $sidenotes := resources.Get "scss/sidenotes.scss" | css.Sass | resources.Minify }}
|
||||||
{{ $code := resources.Get "scss/code.scss" | resources.ToCSS | resources.Minify }}
|
{{ $code := resources.Get "scss/code.scss" | css.Sass | resources.Minify }}
|
||||||
{{ $icon := resources.Get "img/favicon.png" }}
|
{{ $icon := resources.Get "img/favicon.png" }}
|
||||||
<style>.feather { display: inline !important; width: 10px; height: 10px; }</style>
|
<style>.feather { display: inline !important; width: 10px; height: 10px; }</style>
|
||||||
<style>img { max-width: 70%; }</style>
|
<style>img { max-width: 70%; }</style>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<script defer src="{{ .Site.Params.bergamotObjectLanguageJsUrl }}"></script>
|
<script defer src="{{ .Site.Params.bergamotObjectLanguageJsUrl }}"></script>
|
||||||
{{ $bergamotHelpers := resources.Get "js/bergamot-helpers.js" | resources.Minify }}
|
{{ $bergamotHelpers := resources.Get "js/bergamot-helpers.js" | resources.Minify }}
|
||||||
<script defer src="{{ $bergamotHelpers.Permalink }}"></script>
|
<script defer src="{{ $bergamotHelpers.Permalink }}"></script>
|
||||||
{{ $bergamotStyle := resources.Get "scss/bergamot.scss" | resources.ToCSS | resources.Minify }}
|
{{ $bergamotStyle := resources.Get "scss/bergamot.scss" | css.Sass | resources.Minify }}
|
||||||
{{ partial "defercss.html" (dict "url" $bergamotStyle.Permalink "extra" "") }}
|
{{ partial "defercss.html" (dict "url" $bergamotStyle.Permalink "extra" "") }}
|
||||||
{{ if .Params.bergamot.render_presets }}
|
{{ if .Params.bergamot.render_presets }}
|
||||||
{{ range $name, $rulefile := .Params.bergamot.render_presets }}
|
{{ range $name, $rulefile := .Params.bergamot.render_presets }}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
{{- $scratch := newScratch -}}
|
{{- $highlightGroupAttrs := (printf "data-base-path=\"%s\" data-file-path=\"%v\"" .basePath .path) -}}
|
||||||
{{- $scratch.Set "highlightGroupAttrs" (printf "data-base-path=\"%s\" data-file-path=\"%v\"" .basePath .path) -}}
|
|
||||||
{{- if (or .firstLine .lastLine) -}}
|
{{- if (or .firstLine .lastLine) -}}
|
||||||
{{- $scratch.Add "highlightGroupAttrs" (printf " data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
|
{{- $highlightGroupAttrs = add $highlightGroupAttrs (printf " data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if eq (lower .language) "agda" -}}
|
{{- if eq (lower .language) "agda" -}}
|
||||||
{{- $scratch.Add "highlightGroupAttrs" " data-agda-block" -}}
|
{{- $highlightGroupAttrs = add $highlightGroupAttrs " data-agda-block" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- with .offset -}}
|
{{- with .offset -}}
|
||||||
{{- $scratch.Add "highlightGroupAttrs" (printf " data-source-offset=\"%v\"" .) -}}
|
{{- $highlightGroupAttrs = add $highlightGroupAttrs (printf " data-source-offset=\"%v\"" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" ($scratch.Get "highlightGroupAttrs")) }}
|
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" $highlightGroupAttrs) }}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
{{ partial "seriesstatus.html" .page.Params.status }}
|
{{ partial "seriesstatus.html" .page.Params.status }}
|
||||||
</p>
|
</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<p class="post-preview">{{ .page.Summary }} {{ if .page.Truncated }}...{{ end }}</p>
|
<p class="post-preview">{{ partial "summary" .page }}</p>
|
||||||
{{- if .linkSeries -}}
|
{{- if .linkSeries -}}
|
||||||
{{- $term := index (.page.GetTerms "series") 0 -}}
|
{{- $term := index (.page.GetTerms "series") 0 -}}
|
||||||
{{- with $term -}}
|
{{- with $term -}}
|
||||||
|
|||||||
5
layouts/partials/summary.html
Normal file
5
layouts/partials/summary.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{{- if .Params.summary -}}
|
||||||
|
{{ .Params.summary }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ .Summary | plainify | truncate 180 }}
|
||||||
|
{{- end -}}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<h2>{{ .Title }} </h2>
|
<h2>{{ .Title }} </h2>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|
||||||
{{ $search := resources.Get "scss/search.scss" | resources.ToCSS | resources.Minify }}
|
{{ $search := resources.Get "scss/search.scss" | css.Sass | resources.Minify }}
|
||||||
<link rel="stylesheet" href="{{ $search.Permalink }}" media="screen">
|
<link rel="stylesheet" href="{{ $search.Permalink }}" media="screen">
|
||||||
|
|
||||||
<div class="stork-wrapper">
|
<div class="stork-wrapper">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<p>{{ partial "seriesstatus.html" .Params.status }}</p>
|
<p>{{ partial "seriesstatus.html" .Params.status }}</p>
|
||||||
<p>{{ i18n "postsFromTo" (dict "from" $startYear "to" $endYear) }}</p>
|
<p>{{ i18n "postsFromTo" (dict "from" $startYear "to" $endYear) }}</p>
|
||||||
</div>
|
</div>
|
||||||
<p>{{ .Summary }}</p>
|
<p>{{ partial "summary" . }}</p>
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range $pages }}
|
{{ range $pages }}
|
||||||
|
|||||||
@@ -1,39 +1,38 @@
|
|||||||
{{- $source := (readFile (printf "code/%s" (.Get 1))) -}}
|
{{- $source := (readFile (printf "code/%s" (.Get 1))) -}}
|
||||||
{{- $allLines := split $source "\n" -}}
|
{{- $allLines := split $source "\n" -}}
|
||||||
{{- $scratch := newScratch -}}
|
{{- $scratch := newScratch -}}
|
||||||
|
{{- $remLines := $allLines -}}
|
||||||
{{- if not (eq (int (.Get 2)) 1) -}}
|
{{- if not (eq (int (.Get 2)) 1) -}}
|
||||||
{{- $scratch.Set "remLines" (after (sub (int (.Get 2)) 1) $allLines) -}}
|
{{- $remLines = after (sub (int (.Get 2)) 1) $allLines -}}
|
||||||
{{- else -}}
|
|
||||||
{{- $scratch.Set "remLines" $allLines -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $lines := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) ($scratch.Get "remLines") -}}
|
{{- $lines := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) $remLines -}}
|
||||||
|
|
||||||
|
{{- $opts := "" -}}
|
||||||
{{- if (.Get 4) -}}
|
{{- if (.Get 4) -}}
|
||||||
{{- $scratch.Set "opts" (printf ",%s" (.Get 4)) -}}
|
{{- $opts = printf ",%s" (.Get 4) -}}
|
||||||
{{- else -}}
|
|
||||||
{{- $scratch.Set "opts" "" -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if (.Get 5) -}}
|
{{- if (.Get 5) -}}
|
||||||
{{- $scratch.Set "hidden" (.Get 5) -}}
|
{{- $scratch.Set "hidden" (.Get 5) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $prefixLength := "" -}}
|
||||||
|
{{- $joinedLines := "" -}}
|
||||||
{{- if or (.Page.Params.left_align_code) (.Get 6) -}}
|
{{- if or (.Page.Params.left_align_code) (.Get 6) -}}
|
||||||
{{- $scratch.Set "prefixLength" -1 -}}
|
{{- $prefixLength = -1 -}}
|
||||||
{{- range $line := $lines -}}
|
{{- range $line := $lines -}}
|
||||||
{{- $leading := sub (len $line) (len (strings.TrimLeft " " $line)) -}}
|
{{- $leading := sub (len $line) (len (strings.TrimLeft " " $line)) -}}
|
||||||
{{- if and (ne $line "") (or (eq ($scratch.Get "prefixLength") -1) (le $leading ($scratch.Get "prefixLength"))) -}}
|
{{- if and (ne $line "") (or (eq $prefixLength -1) (le $leading $prefixLength)) -}}
|
||||||
{{- $scratch.Set "prefixLength" $leading -}}
|
{{- $prefixLength = $leading -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $scratch.Set "joinedLines" "" -}}
|
|
||||||
{{- range $line := $lines -}}
|
{{- range $line := $lines -}}
|
||||||
{{- $scratch.Add "joinedLines" (substr $line ($scratch.Get "prefixLength")) -}}
|
{{- $joinedLines = add $joinedLines (substr $line $prefixLength) -}}
|
||||||
{{- $scratch.Add "joinedLines" "\n" -}}
|
{{- $joinedLines = add $joinedLines "\n" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $scratch.Set "joinedLines" (delimit $lines "\n") -}}
|
{{- $joinedLines = delimit $lines "\n" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 1) "lines" (slice (.Get 2) (.Get 3))) -}}
|
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 1) "lines" (slice (.Get 2) (.Get 3))) -}}
|
||||||
@@ -47,12 +46,12 @@
|
|||||||
"basePath" ($scratch.Get "bestPath")
|
"basePath" ($scratch.Get "bestPath")
|
||||||
"path" (.Get 1)
|
"path" (.Get 1)
|
||||||
"comment" ($scratch.Get "comment")
|
"comment" ($scratch.Get "comment")
|
||||||
"code" ($scratch.Get "joinedLines")
|
"code" $joinedLines
|
||||||
"firstLine" (int (.Get 2))
|
"firstLine" (int (.Get 2))
|
||||||
"lastLine" (int (.Get 3))
|
"lastLine" (int (.Get 3))
|
||||||
"language" (.Get 0)
|
"language" (.Get 0)
|
||||||
"offset" ($scratch.Get "prefixLength")
|
"offset" $prefixLength
|
||||||
"opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) ($scratch.Get "opts"))
|
"opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) $opts)
|
||||||
-}}
|
-}}
|
||||||
{{- partial "highlightgroup.html" $groupconfig -}}
|
{{- partial "highlightgroup.html" $groupconfig -}}
|
||||||
{{- with ($scratch.Get "hidden") -}}
|
{{- with ($scratch.Get "hidden") -}}
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<div style="background-color: tomato; color: white; padding: 10px;">
|
|
||||||
<em>TODO: </em>{{- .Inner -}}
|
|
||||||
</div>
|
|
||||||
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.
Reference in New Issue
Block a user