Improved comments
This commit is contained in:
parent
8eea7fc1b5
commit
736b03825e
29
2minNoods.sh
29
2minNoods.sh
|
@ -1,15 +1,19 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Dependencies: mktemp, sed, imagemagick, basename, grep, sort
|
||||||
|
|
||||||
|
# Config variables
|
||||||
siteroot="../2minNoods_siteroot"
|
siteroot="../2minNoods_siteroot"
|
||||||
noodspp=40
|
noodspp=40
|
||||||
|
|
||||||
|
# Don't touch these
|
||||||
mkdir -p "$siteroot/img/thumbs"
|
|
||||||
pageno=1
|
pageno=1
|
||||||
noodcount=1
|
noodcount=1
|
||||||
photolist="$(mktemp --suffix='.txt')"
|
photolist="$(mktemp --suffix='.txt')"
|
||||||
|
mkdir -p "$siteroot/img/thumbs"
|
||||||
|
|
||||||
# html and css stolen from https://perfectmotherfuckingwebsite.com/
|
# html and css stolen from: https://perfectmotherfuckingwebsite.com/
|
||||||
|
# a.button stolen from: https://stackoverflow.com/a/2906586
|
||||||
pageheader='''<!DOCTYPE html>
|
pageheader='''<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -87,15 +91,16 @@ done < "$photolist"
|
||||||
|
|
||||||
for ((page=1;page<=pageno;page++)); do
|
for ((page=1;page<=pageno;page++)); do
|
||||||
htmlpagenumbers=$(
|
htmlpagenumbers=$(
|
||||||
echo -n '<div class="page-links">'
|
echo -n '<div class="page-links">'
|
||||||
for ((link=1;link<=pageno;link++)); do
|
for ((link=1;link<=pageno;link++)); do
|
||||||
if [ $link -eq $page ]; then
|
if [ $link -eq $page ]; then
|
||||||
echo -n "$link "
|
echo -n "$link "
|
||||||
else
|
else
|
||||||
echo -n "<a class=\"button\" href=\"index.$link.html\">$link</a> "
|
echo -n "<a class=\"button\" href=\"index.$link.html\">$link</a> "
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo '</div><hr>')
|
echo '</div><hr>'
|
||||||
|
)
|
||||||
echo "$htmlpagenumbers" >> "$siteroot/index.$page.html"
|
echo "$htmlpagenumbers" >> "$siteroot/index.$page.html"
|
||||||
sed -i "s%<!--pageno-->%$htmlpagenumbers%" "$siteroot/index.$page.html"
|
sed -i "s%<!--pageno-->%$htmlpagenumbers%" "$siteroot/index.$page.html"
|
||||||
echo '</body></html>' >> "$siteroot/index.$page.html"
|
echo '</body></html>' >> "$siteroot/index.$page.html"
|
||||||
|
|
Loading…
Reference in New Issue