drone/init_docsy.sh

35 lines
807 B
Bash
Raw Normal View History

2020-09-01 13:37:40 +00:00
#!/bin/bash
2020-09-01 16:08:20 +00:00
#
# Helper functions
#
declare -i term_width=120
h1() {
declare border padding text
border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
text="\\e[1m$*\\e[0m"
echo -e "$border"
echo -e "${padding}${text}${padding}"
echo -e "$border"
}
h2() {
printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
}
h1 "Inicjalizacja struktury hugo"
2020-09-01 13:40:42 +00:00
hugo new site --force ./
2020-09-01 16:08:20 +00:00
h1 "Inicjalizacja repozytorium git"
2020-09-01 13:37:40 +00:00
git init
2020-09-01 16:08:20 +00:00
h2 "Inicjalizacja submodułu z docsy"
2020-09-01 13:37:40 +00:00
git submodule add https://github.com/google/docsy.git themes/docsy
echo 'theme = "docsy"' >> config.toml
git submodule update --init --recursive
2020-09-10 14:04:13 +00:00
h1 "Obsłga mermaid"
mv tmp_layouts layouts
2020-09-01 16:08:20 +00:00
h1 "Czyszczenie repozytorium"
2020-09-01 13:37:40 +00:00
rm init_docsy.sh