changed theme to hugo-book alike

This commit is contained in:
aethrvmn 2024-11-10 01:33:32 +01:00
parent 383ff28ae2
commit 19ad6583cd
169 changed files with 4612 additions and 427 deletions

65
assets/_custom.scss Normal file
View file

@ -0,0 +1,65 @@
.book-page {
margin-top: -2rem;
}
.book-menu{
margin-top: 2rem;
}
.book-menu-bot {
bottom: 0;
position: relative;
}
.info-container {
background-color: var(--gray-100);
position: relative;
min-width: 30rem;
bottom: 0;
left: 0;
right: 0;
}
.commit-info {
font-size: 0.8rem;
margin: 1rem;
}
.commit-info {
text-align: left;
}
.disclaimer {
float: left;
font-size: 0.9rem;
margin: 1rem;
}
#personal {
width: 50%;
min-width: 40px;
max-width: 550px;
float: right;
padding: 10px;
display: block;
}
@media only screen and (max-width : 575px) {
#personal {
min-width: 40px;
max-width: 180px;
float: center;
padding: 0px 0px 0px 0px;
display: block;
}
}
@media only screen and (max-width : 575px) {
#personal {
min-width: 40px;
max-width: 180px;
float: center;
padding: 0px 0px 0px 0px;
display: block;
}
}

66
assets/_defaults.scss Normal file
View file

@ -0,0 +1,66 @@
// Used in layout
$padding-1: 1px !default;
$padding-4: 0.25rem !default;
$padding-8: 0.5rem !default;
$padding-16: 1rem !default;
$font-size-base: 20px !default;
$font-size-12: 0.75rem !default;
$font-size-14: 0.875rem !default;
$font-size-16: 1rem !default;
$border-radius: $padding-4 !default;
$body-font-weight: normal !default;
$body-min-width: 20rem !default;
$container-max-width: 80rem !default;
$header-height: 3.5rem !default;
$menu-width: 16rem !default;
$toc-width: 16rem !default;
$mobile-breakpoint: $menu-width + $body-min-width * 1.2 + $toc-width !default;
$hint-colors: (
info: #6bf,
warning: #fd6,
danger: #f66,
) !default;
// Themes
@mixin theme-light {
--gray-100: #f8f9fa;
--gray-200: #e9ecef;
--gray-500: #adb5bd;
--color-link: #0055bb;
--color-visited-link: #8440f1;
--body-background: white;
--body-font-color: black;
--icon-filter: none;
--hint-color-info: #6bf;
--hint-color-warning: #fd6;
--hint-color-danger: #f66;
}
@mixin theme-dark {
--gray-100: rgba(255, 255, 255, 0.1);
--gray-200: rgba(255, 255, 255, 0.2);
--gray-500: rgba(255, 255, 255, 0.5);
--color-link: #f7f6f3;
--color-visited-link: #f7f6f3;
--body-background: #2D2A2E;
--body-font-color: #f7f6f3;
--icon-filter: brightness(0) invert(1);
--hint-color-info: #6bf;
--hint-color-warning: #fd6;
--hint-color-danger: #f66;
}

37
assets/_fonts.scss Normal file
View file

@ -0,0 +1,37 @@
/* roboto-regular - latin */
@font-face {
font-family: 'GFS Didot';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local(''),
url('https://fonts.googleapis.com/css2?family=GFS+Didot&display=swap');
}
/* roboto-700 - latin */
@font-face {
font-family: 'GFS Didot';
font-style: normal;
font-weight: 700;
font-display: swap;
src: local(''),
url('https://fonts.googleapis.com/css2?family=GFS+Didot&display=swap');
}
/* roboto-mono-regular - latin */
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local(''),
url('fonts/roboto-mono-v13-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/roboto-mono-v13-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
body {
font-family: 'GFS Didot', sans-serif;
}
code {
font-family: 'Roboto Mono', monospace;
}

366
assets/_main.scss Normal file
View file

@ -0,0 +1,366 @@
html {
font-size: $font-size-base;
scroll-behavior: smooth;
touch-action: manipulation;
}
body {
min-width: $body-min-width;
color: var(--body-font-color);
background: var(--body-background);
margin-top: 40px;
letter-spacing: 0.33px;
font-weight: $body-font-weight;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
box-sizing: border-box;
* {
box-sizing: inherit;
}
}
h1,
h2,
h3,
h4,
h5 {
font-weight: $body-font-weight;
}
a {
text-decoration: none;
color: var(--color-link);
}
img {
vertical-align: baseline;
}
:focus {
@include outline;
}
aside nav ul {
padding: 0;
margin: 0;
list-style: none;
li {
margin: 1em 0;
position: relative;
}
a {
display: block;
}
a:hover {
color: #AC9C6D;
}
ul {
padding-inline-start: $padding-16;
}
}
ul.pagination {
display: flex;
justify-content: center;
list-style-type: none;
padding-inline-start: 0px;
.page-item a {
padding: $padding-16;
}
}
.container {
max-width: $container-max-width;
margin: 0 auto;
}
.book-icon {
filter: var(--icon-filter);
}
.book-brand {
margin-top: 0;
margin-bottom: $padding-16;
img {
height: 1.5em;
width: 1.5em;
margin-inline-end: $padding-8;
}
}
.book-menu {
flex: 0 0 $menu-width;
font-size: $font-size-14;
.book-menu-content {
width: $menu-width;
padding: $padding-16;
background: var(--body-background);
@include fixed;
}
a,
label {
color: inherit;
cursor: pointer;
word-wrap: break-word;
}
a.active {
color: var(--color-link);
}
input.toggle + label + ul {
display: none;
}
input.toggle:checked + label + ul {
display: block;
}
input.toggle + label::after {
content: "";
}
input.toggle:checked + label::after {
content: "";
}
}
// for RTL support
body[dir="rtl"] .book-menu {
input.toggle + label::after {
content: "";
}
input.toggle:checked + label::after {
content: "";
}
}
.book-section-flat {
margin: $padding-16 * 2 0;
> a,
> span,
> label {
font-weight: bolder;
}
> ul {
padding-inline-start: 0;
}
}
.book-page {
min-width: $body-min-width;
flex-grow: 1;
padding: $padding-16;
}
.book-post {
margin-bottom: $padding-16 * 3;
}
.book-header {
display: none;
margin-bottom: $padding-16;
label {
line-height: 0;
}
img.book-icon {
height: 1.5em;
width: 1.5em;
}
}
.book-search {
position: relative;
margin: $padding-16 0;
border-bottom: 1px solid transparent;
input {
width: 100%;
padding: $padding-8;
border: 0;
border-radius: $border-radius;
background: var(--gray-100);
color: var(--body-font-color);
&:required + .book-search-spinner {
display: block;
}
}
.book-search-spinner {
position: absolute;
top: 0;
margin: $padding-8;
margin-inline-start: calc(100% - #{$padding-16 + $padding-8});
width: $padding-16;
height: $padding-16;
border: $padding-1 solid transparent;
border-top-color: var(--body-font-color);
border-radius: 50%;
@include spin(1s);
}
small {
opacity: 0.5;
}
}
.book-toc {
flex: 0 0 $toc-width;
font-size: $font-size-12;
.book-toc-content {
width: $toc-width;
padding: $padding-16;
@include fixed;
}
img {
height: 1em;
width: 1em;
}
nav > ul > li:first-child {
margin-top: 0;
}
}
.book-footer {
padding-top: $padding-16;
font-size: $font-size-14;
img {
height: 1em;
width: 1em;
margin-inline-end: $padding-8;
}
}
.book-comments {
margin-top: $padding-16;
}
.book-languages {
margin-block-end: $padding-16 * 2;
.book-icon {
height: 1em;
width: 1em;
margin-inline-end: .5em;
}
ul {
padding-inline-start: 1.5em;
}
}
// Responsive styles
.book-menu-content,
.book-toc-content,
.book-page,
.book-header aside,
.markdown {
transition: 0.2s ease-in-out;
transition-property: transform, margin, opacity, visibility;
will-change: transform, margin, opacity;
}
@media screen and (max-width: $mobile-breakpoint) {
#menu-control,
#toc-control {
display: inline;
}
.book-menu {
visibility: hidden;
margin-inline-start: -$menu-width;
font-size: $font-size-base;
z-index: 1;
}
.book-toc {
display: none;
}
.book-header {
display: block;
}
#menu-control:focus ~ main label[for="menu-control"] {
@include outline;
}
#menu-control:checked ~ main {
.book-menu {
visibility: initial;
}
.book-menu .book-menu-content {
transform: translateX($menu-width);
box-shadow: 0 0 $padding-8 rgba(0, 0, 0, 0.1);
}
.book-page {
opacity: 0.25;
}
.book-menu-overlay {
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
}
#toc-control:focus ~ main label[for="toc-control"] {
@include outline;
}
#toc-control:checked ~ main {
.book-header aside {
display: block;
}
}
// for RTL support
body[dir="rtl"] #menu-control:checked ~ main {
.book-menu .book-menu-content {
transform: translateX(-$menu-width);
}
}
}
// Extra space for big screens
@media screen and (min-width: $container-max-width) {
.book-page,
.book-menu .book-menu-content,
.book-toc .book-toc-content {
padding: $padding-16 * 2 $padding-16;
}
}

212
assets/_markdown.scss Normal file
View file

@ -0,0 +1,212 @@
@import "variables";
.markdown {
line-height: 1.6;
// remove padding at the beginning of page
> :first-child {
margin-top: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: normal;
line-height: 1;
margin-top: 1.5em;
margin-bottom: $padding-16;
a.anchor {
opacity: 0;
font-size: 0.75em;
vertical-align: middle;
text-decoration: none;
}
&:hover a.anchor,
a.anchor:focus {
opacity: initial;
}
}
h4,
h5,
h6 {
font-weight: bolder;
}
h5 {
font-size: 0.875em;
}
h6 {
font-size: 0.75em;
}
b,
optgroup,
strong {
font-weight: bolder;
}
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
&:visited {
color: var(--color-visited-link);
}
}
img {
max-width: 100%;
height: auto;
}
code {
direction: ltr;
unicode-bidi: embed;
padding: 0 $padding-4;
background: var(--gray-200);
border-radius: $border-radius;
font-size: 0.875em;
}
pre {
direction: ltr;
unicode-bidi: embed;
padding: $padding-16;
background: var(--gray-100);
border-radius: $border-radius;
overflow-x: auto;
code {
padding: 0;
background: none;
}
}
p {
word-wrap: break-word;
}
blockquote {
margin: $padding-16 0;
padding: $padding-8 $padding-16 $padding-8 ($padding-16 - $padding-4); //to keep total left space 16dp
border-inline-start: $padding-4 solid var(--gray-200);
border-radius: $border-radius;
:first-child {
margin-top: 0;
}
:last-child {
margin-bottom: 0;
}
}
table {
overflow: auto;
display: block;
border-spacing: 0;
border-collapse: collapse;
margin-top: $padding-16;
margin-bottom: $padding-16;
tr th,
tr td {
padding: $padding-8 $padding-16;
border: $padding-1 solid var(--gray-200);
}
tr:nth-child(2n) {
background: var(--gray-100);
}
}
hr {
height: $padding-1;
border: none;
background: var(--gray-200);
}
ul,
ol {
padding-inline-start: $padding-16 * 2;
word-wrap: break-word;
}
dl {
dt {
font-weight: bolder;
margin-top: $padding-16;
}
dd {
margin-inline-start: 0;
margin-bottom: $padding-16;
}
}
// Special case for highlighted code with line numbers
.highlight {
direction: ltr;
unicode-bidi: embed;
border-radius: $border-radius;
overflow: hidden;
table tr {
td pre code > span {
display: flex;
}
td:nth-child(1) pre {
margin: 0;
padding-inline-end: 0;
}
td:nth-child(2) pre {
margin: 0;
padding-inline-start: 0;
}
}
}
details {
padding: $padding-16;
border: $padding-1 solid var(--gray-200);
border-radius: $border-radius;
summary {
line-height: 1;
padding: $padding-16;
margin: -$padding-16;
cursor: pointer;
}
&[open] summary {
margin-bottom: 0;
}
}
figure {
margin: $padding-16 0;
figcaption p {
margin-top: 0;
}
}
}
.markdown-inner {
// Util class to remove extra margin in nested markdown content
> :first-child {
margin-top: 0;
}
> :last-child {
margin-bottom: 0;
}
}

17
assets/_print.scss Normal file
View file

@ -0,0 +1,17 @@
@media print {
.book-menu,
.book-footer,
.book-toc {
display: none;
}
.book-header,
.book-header aside {
display: block;
}
main {
// Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=939897
display: block !important;
}
}

105
assets/_shortcodes.scss Normal file
View file

@ -0,0 +1,105 @@
.markdown {
// {{< expand "Label" "icon" >}}
.book-expand {
margin-top: $padding-16;
margin-bottom: $padding-16;
border: $padding-1 solid var(--gray-200);
border-radius: $border-radius;
overflow: hidden;
.book-expand-head {
background: var(--gray-100);
padding: $padding-8 $padding-16;
cursor: pointer;
}
.book-expand-content {
display: none;
padding: $padding-16;
}
input[type="checkbox"]:checked + .book-expand-content {
display: block;
}
}
// {{< tabs >}}
.book-tabs {
margin-top: $padding-16;
margin-bottom: $padding-16;
border: $padding-1 solid var(--gray-200);
border-radius: $border-radius;
overflow: hidden;
display: flex;
flex-wrap: wrap;
label {
display: inline-block;
padding: $padding-8 $padding-16;
border-bottom: $padding-1 transparent;
cursor: pointer;
}
.book-tabs-content {
order: 999; //Move content blocks to the end
width: 100%;
border-top: $padding-1 solid var(--gray-100);
padding: $padding-16;
display: none;
}
input[type="radio"]:checked + label {
border-bottom: $padding-1 solid var(--color-link);
}
input[type="radio"]:checked + label + .book-tabs-content {
display: block;
}
input[type="radio"]:focus + label {
@include outline;
}
}
// {{< columns >}}
.book-columns {
margin-left: -$padding-16;
margin-right: -$padding-16;
> div {
margin: $padding-16 0;
min-width: $body-min-width / 2;
padding: 0 $padding-16;
}
}
// {{< button >}}
a.book-btn {
display: inline-block;
font-size: $font-size-14;
color: var(--color-link);
line-height: $padding-16 * 2;
padding: 0 $padding-16;
margin: 0 $padding-4;
border: $padding-1 solid var(--color-link);
border-radius: $border-radius;
cursor: pointer;
&:hover {
text-decoration: none;
}
}
// {{< hint >}}
.book-hint {
@each $name, $color in $hint-colors {
&.#{$name} {
border-color: $color;
background-color: rgba($color, 0.1);
}
}
}
}

96
assets/_utils.scss Normal file
View file

@ -0,0 +1,96 @@
.flex {
display: flex;
}
.flex-auto {
flex: 1 1 auto;
}
.flex-even {
flex: 1 1;
}
.flex-wrap {
flex-wrap: wrap;
}
.justify-start {
justify-content: flex-start;
}
.justify-end {
justify-content: flex-end;
}
.justify-center {
justify-content: center;
}
.justify-between {
justify-content: space-between;
}
.align-center {
align-items: center;
}
.mx-auto {
margin: 0 auto;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-small {
font-size: .875em;
}
.hidden {
display: none;
}
input.toggle {
height: 0;
width: 0;
overflow: hidden;
opacity: 0;
position: absolute;
}
.clearfix::after {
content: "";
display: table;
clear: both;
}
@mixin spin($duration) {
animation: spin $duration ease infinite;
@keyframes spin {
100% {
transform: rotate(360deg);
}
}
}
@mixin fixed {
position: fixed;
top: 0;
bottom: 0;
overflow-x: hidden;
overflow-y: auto;
}
@mixin outline {
outline-style: auto;
outline-color: currentColor;
outline-color: -webkit-focus-ring-color;
}

3
assets/_variables.scss Normal file
View file

@ -0,0 +1,3 @@
/* You can override SASS variables here. */
// @import "plugins/dark";

15
assets/book.scss Normal file
View file

@ -0,0 +1,15 @@
@import "defaults";
@import "variables";
@import "themes/{{ default "light" .Site.Params.BookTheme }}";
@import "normalize";
@import "utils";
@import "main";
@import "fonts";
@import "print";
@import "markdown";
@import "shortcodes";
// Custom defined styles
@import "custom";

24
assets/clipboard.js Normal file
View file

@ -0,0 +1,24 @@
(function () {
function select(element) {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
}
document.querySelectorAll("pre code").forEach(code => {
code.addEventListener("click", function (event) {
if (window.getSelection().toString()) {
return;
}
select(code.parentElement);
if (navigator.clipboard) {
navigator.clipboard.writeText(code.parentElement.textContent);
}
});
});
})();

15
assets/manifest.json Normal file
View file

@ -0,0 +1,15 @@
{
"name": "{{ .Site.Title }}",
"short_name": "{{ .Site.Title }}",
"start_url": "{{ "./" | relURL }}",
"scope": "{{ "./" | relURL }}",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#000000",
"icons": [
{
"src": "{{ "./favicon.svg" | relURL }}",
"sizes": "512x512"
}
]
}

7
assets/menu-reset.js Normal file
View file

@ -0,0 +1,7 @@
(function() {
var menu = document.querySelector("aside .book-menu-content");
addEventListener("beforeunload", function(event) {
localStorage.setItem("menu.scrollTop", menu.scrollTop);
});
menu.scrollTop = localStorage.getItem("menu.scrollTop");
})();

6
assets/mermaid.json Normal file
View file

@ -0,0 +1,6 @@
{
"flowchart": {
"useMaxWidth":true
},
"theme": "default"
}

349
assets/normalize.css vendored Normal file
View file

@ -0,0 +1,349 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

View file

@ -0,0 +1,36 @@
$startLevel: 1;
$endLevel: 6;
.book-page .markdown.book-article {
@for $currentLevel from $startLevel through $endLevel {
> h#{$currentLevel} {
counter-increment: h#{$currentLevel};
counter-reset: h#{$currentLevel + 1};
$content: "";
@for $n from $startLevel through $currentLevel {
$content: $content + 'counter(h#{$n})"."';
}
&::before {
content: unquote($content) " ";
}
}
}
}
.book-toc nav#TableOfContents ul {
li {
counter-increment: item;
&:first-child {
counter-reset: item;
}
&:before {
content: counters(item, ".") ". ";
float: left;
margin-inline-end: $padding-4;
}
}
}

View file

@ -0,0 +1,26 @@
@import "defaults";
@import "variables";
// Webkit
::-webkit-scrollbar {
width: $padding-8;
}
::-webkit-scrollbar-thumb {
background: transparent;
border-radius: $padding-8;
}
:hover::-webkit-scrollbar-thumb {
background: var(--gray-500);
}
// MS
body {
-ms-overflow-style: -ms-autohiding-scrollbar;
}
// Future
.book-menu nav {
scrollbar-color: transparent var(--gray-500);
}

17
assets/search-data.json Normal file
View file

@ -0,0 +1,17 @@
[
{{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}}
{{- $pages = where $pages "Params.bookSearchExclude" "!=" true -}}
{{/* Remove until we know why it does not work, see https://github.com/alex-shpak/hugo-book/issues/528 */}}
{{/*- $pages = where $pages "Content" "not in" (slice nil "") -*/}}
{{- $pages = where $pages "Content" "!=" "" -}}
{{ range $index, $page := $pages }}
{{ if gt $index 0}},{{end}} {
"id": {{ $index }},
"href": "{{ $page.RelPermalink }}",
"title": {{ (partial "docs/title" $page) | jsonify }},
"section": {{ (partial "docs/title" $page.Parent) | jsonify }},
"content": {{ $page.Plain | jsonify }}
}
{{- end -}}
]

113
assets/search.js Normal file
View file

@ -0,0 +1,113 @@
'use strict';
{{ $searchDataFile := printf "%s.search-data.json" .Language.Lang }}
{{ $searchData := resources.Get "search-data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify | resources.Fingerprint }}
{{ $searchConfig := i18n "bookSearchConfig" | default "{}" }}
(function () {
const searchDataURL = '{{ $searchData.RelPermalink }}';
const indexConfig = Object.assign({{ $searchConfig }}, {
includeScore: true,
useExtendedSearch: true,
fieldNormWeight: 1.5,
threshold: 0.2,
ignoreLocation: true,
keys: [
{
name: 'title',
weight: 0.7
},
{
name: 'content',
weight: 0.3
}
]
});
const input = document.querySelector('#book-search-input');
const results = document.querySelector('#book-search-results');
if (!input) {
return
}
input.addEventListener('focus', init);
input.addEventListener('keyup', search);
document.addEventListener('keypress', focusSearchFieldOnKeyPress);
/**
* @param {Event} event
*/
function focusSearchFieldOnKeyPress(event) {
if (event.target.value !== undefined) {
return;
}
if (input === document.activeElement) {
return;
}
const characterPressed = String.fromCharCode(event.charCode);
if (!isHotkey(characterPressed)) {
return;
}
input.focus();
event.preventDefault();
}
/**
* @param {String} character
* @returns {Boolean}
*/
function isHotkey(character) {
const dataHotkeys = input.getAttribute('data-hotkeys') || '';
return dataHotkeys.indexOf(character) >= 0;
}
function init() {
input.removeEventListener('focus', init); // init once
input.required = true;
fetch(searchDataURL)
.then(pages => pages.json())
.then(pages => {
window.bookSearchIndex = new Fuse(pages, indexConfig);
})
.then(() => input.required = false)
.then(search);
}
function search() {
while (results.firstChild) {
results.removeChild(results.firstChild);
}
if (!input.value) {
return;
}
const searchHits = window.bookSearchIndex.search(input.value).slice(0,10);
searchHits.forEach(function (page) {
const li = element('<li><a href></a><small></small></li>');
const a = li.querySelector('a'), small = li.querySelector('small');
a.href = page.item.href;
a.textContent = page.item.title;
small.textContent = page.item.section;
results.appendChild(li);
});
}
/**
* @param {String} content
* @returns {Node}
*/
function element(content) {
const div = document.createElement('div');
div.innerHTML = content;
return div.firstChild;
}
})();

7
assets/sw-register.js Normal file
View file

@ -0,0 +1,7 @@
{{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}}
if (navigator.serviceWorker) {
navigator.serviceWorker.register(
"{{ $swJS.RelPermalink }}",
{ scope: "{{ "./" | relURL }}" }
);
}

55
assets/sw.js Normal file
View file

@ -0,0 +1,55 @@
const cacheName = self.location.pathname
const pages = [
{{ if eq .Site.Params.BookServiceWorker "precache" }}
{{ range .Site.AllPages -}}
"{{ .RelPermalink }}",
{{ end -}}
{{ end }}
];
self.addEventListener("install", function (event) {
self.skipWaiting();
caches.open(cacheName).then((cache) => {
return cache.addAll(pages);
});
});
self.addEventListener("fetch", (event) => {
const request = event.request;
if (request.method !== "GET") {
return;
}
/**
* @param {Response} response
* @returns {Promise<Response>}
*/
function saveToCache(response) {
if (cacheable(response)) {
return caches
.open(cacheName)
.then((cache) => cache.put(request, response.clone()))
.then(() => response);
} else {
return response;
}
}
/**
* @param {Error} error
*/
function serveFromCache(error) {
return caches.open(cacheName).then((cache) => cache.match(request.url));
}
/**
* @param {Response} response
* @returns {Boolean}
*/
function cacheable(response) {
return response.type === "basic" && response.ok && !response.headers.has("Content-Disposition")
}
event.respondWith(fetch(request).then(saveToCache).catch(serveFromCache));
});

9
assets/themes/_auto.scss Normal file
View file

@ -0,0 +1,9 @@
:root {
@include theme-light;
}
@media (prefers-color-scheme: dark) {
:root {
@include theme-dark;
}
}

3
assets/themes/_dark.scss Normal file
View file

@ -0,0 +1,3 @@
:root {
@include theme-dark;
}

View file

@ -0,0 +1,3 @@
:root {
@include theme-light;
}

131
hugo.toml
View file

@ -1,53 +1,94 @@
baseurl = "https://aethrvmn.gr"
enableEmoji = true
footnotereturnlinkcontents = "↩"
ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"]
languageCode = "en-us"
title = "aethrvmn"
baseURL = 'https://aethrvmn.gr/'
title = 'aethrvmn'
# Book configuration
enableGitInfo = true
# (Optional) Theme is intended for documentation use, therefore it doesn't render taxonomy.
# You can remove related files with config below
disableKinds = ['taxonomy']
# Needed for mermaid/katex shortcodes
[markup]
[markup.goldmark.renderer]
unsafe = true
unsafe = true
[markup.highlight]
anchorLineNos = false
codeFences = true
guessSyntax = false
hl_Lines = ""
lineAnchors = ""
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
style = "monokai"
tabWidth = 4
[markup.tableOfContents]
startLevel = 1
[[menu.main]]
name = "misc"
url = "/misc/"
weight = 1
# Multi-lingual mode config
# There are different options to translate files
# See https://gohugo.io/content-management/multilingual/#translation-by-filename
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
[languages]
[languages.en]
languageName = 'English'
contentDir = 'content'
weight = 1
[[menu.main]]
name = "setup"
url = "/setup/"
weight = 2
[[menu.before]]
name="cv"
url="/pdf/cv.pdf"
weight=10
[[menu.main]]
name = "license"
url = "/license/"
weight = 3
[[menu.main]]
name = "cv"
url = "/pdf/CV.pdf"
weight = 100
[[menu.feed]]
name = "contact"
url = "mailto:aethrvmn@apotheke.earth"
[[menu.after]]
name="the dont be evil licence"
url="/license"
weight=10
[params]
custom_css = ["css/theme-override.css"]
description = "A simple, minimal, personal website, based on the hugo-classic theme."
footer = """
[github/aethrvmn](https://github.com/aethrvmn) | [sr.ht:~aethrvmn](https://sr.ht/~aethrvmn) | [@aethrvmn@sigmoid.social](https://sigmoid.social/@aethrvmn) | [t.me/aethrvmn](https://t.me/aethrvmn)
"""
# (Optional, default light) Sets color theme: light, dark or auto.
# Theme 'auto' switches between dark and light modes based on browser/os preferences
BookTheme = 'auto'
# (Optional, default true) Controls table of contents visibility on right side of pages.
# Start and end levels can be controlled with markup.tableOfContents setting.
# You can also specify this parameter per page in front matter.
BookToC = false
# (Optional, default favicon.png) Set the path to a favicon file.
# If the favicon is /static/favicon.png then the path would be favicon.png
BookFavicon = 'favicon.ico'
# (Optional, default none) Set the path to a logo for the book.
# If the logo is /static/logo.png then the path would be logo.png
BookLogo = 'logo.png'
# (Optional, default docs) Specify root page to render child pages as menu.
# Page is resoled by .GetPage function: https://gohugo.io/functions/getpage/
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
BookSection = '/'
# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
BookRepo = 'https://git.apotheke.earth/aethrvmn/home'
# (Optional, default 'commit') Specifies commit portion of the link to the page's last modified
# commit hash for 'doc' page type.
# Requires 'BookRepo' param.
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
# Github uses 'commit', Bitbucket uses 'commits'
BookCommitPath = 'commit'
# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Edit path must point to root directory of repo.
# BookEditPath = 'edit/main/exampleSite'
# (Optional, default true) Enables search function with flexsearch,
# Index is built on fly, therefore it might slowdown your website.
# Configuration for indexing can be adjusted in i18n folder per language.
BookSearch = false
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
# Theme will print warning if page referenced in markdown does not exists.
BookPortableLinks = true
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
BookServiceWorker = true
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
BookTranslatedOnly = false

View file

@ -1,6 +1,34 @@
{{ partial "header.html" . }}
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">
<div style="padding-top:100px;padding-bottom:100px;">404 - You have reached a page that doesn't exist.</div>
<head>
{{ partial "docs/html-head" . }}
{{ partial "docs/inject/head" . }}
<style>
.not-found {
text-align: center;
}
.not-found h1 {
margin: .25em 0 0 0;
opacity: .25;
font-size: 40vmin;
}
</style>
</head>
{{ partial "footer.html" . }}
<body>
<main class="flex justify-center not-found">
<div>
<h1>404</h1>
<h2>Page Not Found</h2>
<h3>
<a href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a>
</h3>
</div>
</main>
{{ partial "docs/inject/body" . }}
</body>
</html>

View file

@ -0,0 +1,4 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
{{ .Text | safeHTML }}
<a class="anchor" href="#{{ .Anchor | safeURL }}">#</a>
</h{{ .Level }}>

View file

@ -0,0 +1,19 @@
{{- if .Page.Site.Params.BookPortableLinks -}}
{{- template "portable-image" . -}}
{{- else -}}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }}title="{{ . }}"{{ end }}/>
{{- end -}}
{{- define "portable-image" -}}
{{- $isRemote := or (in .Destination "://") (strings.HasPrefix .Destination "//") }}
{{- if not $isRemote }}
{{- $path := print .Page.File.Dir .Destination }}
{{- if strings.HasPrefix .Destination "/" }}
{{- $path = print "/static" .Destination }}
{{- end }}
{{- if not (fileExists $path) }}
{{- warnf "Image '%s' not found in '%s'" .Destination .Page.File }}
{{- end }}
{{- end }}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }}title="{{ . }}"{{ end }}/>
{{- end -}}

View file

@ -1 +1,29 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if or (strings.HasPrefix .Destination "http") (strings.HasSuffix .Destination "pdf") }} target="_blank" rel="me"{{ end }}>{{ .Text | safeHTML }}</a>
{{- if .Page.Site.Params.BookPortableLinks -}}
{{- template "portable-link" . -}}
{{- else -}}
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
{{- end -}}
{{- define "portable-link" -}}
{{- $destination := .Destination }}
{{- $isRemote := or (in .Destination ":") (strings.HasPrefix .Destination "//") }}
{{- if not $isRemote }}
{{- $url := urls.Parse .Destination }}
{{- $path := strings.TrimSuffix "/_index.md" $url.Path }}
{{- $path = strings.TrimSuffix "/_index" $path }}
{{- $path = strings.TrimSuffix ".md" $path }}
{{- $page := .Page.GetPage $path }}
{{- if $page }}
{{- $destination = $page.RelPermalink }}
{{- if $url.Fragment }}
{{- $destination = print $destination "#" $url.Fragment }}
{{- end }}
{{- else if fileExists (print .Page.File.Dir .Destination) }}
<!-- Nothing -->
{{- else -}}
{{- warnf "Page '%s' not found in '%s'" .Destination .Page.File }}
{{- end }}
{{- end }}
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if or (strings.HasPrefix .Destination "http") (strings.HasSuffix .Destination "pdf") }} target="_blank" rel="me"{{ end }} style="color:#AC9C6D">{{ .Text | safeHTML }}</a>
{{- end -}}

View file

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="{{ default .Site.Language.Lang .Site.LanguageCode }}" dir="{{ default "ltr" .Site.Language.LanguageDirection }}">
<head>
{{ partial "docs/html-head" . }}
{{ partial "docs/inject/head" . }}
</head>
<body dir="{{ default "ltr" .Site.Language.LanguageDirection }}">
<input type="checkbox" class="hidden toggle" id="menu-control" />
<input type="checkbox" class="hidden toggle" id="toc-control" />
<main class="container flex">
<aside class="book-menu">
<div class="book-menu-content">
{{ template "menu" . }} <!-- Left menu Content -->
</div>
</aside>
<div class="book-page">
<header class="book-header">
{{ template "header" . }} <!-- Mobile layout header -->
</header>
{{ partial "docs/inject/content-before" . }}
{{ template "main" . }} <!-- Page Content -->
{{ partial "docs/inject/content-after" . }}
<footer class="book-footer">
{{ template "footer" . }} <!-- Footer under page content -->
{{ partial "docs/inject/footer" . }}
</footer>
{{ template "comments" . }} <!-- Comments block -->
<label for="menu-control" class="hidden book-menu-overlay"></label>
</div>
{{ if default true (default .Site.Params.BookToC .Params.BookToC) }}
<aside class="book-toc">
<div class="book-toc-content">
{{ template "toc" . }} <!-- Table of Contents -->
</div>
</aside>
{{ end }}
</main>
{{ partial "docs/inject/body" . }}
</body>
</html>
{{ define "menu" }}
{{ partial "docs/menu" . }}
{{ end }}
{{ define "header" }}
{{ partial "docs/header" . }}
{{ if default true (default .Site.Params.BookToC .Params.BookToC) }}
<aside class="hidden clearfix">
{{ template "toc" . }}
</aside>
{{ end }}
{{ end }}
{{ define "footer" }}
{{ partial "docs/footer" . }}
{{ end }}
{{ define "comments" }}
{{ if and .Content (default true (default .Site.Params.BookComments .Params.BookComments)) }}
<div class="book-comments">
{{- partial "docs/comments" . -}}
</div>
{{ end }}
{{ end }}
{{ define "main" }}
<article class="markdown book-article">
{{- .Content -}}
</article>
{{ end }}
{{ define "toc" }}
{{ partial "docs/toc" . }}
{{ end }}

View file

@ -1,25 +1 @@
{{ partial "header.html" . }}
<div class="content-wrapper">
{{if not .IsHome }}
<h1>{{ .Title | markdownify }}</h1>
{{ end }}
{{ .Content }}
<!--
{{if not .IsHome }}
<ul>
{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ range (where $pages "Section" "!=" "") }}
<li>
<span class="date">{{ .Date.Format "2006/01/02" }}</span>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{ end }}
-->
</div>
{{ partial "footer.html" . }}
{{ define "dummy" }}{{ end }}

View file

@ -1,30 +1 @@
{{ partial "header.html" . }}
<div class="article-meta">
<h1><span class="title">{{ .Title | markdownify }}</span></h1>
{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
{{ if .Params.date }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }}
<p class="terms">
{{ range $i := (slice "categories" "tags") }}
{{ with ($.Param $i) }}
{{ $i | title }}: {{ range $k := . }}<a href="{{ relURL (print "/" $i "/" $k | urlize) }}">{{$k}}</a> {{ end }}
{{ end }}
{{ end }}
</p>
</div>
{{ if .Params.toc }}
{{ with .TableOfContents }}
<div id="table-of-contents">
<h2>Table of Contents</h2>
{{ . | safeHTML }}
</div>
{{ end }}
{{ end }}
<div class="content-wrapper">
<main>
{{ .Content }}
<a href="/"> >> Home</a>
</main>
</div>
{{ partial "footer.html" . }}
{{ define "dummy" }}{{ end }}

View file

@ -1,13 +0,0 @@
{{ partial "header.html" . }}
<h1>{{ .Title }}</h1>
<ul class="terms">
{{ range .Data.Terms }}
<li>
<a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> ({{ .Count }})
</li>
{{ end }}
</ul>
{{ partial "footer.html" . }}

View file

@ -0,0 +1,8 @@
<h2 class="book-brand">
<a class="flex align-center" href="{{ cond (not .Site.Home.File) .Sites.First.Home.RelPermalink .Site.Home.RelPermalink }}">
{{- with .Site.Params.BookLogo -}}
<img src="{{ . | relURL }}" alt="Logo" />
{{- end -}}
<span>{{ .Site.Title }}</span>
</a>
</h2>

View file

@ -0,0 +1,2 @@
<!-- This partial can be replaced to support other commenting engines -->
{{ template "_internal/disqus.html" . }}

View file

@ -0,0 +1,6 @@
<!--
Returns formatted date.
Usage: partial "docs/date" (dict "Date" .Date "Format" .Site.Params.BookDateFormat)
-->
{{- $format := default "January 2, 2006" .Format -}}
{{- return (time.Format $format .Date) -}}

View file

@ -0,0 +1,27 @@
<div class="flex flex-wrap justify-between">
<div class="info-container">
<div class="commit-info">
<span>Page last edited on {{ .GitInfo.CommitDate.Format "02/01/2006" }}</span>
<br/>
<span>
title: {{ .GitInfo.Subject }}
</span>
<br/>
<span>
commit: <a href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookCommitPath }}/{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a>
</span>
<br/>
<span>
author: {{ .GitInfo.AuthorName }}
</span>
<br/>
<span>
<{{ .GitInfo.AuthorEmail }}>
</div>
</div>
{{ $script := resources.Get "clipboard.js" | resources.Minify }}
{{ with $script.Content }}
<script>{{ . | safeJS }}</script>
{{ end }}

View file

@ -0,0 +1,11 @@
<div class="flex align-center justify-between">
<label for="menu-control">
<img src="{{ "svg/menu.svg" | relURL }}" class="book-icon" alt="Menu" />
</label>
<label for="toc-control">
{{ if default true (default .Site.Params.BookToC .Params.BookToC) }}
<img src="{{ "svg/toc.svg" | relURL }}" class="book-icon" alt="Table of Contents" />
{{ end }}
</label>
</div>

View file

@ -0,0 +1 @@
{{ partial "docs/title" . }} | {{ .Site.Title -}}

View file

@ -0,0 +1,60 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ default .Summary .Description }}">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#343a40">
<meta name="color-scheme" content="light dark">
{{- with .Page.Params.BookHref -}}
<meta http-equiv="Refresh" content="0; url='{{ . }}'" />
{{- end -}}
{{- template "_internal/opengraph.html" . -}}
<title>{{ partial "docs/html-head-title" . }}</title>
{{- $manifest := resources.Get "manifest.json" | resources.ExecuteAsTemplate "manifest.json" . }}
<link rel="manifest" href="{{ $manifest.RelPermalink }}">
<link rel="icon" href="{{ .Site.Params.BookFavicon | default "favicon.png" | relURL }}" >
<link rel="canonical" href="{{ .Permalink }}">
{{- range .Translations }}
<link rel="alternate" hreflang="{{ default .Language.Lang .Site.LanguageCode }}" href="{{ .Permalink }}" title="{{ partial "docs/title" . }}">
{{- end -}}
<!-- GFS Didot font -->
<link href="https://fonts.googleapis.com/css2?family=GFS+Didot&display=swap" rel="stylesheet" type="text/css">
<!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website -->
{{- $styles := resources.Get "book.scss" | resources.ExecuteAsTemplate "book.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" {{ template "integrity" $styles }}>
{{- if default true .Site.Params.BookSearch -}}
{{- $searchJSFile := printf "%s.search.js" .Language.Lang }}
{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }}
<script defer src="{{ "fuse.min.js" | relURL }}"></script>
<script defer src="{{ $searchJS.RelPermalink }}" {{ template "integrity" $searchJS }}></script>
{{ end -}}
{{- if .Site.Params.BookServiceWorker -}}
{{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }}
<script defer src="{{ $swJS.RelPermalink }}" {{ template "integrity" $swJS }}></script>
{{ end -}}
{{- template "_internal/google_analytics.html" . -}}
<!-- RSS -->
{{- with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ "<!--" | safeHTML }}
Made with Book Theme
https://github.com/alex-shpak/hugo-book
{{ "-->" | safeHTML }}
{{- define "integrity" -}}
{{- if (urls.Parse .Permalink).Host -}}
integrity="{{ .Data.Integrity }}" crossorigin="anonymous"
{{- end -}}
{{- end -}}

View file

View file

View file

@ -0,0 +1,33 @@
<!-- Merge home and current page translations -->
{{ $bookTranslatedOnly := default false .Site.Params.BookTranslatedOnly }}
{{ $translations := dict }}
{{ if (eq $bookTranslatedOnly false ) }}
{{ range .Site.Home.Translations }}
{{ $translations = merge $translations (dict .Language.Lang .) }}
{{ end }}
{{ end }}
{{ range .Translations }}
{{ $translations = merge $translations (dict .Language.Lang .) }}
{{ end }}
<ul class="book-languages">
<li>
<input type="checkbox" id="languages" class="toggle" />
<label for="languages" class="flex justify-between">
<a role="button" class="flex align-center">
<img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" />
{{ $.Site.Language.LanguageName }}
</a>
</label>
<ul>
{{ range .Site.Languages }}{{ with index $translations .Lang }}
<li>
<a href="{{ .Permalink }}">
{{ .Language.LanguageName }}
</a>
</li>
{{ end }}{{ end }}
</ul>
</li>
</ul>

View file

@ -0,0 +1,5 @@
{{ with .Site.GetPage .Site.Params.BookMenuBundle }}
{{- $href := printf "href=\"%s\"" $.RelPermalink -}}
{{- replace .Content $href (print $href "class=active") | safeHTML -}}
{{- warnf "Bundle menu mode is deprecated and will be removed" -}}
{{ end }}

View file

@ -0,0 +1,49 @@
{{ $bookSection := default "docs" .Site.Params.BookSection }}
{{ if eq $bookSection "*" }}
{{ $bookSection = "/" }}{{/* Backward compatibility */}}
{{ end }}
{{ with .Site.GetPage $bookSection }}
{{ template "book-section-children" (dict "Section" . "CurrentPage" $) }}
{{ end }}
{{ define "book-section-children" }}{{/* (dict "Section" .Section "CurrentPage" .CurrentPage) */}}
<ul>
{{ range (where .Section.Pages "Params.bookhidden" "ne" true) }}
{{ if .IsSection }}
<li {{- if .Params.BookFlatSection }} class="book-section-flat" {{ end -}}>
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
{{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }}
</li>
{{ else if and .IsPage .Content }}
<li>
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}
{{ define "book-page-link" }}{{/* (dict "Page" .Page "CurrentPage" .CurrentPage) */}}
{{ $current := eq .CurrentPage .Page }}
{{ $ancestor := .Page.IsAncestor .CurrentPage }}
{{ if .Page.Params.BookCollapseSection }}
<input type="checkbox" id="section-{{ md5 .Page }}" class="toggle" {{ if or $current $ancestor }}checked{{ end }} />
<label for="section-{{ md5 .Page }}" class="flex justify-between">
<a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}}
</a>
</label>
{{ else if .Page.Params.BookHref }}
<a href="{{ .Page.Params.BookHref }}" class="{{ if $current }}active{{ end }}" target="_blank" rel="noopener">
{{- partial "docs/title" .Page -}}
</a>
{{ else if .Page.Content }}
<a href="{{ .Page.RelPermalink }}" class="{{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}}
</a>
{{ else }}
<span>{{- partial "docs/title" .Page -}}</span>
{{ end }}
{{ end }}

View file

@ -0,0 +1,28 @@
<!--
This is template for hugo menus, accepts MenuEntity as context
https://gohugo.io/variables/menus/
-->
{{ if . }}
{{ template "book-menu-hugo" . }}
{{ end }}
{{ define "book-menu-hugo" }}
<ul>
{{ range . }}
<li>
<a href="{{ .URL }}" {{ with .Params.class }}class="{{ . }}"{{ end }} {{ if not .Page }}target="_blank" rel="noopener"{{ end }}>
{{- .Pre -}}
{{ with .Page }}
{{ partial "docs/title" .Page }}
{{ else }}
{{ .Name }}
{{ end }}
{{- .Post -}}
</a>
{{- with .Children }}
{{ template "book-menu-hugo" . }}
{{- end }}
</li>
{{ end }}
</ul>
{{ end }}

View file

@ -0,0 +1,25 @@
<nav>
{{ partial "docs/brand" . }}
{{ partial "docs/search" . }}
{{ partial "docs/inject/menu-before" . }}
{{ partial "docs/menu-hugo" .Site.Menus.before }}
{{ if .Site.Params.BookMenuBundle }}
{{ partial "docs/menu-bundle" . }}
{{ else }}
{{ partial "docs/menu-filetree" . }}
{{ end }}
<div class="book-menu-bot">
{{ partial "docs/menu-hugo" .Site.Menus.after }}
{{ partial "docs/inject/menu-after" . }}
</div>
</nav>
<!-- Restore menu position as soon as possible to avoid flickering -->
{{ $script := resources.Get "menu-reset.js" | resources.Minify }}
{{ with $script.Content }}
<script>{{ . | safeJS }}</script>
{{ end }}

View file

@ -0,0 +1,23 @@
{{ with .Date }}
<h5>{{ partial "docs/date" (dict "Date" . "Format" $.Site.Params.BookDateFormat) }}</h5>
{{ end }}
{{ range $taxonomy, $_ := .Site.Taxonomies }}
{{ with $terms := $.GetTerms $taxonomy }}
<div>
{{ range $n, $term := $terms }}{{ if $n }}, {{ end }}
<a href="{{ $term.RelPermalink }}">{{ $term.Title }}</a>
{{- end }}
</div>
{{ end }}
{{ end }}
{{ if .Params.image }}
<p>
{{ with .Resources.GetMatch .Params.image }}
<img src={{ .RelPermalink }} />
{{ else }}
<img src={{ .Params.image | relURL }} />
{{ end }}
</p>
{{ end }}

View file

@ -0,0 +1,8 @@
{{ if default true .Site.Params.BookSearch }}
<div class="book-search hidden">
<input type="text" id="book-search-input" placeholder="{{ i18n "Search" }}" aria-label="{{ i18n "Search" }}" maxlength="64" data-hotkeys="s/" />
<div class="book-search-spinner hidden"></div>
<ul id="book-search-results"></ul>
</div>
<script>document.querySelector(".book-search").classList.remove("hidden")</script>
{{ end }}

View file

@ -0,0 +1,19 @@
<nav>
<ul>
{{ range $term, $_ := .Site.Taxonomies }}
{{ with $.Site.GetPage (printf "/%s" $term | urlize) }}
<li class="book-section-flat">
<strong>{{ .Title | title }}</strong>
<ul>
{{ range .Pages }}
<li class="flex justify-between">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<span>{{ len .Pages }}</span>
</li>
{{ end }}
</ul>
</li>
{{ end }}
{{ end }}
</ul>
</nav>

View file

@ -0,0 +1,17 @@
<!--
Partial to generate page name from Title or File name.
Accepts Page as context
-->
{{ $title := "" }}
{{ if .LinkTitle }}
{{ $title = .LinkTitle }}
{{ else if .Title }}
{{ $title = .Title }}
{{ else if and .IsSection .File }}
{{ $title = path.Base .File.Dir | humanize | title }}
{{ else if and .IsPage .File }}
{{ $title = .File.BaseFileName | humanize | title }}
{{ end }}
{{ return $title }}

View file

@ -0,0 +1,3 @@
{{ partial "docs/inject/toc-before" . }}
{{ .TableOfContents }}
{{ partial "docs/inject/toc-after" . }}

View file

@ -1 +0,0 @@

View file

@ -1,35 +0,0 @@
<footer>
{{ partial "foot_custom.html" . }}
<!-- Automagically centers images. Original Author Yihui Xie: https://yihui.name -->
<script>
(function() {
function center_el(tagName) {
var tags = document.getElementsByTagName(tagName), i, tag;
for (i = 0; i < tags.length; i++) {
tag = tags[i];
var parent = tag.parentElement;
// center an image if it is the only element of its parent
if (parent.childNodes.length === 1) {
// if there is a link on image, check grandparent
if (parent.nodeName === 'A') {
parent = parent.parentElement;
if (parent.childNodes.length != 1) continue;
}
if (parent.nodeName === 'P') parent.style.textAlign = 'center';
}
}
}
var tagNames = ['img', 'embed', 'object'];
for (var i = 0; i < tagNames.length; i++) {
center_el(tagNames[i]);
}
})();
</script>
{{ with .Site.Params.footer }}
<hr/>
{{ . | markdownify }}
{{ end }}
</footer>
</body>
</html>

View file

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
<link rel="manifest" href="/images/site.webmanifest">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
<title>{{ .Title }} | {{ .Site.Title }}</title>
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}" />
<link rel="stylesheet" href="{{ "/css/fonts.css" | relURL }}" />
{{ range .Site.Params.custom_css -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
{{ partial "head_custom.html" . }}
</head>
<body>
<header>
<nav>
<ul>
{{ $title := lower .Title }}
{{ $section := lower .Section }}
<li class="pull-left {{ if .IsHome }}current{{ end }}">
<a href="{{ .Site.BaseURL }}">~/home</a>
</li>
{{ range .Site.Menus.main }}
{{ $name := lower .Name }}
<li class="pull-left {{ if eq $name $title }}current{{ else if eq $section $name }}current{{ else if eq $title (pluralize $name) }}current{{ end }}">
<a href="{{ .URL }}" target="{{ if gt .Weight 3 }}_blank{{ end }}">~/{{ lower .Name }}</a>
</li>
{{end}}
{{ range .Site.Menus.feed }}
{{ $name := lower .Name}}
<li class="pull-right">
<a href="{{ .URL }}">~/{{ lower .Name}}</a>
</li>
{{end}}
</ul>
</nav>
</header>

22
layouts/posts/list.html Normal file
View file

@ -0,0 +1,22 @@
{{ define "main" }}
{{ range sort .Paginator.Pages }}
<article class="markdown book-post">
<h2>
<a href="{{ .RelPermalink }}">{{ partial "docs/title.html" . }}</a>
</h2>
{{ partial "docs/post-meta" . }}
<p>
{{- .Summary -}}
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">...</a>
{{ end }}
</p>
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
{{ end }}
{{ define "toc" }}
{{ partial "docs/taxonomy" . }}
{{ end }}

13
layouts/posts/single.html Normal file
View file

@ -0,0 +1,13 @@
{{ define "main" }}
<article class="markdown book-post">
<h1>
<a href="{{ .RelPermalink }}">{{ partial "docs/title.html" . }}</a>
</h1>
{{ partial "docs/post-meta" . }}
{{- .Content -}}
</article>
{{ end }}
{{ define "toc" }}
{{ partial "docs/toc" . }}
{{ end }}

View file

@ -1,4 +0,0 @@
# robots.txt
User-agent: *
Disallow:
Disallow: /cgi-bin/

View file

@ -0,0 +1,12 @@
{{ $ref := "" }}
{{ $target := "" }}
{{ with .Get "href" }}
{{ $ref = . }}
{{ $target = "_blank" }}
{{ end }}
{{ with .Get "relref" }}
{{ $ref = relref $ . }}
{{ end }}
<a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" rel="noopener" {{ end }} class="book-btn{{ with .Get "class" }} {{ . }}{{ end }}">
{{ .Inner | .Page.RenderString }}
</a>

View file

@ -0,0 +1,7 @@
<div class="book-columns flex flex-wrap">
{{ range split .Inner "<--->" }}
<div class="flex-even markdown-inner">
{{ . | $.Page.RenderString }}
</div>
{{ end }}
</div>

View file

@ -0,0 +1,7 @@
<details {{ if or (.Get "open") (in .Params "open") }}open{{ end }}>
{{- $summary := cond .IsNamedParams (.Get "title") (.Get 0) -}}
<summary>{{ $summary | .Page.RenderString }}</summary>
<div class="markdown-inner">
{{ .Inner | .Page.RenderString }}
</div>
</details>

View file

@ -0,0 +1,13 @@
{{ warnf "Expand shortcode is deprecated. Use 'details' instead." }}
<div class="book-expand">
<label>
<div class="book-expand-head flex justify-between">
<span>{{ default (i18n "Expand") (.Get 0) }}</span>
<span>{{ default "↕" (.Get 1) }}</span>
</div>
<input type="checkbox" class="hidden" />
<div class="book-expand-content markdown-inner">
{{ .Inner | markdownify }}
</div>
</label>
</div>

View file

@ -0,0 +1,3 @@
<blockquote class="book-hint {{ .Get 0 }}">
{{ .Inner | .Page.RenderString }}
</blockquote>

View file

@ -0,0 +1 @@
{{- .Inner -}}

View file

@ -0,0 +1,13 @@
{{- if not (.Page.Scratch.Get "katex") -}}
<!-- Include katex only first time -->
<link rel="stylesheet" href="{{ "katex/katex.min.css" | relURL }}" />
<script defer src="{{ "katex/katex.min.js" | relURL }}"></script>
<script defer src="{{ "katex/auto-render.min.js" | relURL }}" onload="renderMathInElement(document.body);"></script>
{{- .Page.Scratch.Set "katex" true -}}
{{- end -}}
<span {{- with .Get "class" }} class="{{ . }}"{{ end }}>
{{ with .Get "display" }}\[{{else}}\({{end}}
{{- trim .Inner "\n" -}}
{{ with .Get "display" }}\]{{else}}\){{end}}
</span>

View file

@ -0,0 +1,12 @@
{{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time -->
<script src="{{ "mermaid.min.js" | relURL }}"></script>
{{ with resources.Get "mermaid.json" }}
<script>mermaid.initialize({{ .Content | safeJS }})</script>
{{ end }}
{{ .Page.Scratch.Set "mermaid" true }}
{{ end }}
<p class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
{{- .Inner -}}
</p>

View file

@ -0,0 +1,12 @@
<dl>
{{ range .Page.Pages }}
<dt>
<a href="{{ .RelPermalink }}">{{ partial "docs/title" . }}</a>
</dt>
{{ if (in $.Params "summary") -}}
<dd class="markdown-inner">
{{ default .Summary .Description }}
</dd>
{{ end -}}
{{ end }}
</dl>

View file

@ -0,0 +1,12 @@
{{ if .Parent }}
{{ $name := .Get 0 }}
{{ $group := printf "tabs-%s" (.Parent.Get 0) }}
{{ if not (.Parent.Scratch.Get $group) }}
{{ .Parent.Scratch.Set $group slice }}
{{ end }}
{{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }}
{{ else }}
{{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }}
{{ end}}

View file

@ -0,0 +1,15 @@
{{ if .Inner }}{{ end }}
{{ $id := .Get 0 }}
{{ $group := printf "tabs-%s" $id }}
<div class="book-tabs">
{{- range $index, $tab := .Scratch.Get $group -}}
<input type="radio" class="toggle" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
<label for="{{ printf "%s-%d" $group $index }}">
{{- $tab.Name -}}
</label>
<div class="book-tabs-content markdown-inner">
{{- .Content | $.Page.RenderString -}}
</div>
{{- end -}}
</div>

View file

@ -0,0 +1,13 @@
{{ define "main" }}
<article class="markdown book-post">
<h1>{{ .Title | title }}</h1>
{{ $taxonomies := index .Site.Taxonomies .Page.Type }}
{{ range $taxonomies }}
<div><a href="{{ .Page.Permalink }}">{{ .Page.Title }} <sup>{{ .Count }}</sup></a></div>
{{ end }}
</article>
{{ end }}
{{ define "toc" }}
{{ partial "docs/taxonomy" . }}
{{ end }}

View file

@ -0,0 +1,22 @@
{{ define "main" }}
{{ range sort .Paginator.Pages }}
<article class="markdown book-post">
<h2>
<a href="{{ .RelPermalink }}">{{ partial "docs/title.html" . }}</a>
</h2>
{{ partial "docs/post-meta" . }}
<p>
{{- .Summary -}}
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">...</a>
{{ end }}
</p>
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
{{ end }}
{{ define "toc" }}
{{ partial "docs/taxonomy" . }}
{{ end }}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"Target":"book.min.684ba920724c377d882d9e7e8d3965eaf937fb9bd89f720712de3ea82210b3ba.css","MediaType":"text/css","Data":{"Integrity":"sha256-aEupIHJMN32ILZ5+jTll6vk3+5vYn3IHEt4+qCIQs7o="}}

View file

@ -1,34 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=GFS+Didot&display=swap');
html {
font-family:
'GFS Didot',
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol';
}
@supports (font-variation-settings: normal) {
html { font-family:
'GFS Didot',
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol';
}
}
code {
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Helvetica,
Arial,
sans-serif,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol";
font-size: 85%;
}

View file

@ -1,187 +0,0 @@
/* dark mode */
@media (prefers-color-scheme: dark) {
html{
background-color: #2d2a2e;
color: #f7f6f3;
}
a {
color: #ac9c6d;
}
header {
background: #2d2a2e;
border-bottom: 2px dotted #f7f6f3;
}
header a {
color: #f7f6f3;
}
}
/* light mode */
@media (prefers-color-scheme: light) {
html{
background-color: #f7f6f3;
color: #2d2a2e;
}
a {
color: #846b1f;
}
header {
background: #f7f6f3;
border-bottom: 2px dotted #2d2a2e;
}
header a {
color: #2d2a2e;
}
}
body {
max-width: 60%;
margin: auto;
padding: .2em;
padding-top: 0;
line-height: 1.5em;
font-size: 24px;
}
h1 {
line-height: 1.5em;
}
ul {
list-style-type: none;
}
.menu{
text-align: center;
}
.menu li {
display: inline-block;
}
.pull-left {
float: left
}
.pull-right {
float: right
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* Adjust background at your leisure! */
header {
position: fixed;
width: 60%;
height: 2.2rem;
font-size: 1.2rem;
}
.menu a {
text-decoration: none;
padding: 5px;
border-radius: 5px;
border-style: dotted;
border-width: 1px;
margin: 20px 0px 20px 0px;
}
header ul,
header ol {
margin: 0;
padding: 0;
list-style: none
}
header nav {
padding: 0 0.5rem
}
header a {
line-height: 1.75rem;
padding: 0 0.5rem
}
footer {
text-align: center;
}
/* Code Boxes */
pre {
border: 2px solid #EBC3DB;
padding: 1em;
overflow-x: auto;
}
pre code { background: none; }
code {
background-color: light-dark(#D6D6D6, #888);
border-radius: 3px;
padding: 0.2em;
overflow-x: auto;
}
/* Images, tables, misc. */
img, iframe, video {
max-width: 100%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
}
main {
hyphens: auto;
max-width: 650px;
margin-left: auto;
margin-right: auto;
line-height: 1.7em;
hyphens: auto;
display: block;
font-size: 1.1em;
}
main a {
font-weight: bold;
}
.content-wrapper {
padding: 40px 12px 0px 12px;
}
#personal {
min-width: 40px;
max-width: 270px;
float: right;
padding: 10px;
display: block;
}
/* Small devices */
@media only screen and (max-width : 575px) {
body {
max-width: 100%;
font-size: 19px;
}
#personal {
min-width: 40px;
max-width: 180px;
float: center;
padding: 0px 0px 0px 0px;
display: block;
}
header {
width: 100%;
}
header a {
padding: 0px;
margin-right: 5px;
}
.content-wrapper {
padding: 40px 0px 10px 10px;
}
}

View file

@ -1 +0,0 @@
footer { font-size: 90%; }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

9
static/fuse.min.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

1
static/katex/auto-render.min.js vendored Normal file
View file

@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){r.d(o,{default:function(){return d}});var e=r(771),t=r.n(e);const n=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},i=/^\\begin{/;var a=function(e,t){let r;const o=[],a=new RegExp("("+t.map((e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|")+")");for(;r=e.search(a),-1!==r;){r>0&&(o.push({type:"text",data:e.slice(0,r)}),e=e.slice(r));const a=t.findIndex((t=>e.startsWith(t.left)));if(r=n(t[a].right,e,t[a].left.length),-1===r)break;const l=e.slice(0,r+t[a].right.length),s=i.test(l)?l:e.slice(t[a].left.length,r);o.push({type:"math",data:s,rawData:l,display:t[a].display}),e=e.slice(r+t[a].right.length)}return""!==e&&o.push({type:"text",data:e}),o};const l=function(e,n){const r=a(e,n.delimiters);if(1===r.length&&"text"===r[0].type)return null;const o=document.createDocumentFragment();for(let e=0;e<r.length;e++)if("text"===r[e].type)o.appendChild(document.createTextNode(r[e].data));else{const i=document.createElement("span");let a=r[e].data;n.displayMode=r[e].display;try{n.preProcess&&(a=n.preProcess(a)),t().render(a,i,n)}catch(i){if(!(i instanceof t().ParseError))throw i;n.errorCallback("KaTeX auto-render: Failed to parse `"+r[e].data+"` with ",i),o.appendChild(document.createTextNode(r[e].rawData));continue}o.appendChild(i)}return o},s=function(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(3===r.nodeType){let o=r.textContent,i=r.nextSibling,a=0;for(;i&&i.nodeType===Node.TEXT_NODE;)o+=i.textContent,i=i.nextSibling,a++;const s=l(o,t);if(s){for(let e=0;e<a;e++)r.nextSibling.remove();n+=s.childNodes.length-1,e.replaceChild(s,r)}else n+=a}else if(1===r.nodeType){const e=" "+r.className+" ";-1===t.ignoredTags.indexOf(r.nodeName.toLowerCase())&&t.ignoredClasses.every((t=>-1===e.indexOf(" "+t+" ")))&&s(r,t)}}};var d=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},s(e,n)}}(),o=o.default}()}));

Some files were not shown because too many files have changed in this diff Show more