~exprez135/taliaferro

ref: e1134b9d16967ee537ca6f23f9d5c33754f3ef9c taliaferro/scripts/hugo.sh -rwxr-xr-x 2.0 KiB
e1134b9d — Nate Ijams BTW Abroad 2-4 by Sara Allen 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/sh

# This is a script which, when run on Mac or Linux, will automatically build the site, the index, commit and push it to SoureHut.

# The following creates variables which set the colour/formatting of the output to the terminal.
# Examples: Green is green, under is underlined, bu is bold and underlined, reset resets everything to normal.
green=$(tput setaf 2)
red=$(tput setaf 1)
yellow=$(tput setaf 3)
cyan=$(tput setaf 6)
bold=$(tput bold)
under=$(tput smul)
bu=$(tput bold && tput smul)
reset=$(tput sgr0)

root_project=`git rev-parse --show-toplevel`
rp="$root_project"
echo "$root_project"

# NOTE: THIS SECTION WAS VERY HELPFUL DURING THE CORONAVIRUS CRISIS. UNLESS YOU HAVE ACTIVE CHANGES TO DOCUMENTS, DISABLE PANDOC WORK :)
# echo "Creating pandoc files..."
# cd $rp/content/coronavirus
# pandoc index.md -f markdown+lists_without_preceding_blankline+hard_line_breaks+blank_before_blockquote -t pdf -o post.pdf --toc -V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm" -V mainfont:../../static/webfonts/charter/Charter\ Regular.otf
# pandoc index.md -f markdown+lists_without_preceding_blankline+hard_line_breaks -t docx -o post.docx --toc -s
# pandoc index.md -f markdown+lists_without_preceding_blankline+hard_line_breaks -t epub -o post.epub --toc -s
# pandoc index.md -f markdown+lists_without_preceding_blankline+hard_line_breaks -t plain -o post.txt --toc -s
# pandoc index.md -f markdown+lists_without_preceding_blankline+hard_line_breaks -t rtf -o post.rtf --toc -s
# pandoc index.md -f markdown+lists_without_preceding_blankline+hard_line_breaks -t odt -o post.odt --toc -s
# cd ../..

# Build index for site using the generate.sh script (see file for more info).
echo -e "${cyan}Starting index building process...${reset}"
sh $rp/scripts/generate.sh
echo -e "${green}Index build complete.${reset}"

# Build the project using Hugo.
echo -e "${cyan}Starting Hugo build process...${reset}"
hugo -d public_html --minify
echo -e "${green}Hugo build process complete.${reset}"