oveloded statischen Site -Generator zu betrachten. Es ist einfach zu bedienen, einfach,
schnell und komplett gut gestaltet. Ich hätte gerne
die Schriftart in einem angepassten Thema anpassen. Oben "Standard-Themen" ist definiert als die Themenfarbe
standardmäßig in der Dropdown "Änderungsthema ändern". < /p>
Wie passt das zusammen? In meiner Konfiguration funktioniert das automatische Kopieren von Schriftartdateien
nicht. Ich habe ein kleines Bash -Skript geschrieben, das das Kopieren nach dem Erstellen von Buchausgaben durchführt.
Code: Select all
mdbook init testBook --theme
[*]create new directory 'peters-theme/fonts
- copy the Libertinus TeX Schreiben Sie in dieses Verzeichnis
- Erstellen Sie eine neue CSS-Datei 'Peters-theMe/Schriftarten/libertinus-sans-font.css'
Code: Select all
@font-face { font-family: libertinus-sans; font-style: normal; font-weight: normal; src: url('LibertinusSans-Regular.otf') format('opentype'); } @font-face { font-family: libertinus-sans; font-style: italic; font-weight: normal; src: url('LibertinusSans-Italic.otf') format('opentype'); } @font-face { font-family: libertinus-sans; font-style: normal; font-weight: bold; src: url('LibertinusSans-Bold.otf') format('opentype'); } < /code> < /li> < /ul> [list] Tweak-Datei 'Peters-theMe /CSS /General.css' < /li> < /ol> < /P> add zusätzliche css [url=viewtopic.php?t=18708]importieren[/url] < /p> < /P.@import '../fonts/libertinus-sans-font.css'; /* added individually: use 'libertinus sans' fonts */ < /code> < /li> HTML -Selektor ändern < /p> html { font-family: libertinus-sans; /* added individually: use 'libertinus sans' fonts */ color: var(--fg); background-color: var(--bg); text-size-adjust: none; }
Code: Select all
@font-face {
font-family: libertinus-sans;
font-style: normal;
font-weight: normal;
src: url('LibertinusSans-Regular.otf') format('opentype');
}
@font-face {
font-family: libertinus-sans;
font-style: italic;
font-weight: normal;
src: url('LibertinusSans-Italic.otf') format('opentype');
}
@font-face {
font-family: libertinus-sans;
font-style: normal;
font-weight: bold;
src: url('LibertinusSans-Bold.otf') format('opentype');
}
[/list]
[*]'peters-theme/fonts/libertinsanssb. />'peters-theme/fonts/libertinussans-italic.otf'
[*]'peters-theme/fonts/libertinussans-reegular 'peters-theme/index.hbs'
Code: Select all
{{#if copy_fonts}}
{{/if}}
< /code>
< /li>
BASH-Skript 'Build-book.sh' (mit Kopieren als Problemumgehung) < /p>
#!/bin/bash
#
# Author: Peter
# Date: 2020-11-20
#
ROOTFOLDER='/home/peter/Documents/Peter/Notes/mdBook/testBook/'
#
# change to book directory
cd $ROOTFOLDER
#
# clean up old book files
mdbook clean
#
# build the book
mdbook build
#
# copy fonts for custom theme
cp -r ./peters-theme/fonts/ ./book/
#
# display book in browser
mdbook serve --open
Grüße
Peter