# SBWG settings file for the example web site

# The name/title of the website as displayed in the header and used in the browser window title bar/browser tabs.
sitename="ExSite (The Example Web Site)"

# This url is used when external documents that link to the web site are generated, e.g. the RSS feed.
url="https://www.example.com/"

# Base directory of the webserver - no trailing slash - "/" for document root - needs to be changed if the site will be sitting in a subdirectory.
webbase="/"

# Set default style - Any files in the styles directory name [stylename].css or [stylename]-*.css are used, where [stylename] is the value set below.
style=stinpell

# Default output directory (where the generated web site is written to) - can be overwritten with option -o
# The 'html' directory inside the source/input directory is the default output directory. Uncomment and change if you want the site to be generated
# into a different directory by default.
#odir="${shellbase}/html"

# Default width/height for image gallery thumbnails in pixels - I say default, but there's currently no option to overwrite this (except with CSS).
thumbsize=200					# Thumbnails used in the view of galleries attached to blog entries
thumbsizemini=60				# Square thumbnails used at the top of a gallery page
previewsize=800					# Large images in the gallery view, linked to the original image files

# Number of entries per page - If a list of entries (tagpage or all.html) contains more than this amount of entries it's split into several pages.
perpage=5

# This adds a "Home" link at the beginning of the navigation bar.
hook_navbar_before() {
  o echo "<div class=\"navheading\"><h3><a href=\"${webbase}index.html\">Home</a></h3><div>"
}

# This adds an "About" link at the end of the navigation bar.
hook_navbar_after() {
  o echo "<div class=\"navheading\"><h3><a href=\"${webbase}about.html\" title=\"About This Site\">About</a></h3><div>"
}

# This is an example for style sheet injection with hook_head.
# hook_head is executed every time an HTML header is generated.
# Output from hook_head will be included in the HTML header.
# This style sheet will change the colours depending on the date and time at generation.
hook_head() {						# This is called every time an HTML header is generated.
  o echo "<style>"
  o echo "  h1, h2, h3 { color: #$(date +%y%m%d); }"	# date (yy-mm-dd) as colour code
  o echo "  p { color: #$(date +%H%M%S); }"		# time (hh:mm:ss) as colour code
  o echo "</style>"
}

# The following functions are uncommented by default. They are here as examples of what hooks you could add to your web site.
# Simply remove the # at the beginning of the code lines to enable them for this web site.

# This is an example of how links/menus/menu items can be added to the sidebar with hook_sidebar.
# hook_sidebar is executed every time the sidebar is generated, which is only once per run.
#hook_navbar_end() {					# This is called after generating the sidebar, before closing it.
#  echo '<div id="promo">'							>> "${tmpdir}/navbar"
#  echo 'Please also check out these interesting projects (no affiliation):'	>> "${tmpdir}/navbar"
#  echo '<li class="link"><a title="AAAAA" href="AAAAA">AAAAA</a></li>'		>> "${tmpdir}/navbar"
#  echo '<li class="link"><a title="BBBBB" href="BBBBB">BBBBB</a></li>'		>> "${tmpdir}/navbar"
#  echo '<li class="link"><a title="CCCCC" href="CCCCC">CCCCC</a></li>'		>> "${tmpdir}/navbar"
#  echo '<li class="link"><a title="DDDDD" href="DDDDD">DDDDD</a></li>'		>> "${tmpdir}/navbar"
#  echo '<li class="link"><a title="EEEEE" href="EEEEE">EEEEE</a></li>'		>> "${tmpdir}/navbar"
#  echo "<p> <center> Look, it's an owl! <br />"					>> "${tmpdir}/navbar"
#  echo '<img src="/files/moose.jpg" alt="picture of a moose" width="150"> </center> </p>'	>> "${tmpdir}/navbar"
#  echo '</div>'									>> "${tmpdir}/navbar"
#}

# This is an example of how HTML can be injected at the end of the categories list in the navigation bar. 
# hook_navbar_item_change is called after the last item of every tag type has been added to the navigation bar.
# By checking what that item is you can output the additional line only at the end of a certain list, categories in this case.
# This only adds the link to the navigation bar. The actual tagpage is generated through the hook_tagpages_entry below.
#hook_navbar_item_change() {
#  [[ ${item} == cat* ]] &&
#    o echo "<li class=\"cat ${oddity}\"><a title=\"Show blog entries that are quite short.\" href=\"${webbase}tags/cat:short.html\">(Short Entries)</a></li>"
#}
# This adds a tag to all entries whose content is shorter than a certain amount of characters.
# This does not add a link to this possibly previously non-existing tagpage in the navigation bar.
#hook_tagpages_entry() {
#  local content
#  content=$(cat "${shellbase}/entries/${entry}" | tail -n +$(grab_tag "${tags}" taglines))
#  local size
#  size=$(echo "${content}"|wc -c)
#  [[ ${size} -lt 500 ]] && [[ ${tags} != *$'\n'sort:* ]] && {
#    tags="${tags}"$'\n'"cat:short"
#    vv "Added tag 'cat:short' to the entry '${entry}'."
#  }
#}

