#SBWG 0.9.11

# This is a SBWG settings file for the SBWG example web site.

################################################################################################################################################################
#
# Example settings
#
# The following section contains the default settings for the example web site. For some of the settings there are several alternative examples presented. Don't
# let the more elaborate and complicated looking examples confuse you. You don't need them. They are here as suggestions for those who want to dive deeper into
# SBWG settings than necessary or who are more than familiar with the bash syntax and want to brag about it.
#
################################################################################################################################################################


# 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. It should not contain a trailing slash ('/').
url="https://www.example.com"


# Seting the default style - Any files in the styles directory name [stylename].css or [stylename]-*.css are used, where [stylename] is the value set below.
style=elth
# Alternate ways of setting the style set(s):
#readonly style=elth 2> /dev/null || w "Failed to set the style set in the settings file. Maybe it has already been set via command line option?"
#style=( elth base )


# Setting the defalt log file - is only used when option -l/--logfile is used without an argument - can be overwritten with argument to option -l/--logfile
set_logfile "${shellbase}/sbwg-last-log"
# Alternate way of setting the log file:
#logfile="${shellbase}/sbwg-last-log"		# This is simple but not recommended
#readonly logfile="${shellbase}sbwg-log" 2> /dev/null || w "Failed to set the logfile in the settings file. Maybe it has already been set via command line option?"


# Setting the default output directory (where the generated web site is written to) - can be overwritten with option -o/--output
# 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"


# Setting the width and height for image thumbnails in pixels
thumbsize=200					# Thumbnails used in the view of galleries attached to blog entries
minisize=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
smallsize=600					# Previews used for entry pictures


# 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


# The style in which tags are displayed above entries. raw: the way they are entered in the source files. pretty: the way their meaning is more obvious to readers.
tagstyle=pretty
#tagstyle=raw


# Maximum file name length in bytes
maxfnl=255
# Other examples of possible maximum filename length definitions:
#maxfnl=8.3	# For old DOS systems
#maxfnl=1024	# Maxmum allwed filename length on common linux filesystems


# E-mail addresses of authors for whose entries a comment link or comment form will be available
emails[steeph]=a-sbwg-comment@steeph.de
emails[testy]=a-sbwg-test@steeph.de
# Alternate examples of setting author's e-mail addresses:
#emails=( [testy]=a-sbwg-test@steeph.de [steeph]=a-sbwg-comment@steeph.de )
#emails["$username"]=mail@example.com
#emails['Elbert Ainstein']=mail@example.com


#set_option v	# This raises verbosity by one level, making the minimum verbosity level that can be set via command line 'verbose mode'.
#v "You're using the example web site's settings file. That file sets some settings and enabled some options for convenience."
#v "Verbose mode is enabled in the settings file so that SBWG reports what it is going to do next."


#set_option C	# This enabled permanent caching mode. That means that any changes to already existing content will only take effect if the corrosponding cache files are removed before re-generating the web site.
#desired_caches=all	# This selects all available cachegroups to be used for permanent caching.
#cachedir="${HOME}/.sbwg-exsite-cache"	# This sets the directory in which permanent cache files are stored.
#v "Permanent caching mode is enabled. That means that any changes to already existing content will only take effect if the corrosponding cache files are removed " \
#  "before re-generating the web site."



################################################################################################################################################################
#
# Example hooks
#
# The following section contains example hooks for SBWG web sites. They customise the web site in ways SBWG does not have an option for or add features or
# functionality that SBWG does not support out of the box.
# You dont't have to understand them, what they do or how they work. If you want to use one on your own web site, feel free to copy one or some unchanged or
# edit it/them to reflect your custom case. But it is totally OK to ignore anything in this file that you don't like or that you don't want to read right now.
#
################################################################################################################################################################


##################################################
# This adds a "Home" link at the beginning of the navigation bar.
#########################
hook_navbar_before () {			# Called once right before the first line of the navbar.html file is written
  c echo "<div class=\"navheading\"><h3><a href=\"/index.html\" title=\"Go To The Start Page\">Home</a></h3></div>"
}


##################################################
# This adds an "About" link at the end of the navigation bar.
#########################
hook_navbar_after() {			# Called right after the last line of the navbar.html file was written
  c echo "<div class=\"navheading\"><h3><a href=\"/about.html\" title=\"About This Site\">About</a></h3></div>"
  c echo "<div class=\"navheading\"><h3><a href=\"/INSTALL.html\" title=\"Display The Content Of SBWG's INSTALL File\">INSTALL</a></h3></div>"
  c echo "<div class=\"navheading\"><h3><a href=\"/README.html\" title=\"Display The Content Of SBWG's README File\">README</a></h3></div>"
}


##################################################
# This adds a note (a 'note:' tag) to every entry that is flagged 'incomplete'.
#########################
hook_above_entry_content_before() {		# Called every time an entry's meta data HTML chunk is generated, before it's written to a cache file
  [[ flags == "*incomplete*" ]] && c '<div class="note">This entry is work in progress, not finished, incomplete, not done and imperfect.</div>'
}


##################################################
# This adds a footer to every generated HTML file.
#########################
hook_footer() {					# Called every time an HTML file is generated, right before the body tag is closed.
  o printf '<footer><span class="stupid-copyright">© 1631 René Descartes</span></footer>
}




################################################################################################################################################################
#
# 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.
# Some of the uncommented hooks used to be part of the example we site in previous versions of SBWG and are not as useful with current versions. You can still
# use these hooks as inspiration or use parts of them for customisations to a web site.
#
################################################################################################################################################################


##################################################
# 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() {						# 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>"
#}


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


##################################################
# 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* ]] &&
#    c echo "<li class=\"cat ${oddity}\"><a title=\"Show blog entries that are quite short.\" href=\"/tags/$(pathshortener "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))
#  content="$(awk "NR > $(grab_tag "${tags}" taglines) { print }" < "${shellbase}/entries/${entry}")"
#  local size
##  size=$(echo "${content}"|wc -c)
#  size=${#content}										# Determine how many characters this content is long.
#  [[ ${size} -lt 500 ]] && [[ ${tags} != *$'\n'sort:* ]] && {
#    tags="${tags}"$'\n'"cat:short"
#    vv "Added tag 'cat:short' to the entry '${entry}'."
#  }
#}


##################################################
# This excludes the navbar from all generated HTML files except navbar.html and replaces it with a link to navbar.html if the preferred style is 'tensum'.
# tensum used to be a minimalistic style for devices with very small screens. Therefore it made sense to remove the navbar from it this way. The tensum style is
# now depricated and not really compatible with current versions of SBWG anymore. It is recommended to use CSS instead of this function to remove the navbar if
# that is desired. The link to navbar.html is now included in every generated HTML file by default (except navbar.html itself).
#########################
#hook_navbar_end() {			# Called once after the navbar has been generated.
#
#  if [[ ${style} == tensum ]]; then						# If the style set "tensum" is used (the mobile style that comes with the example
#										#   site, then navbar.html should be linked to instead of adding the navbar into
#										#   every generated HTML file.
#    d "Mobile style detected. Replacing navbar with link to navbar.html."
#    add_navbar() {								# Overwrite the funtion that is normally used to add the navbar to every generated
#										#   HTML file, replace it with a link to the separate navbar file.
#      c printf "<section>\n"							# This is just to enable styling.
#      c printf "<nav class=\"menu-link\">\n"
#      c printf "<a href=\"/navbar.html\" class=\"menu-link\">Menu</a>\n"
#      c printf "</nav>\n"    
#    }
#  fi
#}


##################################################
# This adds a logo to the header section of every generated HTML file. The linked logo.svg file has to be added to the files directory and copied with option
# -f/--files or copied manually to the linked path.
#########################
#hook_sitename_before() {		# Called every time an HTML file is generated, right before the site name/title is printed.
#  o printf '      <img id="logo" width="200" src="/files/logo.svg" />\n'	# Adds the logo from the files directory to the header section.
#}
