diff --git a/app/app.go b/app/app.go index 13614d1..5dd8e68 100644 --- a/app/app.go +++ b/app/app.go @@ -40,10 +40,10 @@ func NewApp(opts ...AppOpts) *App { opts[0].Port = &d } - // if opts[0].Assets == nil { - // d := http.Dir("./assets") - // opts[0].Assets = d - // } + if opts[0].Assets == nil { + d := http.FileServer(http.Dir("./assets")) + opts[0].Assets = d + } return &App{ dev: *opts[0].Dev, @@ -73,7 +73,6 @@ func (a *App) Run() { } r.Handle("/assets/", a.assets) - r.Handle("/", pages.Routes(logger)) if err := http.ListenAndServe(fmt.Sprintf(":%v", a.port), r); err != nil { diff --git a/assets/css/theme.css b/assets/css/theme.css index b84d9c3..179a889 100644 --- a/assets/css/theme.css +++ b/assets/css/theme.css @@ -1,3 +1,32 @@ +@font-face { + font-family: "Karla"; + font-style: normal; + src: url("/assets/fonts/KarlaVF.woff2") format("woff2"), + url("/assets/fonts/KarlaVF.ttf") format("truetype"), + url("/assets/fonts/KarlaMedium.otf") format("opentype"); +} +@font-face { + font-family: "Karla"; + font-style: italic; + src: url("/assets/fonts/KarlaItalicVF.woff2") format("woff2"), + url("/assets/fonts/KarlaItalicVF.ttf") format("truetype"), + url("/assets/fonts/KarlaItalicMedium.otf") format("opentype"); +} +@font-face { + font-family: "Playfair"; + font-style: normal; + src: url("/assets/fonts/PlayfairRomanVF.woff2") format("woff2"), + url("/assets/fonts/PlayfairRomanVF.ttf") format("truetype"), + url("/assets/fonts/PlayfairDisplay.otf") format("opentype"); +} +@font-face { + font-family: "Playfair"; + font-style: italic; + src: url("/assets/fonts/PlayfairItalicVF.woff2") format("woff2"), + url("/assets/fonts/PlayfairItalicVF.ttf") format("truetype"), + url("/assets/fonts/PlayfairDisplayItalic.otf") format("opentype"); +} + :root * { --theme-accent-hue: var(--user-theme-accent-hue, 280); --theme-accent-saturation: var(--user-theme-accent-saturation, 95%); diff --git a/assets/fonts/KarlaItalicMedium.otf b/assets/fonts/KarlaItalicMedium.otf new file mode 100644 index 0000000..c413a26 Binary files /dev/null and b/assets/fonts/KarlaItalicMedium.otf differ diff --git a/assets/fonts/KarlaItalicVF.ttf b/assets/fonts/KarlaItalicVF.ttf new file mode 100644 index 0000000..7d36b81 Binary files /dev/null and b/assets/fonts/KarlaItalicVF.ttf differ diff --git a/assets/fonts/KarlaItalicVF.woff2 b/assets/fonts/KarlaItalicVF.woff2 new file mode 100644 index 0000000..3efe57f Binary files /dev/null and b/assets/fonts/KarlaItalicVF.woff2 differ diff --git a/assets/fonts/KarlaMedium.otf b/assets/fonts/KarlaMedium.otf new file mode 100644 index 0000000..625457c Binary files /dev/null and b/assets/fonts/KarlaMedium.otf differ diff --git a/assets/fonts/KarlaVF.ttf b/assets/fonts/KarlaVF.ttf new file mode 100644 index 0000000..939d29e Binary files /dev/null and b/assets/fonts/KarlaVF.ttf differ diff --git a/assets/fonts/KarlaVF.woff2 b/assets/fonts/KarlaVF.woff2 new file mode 100644 index 0000000..5620a0f Binary files /dev/null and b/assets/fonts/KarlaVF.woff2 differ diff --git a/assets/fonts/LICENSE-Karla b/assets/fonts/LICENSE-Karla new file mode 100644 index 0000000..83e288b --- /dev/null +++ b/assets/fonts/LICENSE-Karla @@ -0,0 +1,93 @@ +Copyright 2019 The Karla Project Authors (https://github.com/googlefonts/karla) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/LICENSE-Playfair b/assets/fonts/LICENSE-Playfair new file mode 100644 index 0000000..b1e0604 --- /dev/null +++ b/assets/fonts/LICENSE-Playfair @@ -0,0 +1,93 @@ +Copyright 2005–2023 The Playfair Project Authors (https://github.com/clauseggers/Playfair) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/PlayfairDisplay.otf b/assets/fonts/PlayfairDisplay.otf new file mode 100644 index 0000000..2fba0af Binary files /dev/null and b/assets/fonts/PlayfairDisplay.otf differ diff --git a/assets/fonts/PlayfairDisplayItalic.otf b/assets/fonts/PlayfairDisplayItalic.otf new file mode 100644 index 0000000..df977cc Binary files /dev/null and b/assets/fonts/PlayfairDisplayItalic.otf differ diff --git a/assets/fonts/PlayfairItalicVF.ttf b/assets/fonts/PlayfairItalicVF.ttf new file mode 100644 index 0000000..7d9ac76 Binary files /dev/null and b/assets/fonts/PlayfairItalicVF.ttf differ diff --git a/assets/fonts/PlayfairItalicVF.woff2 b/assets/fonts/PlayfairItalicVF.woff2 new file mode 100644 index 0000000..8c8206b Binary files /dev/null and b/assets/fonts/PlayfairItalicVF.woff2 differ diff --git a/assets/fonts/PlayfairRomanVF.ttf b/assets/fonts/PlayfairRomanVF.ttf new file mode 100644 index 0000000..9498f93 Binary files /dev/null and b/assets/fonts/PlayfairRomanVF.ttf differ diff --git a/assets/fonts/PlayfairRomanVF.woff2 b/assets/fonts/PlayfairRomanVF.woff2 new file mode 100644 index 0000000..282ebe3 Binary files /dev/null and b/assets/fonts/PlayfairRomanVF.woff2 differ diff --git a/assets/fonts/README.md b/assets/fonts/README.md new file mode 100644 index 0000000..2a9a03f --- /dev/null +++ b/assets/fonts/README.md @@ -0,0 +1,18 @@ + +# Fonts used + +## Karla + +This project uses the [Karla font](https://github.com/googlefonts/karla/tree/main), +created by [Jonathan Pinhorn](http://twitter.com/jonpinhorn_type) and released through +Google Webfonts in 2012. Karla font is released under the SIL Open Font License, Version 1.1, +which a copy can be found [locally](./LICENSE-Karla), [on GitHub](https://github.com/googlefonts/karla/blob/main/OFL.txt) +and [on the OFL's site](https://scripts.sil.org/OFL). + +## Playfair Roman, Playfair Display & Playfair Italic + +This project uses the [Playfair font family, version 2.1](https://github.com/clauseggers/Playfair), +created by [Claus Eggers Sørensen](http://forthehearts.net/) and released under the +SIL Open Font License Version 1.1, which a copy can be found [locally](./LICENSE-Playfair), +[on GitHub](https://github.com/clauseggers/Playfair/blob/master/OFL.txt) and +[on the OFL's site](https://scripts.sil.org/OFL) diff --git a/templates/layouts/page.templ b/templates/layouts/page.templ index 8387fcc..0b33551 100644 --- a/templates/layouts/page.templ +++ b/templates/layouts/page.templ @@ -23,6 +23,7 @@ func pageInfo(info []PageInfo) PageInfo { templ Page(i ...PageInfo) {
+ // Page information if pageInfo(i).Title != "" {