Skip to content
Snippets Groups Projects
build_tuhh.sh 2.29 KiB
Newer Older
#!/bin/bash

# build the files for tuhh-delivery locally
#
#  Structure 
#
#   lieferung/
#   ├── snippets    -> get included on final destination
#   │   ├── aa_research.html
#   │   ├── dgallaun.html
#   │   ├── dm_research.html
#   │   └── fgabel_research.html
#   └── topics      -> standalone files to be copied
#       ├── img
#       │   ├── another-image.jpg
#       │   └── img1.png
#       ├── observability_in_banach_spaces.html
#       ├── ramsey_minimal_ramsey.html
#       └── ramsey_theory.html
#
#

RESEARCH_BIN=$RESEARCH_ROOT/bin
RESEARCH_STATIC=$RESEARCH_ROOT/static
RESEARCH_BUILD=$RESEARCH_ROOT/build
RESEARCH_DEPLOY=$RESEARCH_ROOT/tuhh-build

rm -rf $RESEARCH_BUILD $RESEARCH_DEPLOY
mkdir -p $RESEARCH_BUILD $RESEARCH_DEPLOY 

echo "Preproc Topics"
$RESEARCH_BIN/preproc_topics.sh "$RESEARCH_BUILD" \
                                "$RESEARCH_ROOT/topics" \
                                "$RESEARCH_BUILD/home" \
                                "$RESEARCH_BUILD/forschung"  #>> $RESEARCH_BUILD/build.log 2>&1

# build html files
echo "Creating HTML Files with pandoc"
#topics
$RESEARCH_BIN/create_html.sh $RESEARCH_DEPLOY/forschung/topics \
                             $RESEARCH_BUILD #>> $RESEARCH_BUILD/build.log 2>&1
#staffpages
$RESEARCH_BIN/create_html.sh $RESEARCH_DEPLOY/home \
                             $RESEARCH_BUILD/home #>> $RESEARCH_BUILD/build.log 2>&1
# wg pages 
for wg in aa cm dm nm st
do
    $RESEARCH_BIN/create_html.sh $RESEARCH_DEPLOY/forschung/$wg \
                                 $RESEARCH_BUILD/forschung/$wg #>> $RESEARCH_BUILD/build.log 2>&1
done

cp -r $RESEARCH_ROOT/img $RESEARCH_DEPLOY/forschung/topics
#$RESEARCH_BIN/create_html.sh $RESEARCH_BUILD/snippets

# replace markers
#echo "Replacing markers"
#$RESEARCH_BIN/replace_marker.sh $RESEARCH_BUILD 

#make public directory and copy files
#mkdir -p $RESEARCH_DEPLOY/.public
#for f in $RESEARCH_BUILD/*_final.html
#do
#    filename=$(basename -- "$f")
#    cp $f $RESEARCH_DEPLOY/.public/${filename%_final.html}.html
#done
#
#echo "Copying files to final destination ..."
#cp -r $RESEARCH_ROOT/{img,css}  $RESEARCH_DEPLOY/.public
#mv -v $RESEARCH_DEPLOY/.public  $RESEARCH_DEPLOY/public
#
#echo "Done. Visit file://$RESEARCH_DEPLOY/public/index.html ."