diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-03-14 08:27:00 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-03-14 08:27:00 +0100 |
commit | 27321f190e579d163a56042ff108f8d71ce0e0ae (patch) | |
tree | df40f115768e8746270e11ae1fe64d52594e3bc6 | |
parent | 156ac95b2bdcc4832c0b6ae6126959dd7119a3ff (diff) | |
download | kronika-27321f190e579d163a56042ff108f8d71ce0e0ae.tar.gz kronika-27321f190e579d163a56042ff108f8d71ce0e0ae.zip |
Add article styling
-rwxr-xr-x | ssg5 | 19 | ||||
-rw-r--r-- | wpisy/_header.html | 2 | ||||
-rw-r--r-- | wpisy/style.css | 14 |
3 files changed, 26 insertions, 9 deletions
diff --git a/ssg5 b/ssg5 index 301b020..d29088c 100755 --- a/ssg5 +++ b/ssg5 @@ -178,7 +178,7 @@ render_html_files() { if [ "$(basename $f)" = "index.html" ]; then out="$2/$f" else - mkdir "$2/${f%\.html}" + mkdir -p "$2/${f%\.html}" out="$2/${f%\.html}/index.html" fi render_html_file "$3" < "$1/$f" > "$out" @@ -187,20 +187,29 @@ render_html_files() { render_md_files_lowdown() { + in="$(mktemp)" while read -r f do if [ "$(basename $f)" = "index.md" ]; then out="$2/${f%\.md}.html" - else - mkdir "$2/${f%\.md}" + mkdir -p "$2/${f%\.md}" out="$2/${f%\.md}/index.html" fi - lowdown \ - < "$1/$f" | + + if [ "$(echo $f | cut -d'/' -f 2)" = "kronika" ]; then + echo "<article>" > $in && \ + lowdown "$1/$f" >> $in && \ + echo "</article>" >> $in + else + lowdown "$1/$f" > $in + fi + + cat "$in" | render_html_file "$3" \ > "$out" done + rm $in } render_html_file() { diff --git a/wpisy/_header.html b/wpisy/_header.html index 020675c..075ce32 100644 --- a/wpisy/_header.html +++ b/wpisy/_header.html @@ -30,7 +30,7 @@ <a href="/">Strona główna</a> <a href="/do-pobrania">Do pobrania</a> <a href="/kontakt">Kontakt</a> - <a href="/kronika.html">Kronika</a> + <a href="/kronika">Kronika</a> </nav> </div> </header> diff --git a/wpisy/style.css b/wpisy/style.css index a3cfd4f..8aabd95 100644 --- a/wpisy/style.css +++ b/wpisy/style.css @@ -38,6 +38,7 @@ main { header { box-shadow: 0 0 20px rgb(0 0 0 / 10%); + padding: 2ex 0; } header > div { @@ -59,12 +60,19 @@ nav a { margin: 0.5em; } -main h1, -main h2, -main h3 { +main > p { text-align: center; } +main img { + display: block; + margin: 0 auto; +} + +article { + text-align: left; +} + header > *, main, footer > * { |