Skip to content
Snippets Groups Projects
Commit dbecd3f8 authored by Fabian Nuraddin Alexander Gabel's avatar Fabian Nuraddin Alexander Gabel :speech_balloon:
Browse files

Merge branch 'dev'

parents 9a1330f2 4f59ec3b
No related branches found
No related tags found
2 merge requests!76Master,!71Fix conflict
Pipeline #105188 passed
Showing with 592 additions and 61 deletions
build/*
*/build
*build/
*deploy/
local/*
public/*
*/public/*
......@@ -8,3 +8,7 @@ public/*
!static/home/*.html
!static/topic/*.html
*.log
!testing/test_pandoc/*.html
!testing/test_create_html/*.html
*.swp
!*ref_*
......@@ -3,13 +3,14 @@
#
stages:
- preprocessor-test
- testing
- build
- review
- deploy
# always test the preprocessor and pandoc build with unit tests
testing:
stage: preprocessor-test
# always test the preprocessor with unit tests
test-preprocessor:
stage: testing
allow_failure: false
image:
name: alpine:latest
......@@ -21,8 +22,117 @@ testing:
artifacts:
paths:
- testing/*.log
only:
refs:
- branches
- merge_requests
changes:
- .gitlab-ci.yml
- bin
- testing
# build static webpage
# always test the pandoc integration and pandoc build with unit tests
pandoc-test:
stage: testing
allow_failure: false
image:
name: alpine:latest
script:
- apk add --no-cache --upgrade bash
- RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
# run shell script with testss
- $RESEARCH_ROOT/bin/test_pandoc.sh
artifacts:
paths:
- testing/test_pandoc/*.log
# test that markdown is translated correctly
test-md-to-html:
stage: testing
allow_failure: false
image:
name: eltenedor/ubuntu-pandoc:latest
script:
- mkdir -p log
- rm -rf log/test_create_html.log
- RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
- $RESEARCH_ROOT/bin/test_create_html.sh | tee log/test_create_html.log
artifacts:
paths:
- log/test_create_html.log
only:
refs:
- branches
- merge_requests
changes:
- .gitlab-ci.yml
- bin
- testing
# test that html is included correctly
test-replace_marker:
stage: testing
allow_failure: false
image:
name: eltenedor/ubuntu-pandoc:latest
script:
- mkdir -p log
- rm -rf log/test_replace_marker.log
- RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
- $RESEARCH_ROOT/bin/test_replace_marker.sh | tee log/test_replace_marker.log
artifacts:
paths:
- log/test_replace_marker.log
only:
refs:
- branches
- merge_requests
changes:
- .gitlab-ci.yml
- bin
- testing
# test building standalone static webpage
test-build-standalone:
stage: testing
allow_failure: false
image:
name: eltenedor/ubuntu-pandoc:latest
script:
- mkdir -p log
- rm -rf log/test_build_standalone.log
- RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
- $RESEARCH_ROOT/bin/test_build_standalone.sh | tee log/test_build_standalone.log
artifacts:
paths:
- log/test_build_standalone.log
only:
refs:
- branches
- merge_requests
changes:
- .gitlab-ci.yml
- bin
- testing
# build standalone static webpage
build-standalone-static:
stage: build
allow_failure: false
image:
name: eltenedor/ubuntu-pandoc:latest
script:
- RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
# build static webpage
- $RESEARCH_ROOT/bin/build_standalone.sh
artifacts:
paths:
- public
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH
# build standalone static webpage
build-static:
stage: build
allow_failure: false
......@@ -35,18 +145,204 @@ build-static:
artifacts:
paths:
- static
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH
# build tuhh-snippets
build-tuhh:
stage: build
allow_failure: false
image:
name: eltenedor/ubuntu-pandoc:latest
script:
- RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
- $RESEARCH_ROOT/bin/preproc_topics.sh $RESEARCH_ROOT/build-tuhh $RESEARCH_ROOT/topics
- $RESEARCH_ROOT/bin/create_html.sh $RESEARCH_ROOT/build-tuhh $RESEARCH_ROOT/build-tuhh
artifacts:
paths:
- build-tuhh
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH
# deploy static webpage on issue-branch to web-server hosted asteroids
deploy-on-asteroid:
stage: review
image:
name: alpine:latest
before_script:
## install dependencies
#- apk update && apk add openssh-client bash
## see https://docs.gitlab.com/ee/ci/ssh_keys/ for comments
#- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' #this command is for debian based systems
- apk update && apk add openssh-client bash #this command is for alpine
- eval $(ssh-agent -s)
- echo "$ASTEROID_SSH_KEY" | tr -d '\r' | ssh-add -
# See https://stackoverflow.com/a/57332478 about known hosts
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$ASTEROID_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 700 ~/.ssh
script:
- mkdir .public-asteroid
- cp -r public/*.html .public-asteroid
- cp -r img .public-asteroid
- cp -r css .public-asteroid
- mv .public-asteroid public-asteroid
# deploy webpage on asteroid
#- ssh $ASTEROID_USER@$ASTEROID_HOST "rm -rf $ASTEROID_DEPLOY/$CI_COMMIT_REF_NAME"
- ssh $ASTEROID_USER@$ASTEROID_HOST "mkdir -p $ASTEROID_DEPLOY/$CI_COMMIT_REF_NAME"
- scp -v -r public-asteroid "$ASTEROID_USER@$ASTEROID_HOST:$ASTEROID_DEPLOY/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHORT_SHA"
artifacts:
paths:
- public-asteroid
rules:
- if: $CI_PROJECT_URL != 'https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh'
when: never
- when: always
# deploy static webpage on dev-branch to tuhh
deploy-on-tuhh:
stage: deploy
image:
name: alpine:latest
before_script:
## install dependencies
- apk update && apk add openssh-client bash
## see https://docs.gitlab.com/ee/ci/ssh_keys/ for comments
#- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$TUHH_SSH_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$TUHH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 700 ~/.ssh
script:
- mkdir -p .public-tuhh
- cp -r build-tuhh/*.html .public-tuhh
- mv .public-tuhh public-tuhh
# deploy webpage on tuhh
- echo 'scp -v public-tuhh' "$TUHH_USER@$TUHH_HOST:$TUHH_DEPLOY"
- scp -v -r public-tuhh "$TUHH_USER@$TUHH_HOST:$TUHH_DEPLOY"
artifacts:
paths:
- public-tuhh
rules:
- if: $CI_PROJECT_URL != 'https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh'
when: never
- if: $CI_COMMIT_BRANCH == 'dev'
when: always
# deploy static webpage to web-server via GitLab pages
pages:
stage: deploy
script:
- mkdir .public
- cp -r static/public/*.html .public
- cp -r img .public/.
- cp -r css .public/.
- mv .public public
- mkdir .public-pages
- cp -r public .public-pages
- mv .public-pages public-pages
artifacts:
paths:
- public
- public-pages
rules:
- if: $CI_COMMIT_BRANCH == 'master'
deploy_review:
stage: deploy
script:
- echo "Deploy a review app on an asteroid"
environment:
name: asteroid/$CI_COMMIT_REF_NAME
url: https://review.fabian-gabel.de/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHORT_SHA
# on_stop: stop_review_app
# auto_stop_in: 1 week
rules:
- if: $CI_PROJECT_URL != 'https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh'
when: never
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH == 'dev'
review_tuhh:
stage: review
image:
name: alpine:latest
before_script:
- apk update && apk add openssh-client bash
- eval $(ssh-agent -s)
- echo "$REVIEW_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$REVIEW_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 700 ~/.ssh/known_hosts
script:
- mkdir .public-review
- cp -r public/*.html .public-review
- cp -r img .public-review
- cp -r css .public-review
- mv .public-review public-review
- ssh -v -p "${REVIEW_SSH_PORT}" "${REVIEW_SSH_USER}"@"${REVIEW_HOST_NAME}" "mkdir -p /usr/local/apache2/htdocs/~${CI_COMMIT_REF_NAME}/$CI_COMMIT_SHORT_SHA"
- scp -v -P "${REVIEW_SSH_PORT}" -r public-review/* "${REVIEW_SSH_USER}"@"${REVIEW_HOST_NAME}":"/usr/local/apache2/htdocs/~${CI_COMMIT_REF_NAME}/$CI_COMMIT_SHORT_SHA"
environment:
name: tuhh/$CI_COMMIT_REF_NAME
url: https://${REVIEW_PROXY_HOST_NAME}${REVIEW_BASE_DIR}~${CI_COMMIT_REF_NAME}/$CI_COMMIT_SHORT_SHA/
on_stop: review_tuhh:stop
rules:
- if: $CI_PROJECT_URL != 'https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh'
when: never
- if: '$CI_COMMIT_REF_NAME != "master"'
review_tuhh:stop:
stage: review
image:
name: alpine:latest
before_script:
- apk update && apk add openssh-client bash
- eval $(ssh-agent -s)
- echo "$REVIEW_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$REVIEW_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 700 ~/.ssh/known_hosts
script:
- ssh -p "${REVIEW_SSH_PORT}" "${REVIEW_SSH_USER}"@"${REVIEW_HOST_NAME}" "rm -rf /usr/local/apache2/htdocs/~${CI_COMMIT_REF_NAME}"
rules:
- if: '$CI_COMMIT_REF_NAME != "master"'
when: manual
allow_failure: true
environment:
name: tuhh/$CI_COMMIT_REF_NAME
action: stop
master-deploy:
stage: deploy
image:
name: alpine:latest
before_script:
- apk update && apk add openssh-client bash
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 700 ~/.ssh/known_hosts
script:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- ssh -p "${SSH_PORT}" "${SSH_USER}"@"${HOST_NAME}" "mkdir -p /usr/local/apache2/htdocs"
- scp -P "${SSH_PORT}" -r public/* "${SSH_USER}"@"${HOST_NAME}":"/usr/local/apache2/htdocs"
cache:
key: "$CI_COMMIT_REF_SLUG"
environment:
name: $CI_COMMIT_REF_NAME
url: https://$PROXY_HOST_NAME$BASE_DIR
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
# uncomment for manual stopping
#stop_review_app:
# stage: deploy
# script: stop-review-app
# environment:
# name: review/$CI_COMMIT_REF_NAME
# action: stop
# rules:
# - if: $CI_MERGE_REQUEST_ID
# when: manual
# Research Interests
This page hopefully features the past, current and future research interests of our institute.
You browse this webpage either by clicking on a **research topic**, a **working group** or a particular **researcher**.
If you are looking for a guided tour, watch [https://media.tuhh.de/e10/gabel/research-topics/video1_rundgang.mp4](https://media.tuhh.de/e10/gabel/research-topics/video1_rundgang.mp4) (DE)
If you want to contribute a research topic, see the [CONTRIBUTING.md](https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh/-/blob/master/CONTRIBUTING.md).
## List of Sites
### `Master`
The [master](https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh/-/tree/master) is currently delivered to
* [https://fabiangabel.gitlab.io/research-topics-mat-tuhh](https://fabiangabel.gitlab.io/research-topics-mat-tuhh)
* [https://www3.tuhh.de/cfg0846/research-topics-mat-tuhh/](https://www3.tuhh.de/cfg0846/research-topics-mat-tuhh/) (only to be reached from TUHH-network)
### `Dev`
The development version of this webpage for review is currently delivered to [https://review.fabian-gabel.de/dev](https://review.fabian-gabel.de/dev).
### Review Apps
[GitLab Review Apps](https://docs.gitlab.com/ee/ci/review_apps/) can be accessed on
* [https://review.fabian-gabel.de/](https://review.fabian-gabel.de/)
* [https://www3-dev.tuhh.de/cfg0846/research-topics-mat-tuhh/](https://www3-dev.tuhh.de/cfg0846/research-topics-mat-tuhh/) (only to be reached from TUHH-network)
### GitLab Repository
The corresponding [GitLab](https://collaborating.tuhh.de) repository is
* hosted at [https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh](https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh)
* [push-mirrored](https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html#pushing-to-a-remote-repository) to [https://gitlab.com/fabiangabel/research-topics-mat-tuhh](https://gitlab.com/fabiangabel/research-topics-mat-tuhh)
......@@ -36,3 +36,4 @@ do
sed -i "s;/include/javascript/jquery.quicksilver.js;https://www.mat.tuhh.de/include/javascript/toggleme.js;" $f
sed -i "s;/include/javascript/jquery.simpleFAQ.js;https://www.mat.tuhh.de/include/javascript/jquery.simpleFAQ.js;" $f
done
......@@ -13,3 +13,4 @@ do
-c "css/superfish-vertical.css" \
-c "css/base_mode.css"
done
......@@ -20,3 +20,4 @@ cp -r $RESEARCH_ROOT/css $DEPLOY_DIR/.public
mv $DEPLOY_DIR/.public $DEPLOY_DIR/public
echo "Done. Visit file://$DEPLOY_DIR/public/index.html ."
#!/bin/bash
# building the a standalone static webpage
RESEARCH_BIN=$RESEARCH_ROOT/bin
RESEARCH_STATIC=$RESEARCH_ROOT/static
# Check commandline arguments
if [ $# -lt 1 ]
then
RESEARCH_DEPLOY=`pwd`
RESEARCH_TOPICS=`pwd`"/topics"
RESEARCH_BUILD=`pwd`"/build"
echo -e "No deploy directory was specified."
# clean up directories
rm -rf $RESEARCH_BUILD
rm -rf $RESEARCH_DEPLOY/{.public,public}
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
RESEARCH_BUILD="$1/build"
echo -e "No extra topics directory was specified."
# clean up directories
rm -rf $RESEARCH_BUILD
rm -rf $RESEARCH_DEPLOY/{.public,public}
elif [ $# -lt 3 ]
then
RESEARCH_DEPLOY="$1"
RESEARCH_TOPICS="$2"
RESEARCH_BUILD="$1/build"
echo -e "No extra build directory was specified."
# clean up directories
rm -rf $RESEARCH_BUILD
rm -rf $RESEARCH_DEPLOY/{.public,public}
else
RESEARCH_DEPLOY="$1"
RESEARCH_TOPICS="$2"
RESEARCH_BUILD="$3"
fi
# prepare directories / clean-up
mkdir -p $RESEARCH_DEPLOY
mkdir -p $RESEARCH_BUILD
cp -vf $RESEARCH_TOPICS/*.md $RESEARCH_BUILD
echo -e "Deploying to $RESEARCH_DEPLOY ...;"
echo -e "Building into directory $RESEARCH_BUILD ..."
echo -e "Using .md-files from $RESEARCH_TOPICS ..."
# preprocess .md-files
echo "Preproc Topics"
$RESEARCH_BIN/preproc_topics.sh $RESEARCH_BUILD $RESEARCH_TOPICS
# build html files
echo "Creating HTML Files with pandoc"
$RESEARCH_BIN/create_html.sh $RESEARCH_BUILD
# 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 ."
......@@ -8,9 +8,16 @@ BIN_DIR=$RESEARCH_ROOT/bin
rm -rf $BUILD_DIR
rm -rf $DEPLOY_DIR/{.public,public}
#build html
# preprocess .md-files
echo "Preproc Topics"
$BIN_DIR/preproc_topics.sh $RESEARCH_ROOT/static
$BIN_DIR/preproc_topics.sh $RESEARCH_ROOT/static $RESEARCH_ROOT/topics
# get full TUHH staff pages ready for insertion
mkdir -p $RESEARCH_ROOT/static/build/plain
cp $RESEARCH_ROOT/static/home/*.html $RESEARCH_ROOT/static/build/plain
cp $RESEARCH_ROOT/static/forschung/*.html $RESEARCH_ROOT/static/build/plain
# build html files
echo "Run Pandoc"
$BIN_DIR/integrate_pandoc.sh
echo "Pandoc finished."
......@@ -27,3 +34,4 @@ cp -r $RESEARCH_ROOT/css $DEPLOY_DIR/.public
mv $DEPLOY_DIR/.public $DEPLOY_DIR/public
echo "Done. Visit file://$DEPLOY_DIR/public/index.html ."
#!/bin/bash
namelist=`grep -h -i -m 1 -r "###\s*Collaborators (MAT):" topics/topic-template.md | sed -e 's/^###\s*Collaborators (MAT):\s*//I' -e 's/\s*,\s*/\n/g' | sort -u`
for name in $namelist
do
# pipeline to get full name of staff-member from mat-homepage
# -> wget the staff homepage of $name
# -> grep the line with the <h1>-tag, something like <h1>Fabian Gabel, M. Sc.</h1><div class='staffIntro'><p><img src='/home/fgabel/images/portrait.png' title='Foto von Fabian Gabel, M. Sc.' class='staffPicture'></p><div class='staffContact'>
# -> strip the string such that only the portion between <h1></h1> remains
# -> remove leading spaces
echo "Found collaborator $name"
namelist=`grep -h -i -m 1 -r "###\s*Collaborators (MAT):" topics/topic-template.md | sed -e 's/^###\s*Collaborators (MAT):\s*//I' -e 's/\s*,\s*/\n/g' | sort -u`
for name in $namelist
do
# pipeline to get full name of staff-member from mat-homepage
# -> wget the staff homepage of $name
# -> grep the line with the <h1>-tag, something like <h1>Fabian Gabel, M. Sc.</h1><div class='staffIntro'><p><img src='/home/fgabel/images/portrait.png' title='Foto von Fabian Gabel, M. Sc.' class='staffPicture'></p><div class='staffContact'>
# -> strip the string such that only the portion between <h1></h1> remains
# -> remove leading spaces
echo "Found collaborator $name"
# replace name in .md file
echo "- pandoc --standalone ./build/$name.md -o ./build/$name.html --mathjax" >> out.yml
# replace name in .md file
echo "- pandoc --standalone ./build/$name.md -o ./build/$name.html --mathjax" >> out.yml
done
done
\ No newline at end of file
#!/bin/bash
# processing command line arguments
# Define variables
MATHJAX_URL='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
# Check commandline arguments
if [ $# -lt 1 ]
then
RESEARCH_BUILD=`pwd`"/build"
RESEARCH_TOPICS=`pwd`
echo -e "No building directory was specified."
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
echo -e "No extra topics directory was specified."
else
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
fi
mkdir -p $RESEARCH_BUILD
echo -e "Building into directory $RESEARCH_BUILD ..."
echo -e "Using .md-files from $RESEARCH_TOPICS ..."
# specify URL to avoid use of local library
# see https://docs.mathjax.org/en/latest/web/start.html#ways-of-accessing-mathjax
# and https://www.jsdelivr.com/package/npm/mathjax
# create plain _research.html to be integrated into other files
for f in $RESEARCH_TOPICS/*.md
do
filename=$(basename -- "$f")
echo "Creating " $RESEARCH_BUILD/"${filename%.md}"_research.html " ..."
pandoc $f -o $RESEARCH_BUILD/"${filename%.md}"_research.html \
--mathjax=$MATHJAX_URL \
-c css/base.css \
-c css/extra.css \
-c "css/print.css" \
-c "css/superfish.css" \
-c "css/superfish-vertical.css" \
-c "css/base_mode.css"
done
......@@ -3,4 +3,5 @@
filename=$(basename -- "$1")
echo "## `head -n 1 $1 | sed -e "s;#\s*;\[;g" -e "s;\(.*\);\1\](${filename%.md}.html);g"`"
\ No newline at end of file
echo "## `head -n 1 $1 | sed -e "s;#\s*;\[;g" -e "s;\(.*\);\1\](${filename%.md}.html);g"`"
......@@ -49,4 +49,5 @@ do
echo $wg
wget -qO- $baseurl/forschung/$wg > $RESEARCH_BUILD/forschung/$wg.tmp
iconv -f ISO-8859-1 -t UTF-8 $RESEARCH_BUILD/forschung/$wg.tmp > $RESEARCH_BUILD/forschung/$wg.html
done
\ No newline at end of file
done
#!/bin/bash
RESEARCH_STATIC=$RESEARCH_ROOT/static
RESEARCH_BUILD=$RESEARCH_STATIC/build
if [ $# -lt 1 ]
then
RESEARCH_BUILD=$RESEARCH_ROOT/static/build
echo -e "No building directory was specified."
else
RESEARCH_BUILD="$1"/build
fi
mkdir -p $RESEARCH_BUILD
echo -e "Building into directory $RESEARCH_BUILD ..."
cd $RESEARCH_BUILD
......@@ -23,15 +31,6 @@ do
-c "css/base_mode.css"
done
# get full TUHH staff pages ready for insertion
rm -rf $RESEARCH_ROOT/static/build/plain
mkdir -p $RESEARCH_ROOT/static/build/plain
cp $RESEARCH_ROOT/static/home/*.html $RESEARCH_ROOT/static/build/plain
cp $RESEARCH_ROOT/static/forschung/*.html $RESEARCH_ROOT/static/build/plain
cd $RESEARCH_ROOT/static/build
rm -rf *_final.html
# replace "MARKER" in .html files with research topics
for f in $RESEARCH_ROOT/static/build/plain/*html
do
......@@ -45,3 +44,4 @@ do
filename=$(basename -- "$f")
sed -e "/MARKER/r $RESEARCH_ROOT/static/build/${filename%.md}_research.html" -e '/MARKER/d' $RESEARCH_ROOT/static/topic/topic-template.html > "${filename%.md}"_final.html
done
......@@ -54,4 +54,5 @@ do
done
# adpat img path (prefix a dot)
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
\ No newline at end of file
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
......@@ -65,4 +65,5 @@ do
# adpat img path (prefix a dot)
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
done
\ No newline at end of file
done
......@@ -68,4 +68,5 @@ do
done
# adpat img path (prefix a dot)
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
\ No newline at end of file
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
#!/bin/bash
# processing command line arguments
# Check commandline arguments
if [ $# -lt 1 ]
then
RESEARCH_BUILD="$RESEARCH_ROOT/build"
RESEARCH_BUILD=`pwd`"/build"
RESEARCH_TOPICS=`pwd`
echo -e "No building directory was specified."
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
echo -e "No extra topics directory was specified."
else
RESEARCH_BUILD="$1"/build
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
fi
echo -e "Building into directory $RESEARCH_BUILD ..."
rm -rf $RESEARCH_BUILD
mkdir -p $RESEARCH_BUILD
echo -e "Building into directory $RESEARCH_BUILD ..."
echo -e "Using .md-files from $RESEARCH_TOPICS ..."
echo -e "Building into directory $RESEARCH_BUILD ..."
#rm -rf $RESEARCH_BUILD
baseurl='https://www.mat.tuhh.de'
#build index.html
#replace working group
cp $RESEARCH_ROOT/index.md $RESEARCH_BUILD/index.md
$RESEARCH_ROOT/bin/preproc_wg.sh $RESEARCH_BUILD/index.md $RESEARCH_BUILD >> $RESEARCH_BUILD/build.log 2>&1
#replace staff names
$RESEARCH_ROOT/bin/preproc_staff.sh $RESEARCH_BUILD/index.md $RESEARCH_BUILD >> $RESEARCH_BUILD/build.log 2>&1
#finalize file
sed -i "s;\](/img/;\](./img/;g" -e '/PROCESSED AUTOMATICALLY/ d' $RESEARCH_BUILD/index.md
#echo "Preprocessing Working Groups"
cp $RESEARCH_ROOT/static/index.md $RESEARCH_BUILD/index.md
#$RESEARCH_ROOT/bin/preproc_wg.sh $RESEARCH_BUILD/index.md $RESEARCH_BUILD >> $RESEARCH_BUILD/build.log 2>&1
#
##replace staff names
#echo "Preprocessing Staff"
#$RESEARCH_ROOT/bin/preproc_staff.sh $RESEARCH_BUILD/index.md $RESEARCH_BUILD >> $RESEARCH_BUILD/build.log 2>&1
#
##finalize file
#sed -i -e "s;\](/img/;\](./img/;g" -e '/PROCESSED AUTOMATICALLY/ d' $RESEARCH_BUILD/index.md
#build rest of the topics
for f in $RESEARCH_ROOT/topics/*.md
for f in $RESEARCH_TOPICS/*.md
do
filename=$(basename -- "$f")
#make output copy
echo "Preprocessing $filename..."
cp $f $RESEARCH_BUILD/$filename
#extract title of topic
......@@ -49,4 +61,4 @@ do
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
done
echo "Finished preprocessing topics."
\ No newline at end of file
echo "Finished preprocessing topics."
......@@ -55,4 +55,5 @@ do
sed -i "s;### Working Groups:\(.*\)$wg\(.*\);### Working Groups:\1\[$fullname\]($wg.html)\2;g" $RESEARCH_BUILD/$filename
#sed -i "s;### Working Groups:\(.*\)$wg\(.*\);### Working Groups:\1\[$fullname\]($baseurl/forschung/$wg)\2;g" $RESEARCH_BUILD/$filename #uncomment this line for linking the mat.tuhh.de webpage
done
\ No newline at end of file
done
#!/bin/bash
# processing command line arguments
# Check commandline arguments
if [ $# -lt 1 ]
then
RESEARCH_BUILD=`pwd`"/build"
RESEARCH_TOPICS=`pwd`
echo -e "No building directory was specified."
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
echo -e "No extra topics directory was specified."
else
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
fi
mkdir -p $RESEARCH_BUILD
echo -e "Building into directory $RESEARCH_BUILD ..."
echo -e "Including _research.html-files from $RESEARCH_TOPICS ..."
# replace "MARKER" in .html files with research topics
for f in $RESEARCH_ROOT/static/{home,forschung}/*.html
do
filename=$(basename -- "$f")
if [ -f "$RESEARCH_TOPICS/${filename%.html}_research.html" ]
then
echo "found $f"
sed -e "/MARKER/r $RESEARCH_TOPICS/${filename%.html}_research.html" \
-e '/MARKER/d' $f > "$RESEARCH_BUILD/${filename%.html}"_final.html
fi
done
# Building standalone topics and index
RESEARCH_TEMPLATE="$RESEARCH_ROOT/static/topic/topic-template.html"
for f in $RESEARCH_ROOT/topics/*.md $RESEARCH_BUILD/index.md
do
filename=$(basename -- "$f")
echo "Looking for $RESEARCH_TOPICS/${filename%.md}_research.html"
if [ -f "$RESEARCH_TOPICS/${filename%.md}_research.html" ]
then
echo "found $f"
echo "creating "$RESEARCH_BUILD/${filename%.md}"_final.html"
sed -e "/MARKER/r $RESEARCH_TOPICS/${filename%.md}_research.html" \
-e '/MARKER/d' $RESEARCH_TEMPLATE > "$RESEARCH_BUILD/${filename%.md}"_final.html
fi
done
......@@ -63,4 +63,5 @@ fi
#END Test 4
#this should be the last line (errors exit earlier)
exit 0
\ No newline at end of file
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment