paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c0c23fa228b233e411f6a8819c73f895e3e3e91a
parent b2bf701739c4775da790d5c77b65842f65c1dfa0
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Thu, 28 Mar 2019 03:09:10 -0400

Generate page titles from header

The script will look at the first line of every markdown file
which should be a page title for the content section of the website but
will now also be interpreted as the page title for the <title> HTML
element. It expects a syntax as follows:

\## Header Text

Where Header Text can be as long as needed and may include special
characters. The two \#s will be removed and not included in the title of
the compiled webpage.

Diffstat:
Mcreatepages.sh | 6++++--
Mpages/about-me.md | 2+-
Mpages/about-site.md | 2+-
Mpages/essays.md | 2+-
Mpages/guides.md | 2+-
Mpages/guides/install-my-os.md | 2+-
Mpages/projects.md | 2+-
Mpages/projects/dnd/dnd-podcast.md | 2+-
Mpages/projects/dnd/roll.md | 2+-
Mpages/toolset.md | 2+-
10 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/createpages.sh b/createpages.sh @@ -58,7 +58,6 @@ for page in $@; do fi if [[ "$page" != "" && ! -d $page ]]; then - uppername=${pagename^} echo "=====Creating $htmldir/$savepath/$pagename.html=====" echo " Compiling page content..." @@ -70,7 +69,10 @@ for page in $@; do cat build/$savepath/$pagename-content.html >> $htmldir/$savepath/$pagename.html cat build/footer.html >> $htmldir/$savepath/$pagename.html - sed -i "s/<title>.*<\/title>/<title>paritybit.ca – $uppername<\/title>/" \ + # Assumes first line of every markdown file is the header in the format: + # "## Title of The Page" + pagetitle=$(head -n 1 $filepath/$pagename.md | cut -f 2- -d " ") + sed -i "s/<title>.*<\/title>/<title>paritybit.ca – ${pagetitle//&/\\&}<\/title>/" \ $htmldir/$savepath/$pagename.html echo -e "=====Created $htmldir/$savepath/$pagename.html=====\n" diff --git a/pages/about-me.md b/pages/about-me.md @@ -1,3 +1,3 @@ -## Welcome to the About Me page. +## About Me This page will be fleshed out with information soon! diff --git a/pages/about-site.md b/pages/about-site.md @@ -1,4 +1,4 @@ -## This is the page about this site. +## About This Site I created this website as a place for me to share my projects, thoughts on various computing and computer science topics, configuration files, tips and diff --git a/pages/essays.md b/pages/essays.md @@ -1,4 +1,4 @@ -## Welcome to the Essays page. +## Essays There are no essays here yet but check back periodically for more! diff --git a/pages/guides.md b/pages/guides.md @@ -1,4 +1,4 @@ -## Welcome to the Guides page. +## Guides There aren't any guides posted here yet but they are coming soon! diff --git a/pages/guides/install-my-os.md b/pages/guides/install-my-os.md @@ -1 +1 @@ -## This Will Be a Guide on How I Set Up My Operating System +## Setting Up My Operating System diff --git a/pages/projects.md b/pages/projects.md @@ -1,4 +1,4 @@ -## Welcome to the Projects page. +## My Projects <ul> <li><a href="https://git.sr.ht/~jbauer/">My Sourcehut (preferred git service)</a></li> <li><a href="https://github.com/JakeMBauer/">My GitHub</a></li> diff --git a/pages/projects/dnd/dnd-podcast.md b/pages/projects/dnd/dnd-podcast.md @@ -1,4 +1,4 @@ -##The Dungeons & Dragons Podcast +## Dungeons & Dragons Podcast ### Introduction diff --git a/pages/projects/dnd/roll.md b/pages/projects/dnd/roll.md @@ -1,6 +1,6 @@ +## D&D Simple Dice Roller <script type="text/javascript" src=/js/math.js></script> <script type="text/javascript" src=/js/roll.js></script> -##D&D Simple Dice Roller <table id="dice-table"> <tr class="dnd-roll"> <th>Die</th> diff --git a/pages/toolset.md b/pages/toolset.md @@ -1,4 +1,4 @@ -## Welcome to the Toolset page. +## My Toolset On this page will be details about my toolset. On this page will be: