diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index d0720ea362..24576b54a6 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -16,6 +16,12 @@ This document shows you what's new in the latest release. For a detailed list of ## 5.0.0 +- **Breaking**: The theme changed how JavaScript and CSS dependencies are loaded to provide a better performance. In case you've added own JavaScript code that depends on the themes jQuery implementation, you have to put it into a separate `*.js` file (if not already) and add the `defer` keyword to the `script` element. Eg. + + ````html + + ```` + - **Change**: The way [archetypes]({{% relref "cont/archetypes" %}}) are used to generate output has changed. The new systems allows you, to redefine existing archetypes or even generate your own ones. Your existing markdown files will still work like before and therefore you don't need to change anything after the upgrade. Nevertheless, it is recommended to adapt your existing markdown files to the new way as follows: diff --git a/exampleSite/layouts/partials/menu-footer.html b/exampleSite/layouts/partials/menu-footer.html index 5de9cecd24..a93b0149c4 100644 --- a/exampleSite/layouts/partials/menu-footer.html +++ b/exampleSite/layouts/partials/menu-footer.html @@ -18,4 +18,4 @@ Star Fork

Built with by Hugo

- \ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 2d48d2cea2..1f994189cd 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -4,9 +4,9 @@ {{- partial "custom-comments.html" . }} {{- partial "menu.html" . }} - - - + + + {{- $wantsMathJax := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasMathJax")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasMathJax")) }} {{- if $wantsMathJax }} {{- if isset .Params "mathjaxinitialize" }} @@ -50,13 +50,13 @@ {{- end }} {{- $wantsMermaid := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasMermaid")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasMermaid")) }} {{- if $wantsMermaid }} - + {{- if isset .Params "custommermaidurl" }} - + {{- else if isset .Site.Params "custommermaidurl" }} - + {{- else }} - + {{- end }} {{- if isset .Params "mermaidinitialize" }} {{- $.Scratch.Set "mermaidInitialize" .Params.mermaidInitialize }} @@ -81,11 +81,11 @@ {{- $wantsSwagger := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasSwagger")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasSwagger")) }} {{- if $wantsSwagger }} {{- if isset .Params "customswaggerurl" }} - + {{- else if isset .Site.Params "customswaggerurl" }} - + {{- else }} - + {{- end }} {{- if isset .Params "swaggerinitialize" }} {{- $.Scratch.Set "swaggerInitialize" .Params.swaggerInitialize }} @@ -104,7 +104,7 @@ useSwagger( JSON.parse({{ $.Scratch.Get "swaggerInitialize" }}) ); {{- end }} - + {{- partial "custom-footer.html" . }} diff --git a/layouts/partials/search.html b/layouts/partials/search.html index dee177b12d..a5e02dfbcc 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -20,12 +20,12 @@ - - - - + + + + {{- range $contentlangs }} {{- $file := (printf "js/lunr.%s.min.js" .) }} - + {{- end }} - \ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/stylesheet.html b/layouts/partials/stylesheet.html index 302954f43d..107d74475a 100644 --- a/layouts/partials/stylesheet.html +++ b/layouts/partials/stylesheet.html @@ -1,9 +1,11 @@ {{- $assetBusting := not .Site.Params.disableAssetsBusting }} - - - + + + + - + + {{- $themevariants := slice | append (.Site.Params.themeVariant | default "relearn-light" ) }} {{- with index $themevariants 0 }} @@ -32,4 +34,4 @@ {{- end }} variants.init( [ {{ delimit $quotedthemevariants ", " | safeJS }} ] ); - \ No newline at end of file + \ No newline at end of file diff --git a/static/css/fonts.css b/static/css/fonts.css new file mode 100644 index 0000000000..e0962ae55d --- /dev/null +++ b/static/css/fonts.css @@ -0,0 +1,39 @@ +@font-face { + font-family: 'Work Sans'; + font-style: normal; + font-weight: 200; + src: url("../fonts/WorkSans-ExtraLight.woff") format("woff2"), url("../fonts/WorkSans-ExtraLight.woff") format("woff"); + font-display: swap; +} + +@font-face { + font-family: 'Work Sans'; + font-style: normal; + font-weight: 300; + src: url("../fonts/WorkSans-Light.woff2") format("woff2"), url("../fonts/WorkSans-Light.woff") format("woff"); + font-display: swap; +} + +@font-face { + font-family: 'Work Sans'; + font-style: normal; + font-weight: 400; + src: url("../fonts/WorkSans-Regular.woff2") format("woff2"), url("../fonts/WorkSans-Regular.woff") format("woff"); + font-display: swap; +} + +@font-face { + font-family: 'Work Sans'; + font-style: normal; + font-weight: 500; + src: url("../fonts/WorkSans-Medium.woff2") format("woff2"), url("../fonts/WorkSans-Medium.woff") format("woff"); + font-display: swap; +} + +@font-face { + font-family: 'Work Sans'; + font-style: normal; + font-weight: 600; + src: url("../fonts/WorkSans-Bold.woff2") format("woff2"), url("../fonts/WorkSans-Bold.woff") format("woff"); + font-display: swap; +} diff --git a/static/css/theme.css b/static/css/theme.css index b715304e29..4e4e08366a 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -3,46 +3,6 @@ @import "tags.css"; @import "tabs.css"; -@font-face { - font-family: 'Work Sans'; - font-style: normal; - font-weight: 200; - src: url("../fonts/WorkSans-ExtraLight.woff") format("woff2"), url("../fonts/WorkSans-ExtraLight.woff") format("woff"); - font-display: swap; -} - -@font-face { - font-family: 'Work Sans'; - font-style: normal; - font-weight: 300; - src: url("../fonts/WorkSans-Light.woff2") format("woff2"), url("../fonts/WorkSans-Light.woff") format("woff"); - font-display: swap; -} - -@font-face { - font-family: 'Work Sans'; - font-style: normal; - font-weight: 400; - src: url("../fonts/WorkSans-Regular.woff2") format("woff2"), url("../fonts/WorkSans-Regular.woff") format("woff"); - font-display: swap; -} - -@font-face { - font-family: 'Work Sans'; - font-style: normal; - font-weight: 500; - src: url("../fonts/WorkSans-Medium.woff2") format("woff2"), url("../fonts/WorkSans-Medium.woff") format("woff"); - font-display: swap; -} - -@font-face { - font-family: 'Work Sans'; - font-style: normal; - font-weight: 600; - src: url("../fonts/WorkSans-Bold.woff2") format("woff2"), url("../fonts/WorkSans-Bold.woff") format("woff"); - font-display: swap; -} - html { width: 100%; height: 100%;