Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wowchemy/starter-academic.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Cushen <gcushen@users.noreply.github.com>2019-02-20 20:55:45 +0300
committerGeorge Cushen <gcushen@users.noreply.github.com>2019-02-20 20:55:45 +0300
commit1d6e6e629ee5664a3ba592e2bd48aef5022536bc (patch)
tree77951c88433cdf70012179e0d8a931ef39ef0801
parent8a4c5c482f997a28d47218bef3d2b6e0f6fde585 (diff)
add scripts
-rw-r--r--scripts/init_kickstart.sh36
-rw-r--r--update_academic.sh51
-rwxr-xr-xview.sh3
3 files changed, 87 insertions, 3 deletions
diff --git a/scripts/init_kickstart.sh b/scripts/init_kickstart.sh
new file mode 100644
index 00000000..a1320215
--- /dev/null
+++ b/scripts/init_kickstart.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# WARNING: this will reset the project to the Kickstart template!
+
+# Update Academic
+source ../update_academic.sh
+
+#################################################
+
+# Install demo config
+rsync -av ../themes/academic/exampleSite/config/ ../config/
+
+# Install demo user
+rsync -av ../themes/academic/exampleSite/content/author/ ../content/author/
+
+# Install an example instance of each widget type
+rsync -av --exclude gallery/ ../themes/academic/exampleSite/content/home/ ../content/home/
+
+# Install indices
+rsync -av ../themes/academic/exampleSite/content/post/_index.md ../content/post/_index.md
+rsync -av ../themes/academic/exampleSite/content/publication/_index.md ../content/publication/_index.md
+rsync -av ../themes/academic/exampleSite/content/talk/_index.md ../content/talk/_index.md
+
+# Skip static dir - do not import the demo's media library
+
+#################################################
+
+# Post processing
+
+# Deactivate Hero
+sed -i '' -e 's/active = true/active = false/' ../content/home/hero.md
+
+# Manual Steps:
+# - content/home/project.md: Re-comment out project widget filters
+# - content/home/teaching.md: Re-modify title and content & set gradient background instead of image
+# - content/home/hero.md: Clear `hero_media` value & set gradient background instead of image
diff --git a/update_academic.sh b/update_academic.sh
index 8e33b7c3..a59f5b6b 100644
--- a/update_academic.sh
+++ b/update_academic.sh
@@ -1,10 +1,55 @@
#!/usr/bin/env bash
-# Display available updates to Academic.
+# Source Themes Academic: Theme updater
+# Checks for available updates and then asks to install any updates.
+# https://sourcethemes.com/academic/
+#
+# Command: bash ./update_academic.sh
+
+# Check for prerequisites.
+if [ ! -d .git ]; then
+ echo "ERROR: This tool is for Git repositories only."
+ exit 1;
+fi
+
+# Function to update Academic
+function install_update () {
+ # Apply any updates
+ git submodule update --remote --merge
+
+ # - Update Netlify.toml with required Hugo version
+ if [ -f ./netlify.toml ]; then
+ version=$(sed -n 's/^min_version = //p' themes/academic/theme.toml)
+ sed -i '' -e "s/HUGO_VERSION = .*/HUGO_VERSION = $version/g" ./netlify.toml
+ fi
+
+ echo
+ echo "View the release notes at: https://sourcethemes.com/academic/updates"
+ echo "If there are breaking changes, the config and/or front matter of content" \
+ "may need upgrading by following the steps in the release notes."
+}
+
+# Display currently installed version (although could be between versions if updated to master rather than tag)
+version=$(sed -n 's/^version = "//p' themes/academic/data/academic.toml)
+echo -e "Source Themes Academic v$version\n"
+
+# Display available updates
+echo -e "Checking for updates...\n"
cd themes/academic
git fetch
git log --pretty=oneline --abbrev-commit --decorate HEAD..origin/master
cd ../../
-# Update Academic.
-git submodule update --remote --merge
+title="Do you wish to install the above updates?"
+prompt="Choose an option and press Enter:"
+options=("Yes" "No")
+
+echo "$title"
+PS3="$prompt "
+select opt in "${options[@]}"; do
+ case $opt in
+ Yes ) install_update; break;;
+ No ) break;;
+ * ) break;;
+ esac
+done
diff --git a/view.sh b/view.sh
new file mode 100755
index 00000000..0757f089
--- /dev/null
+++ b/view.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+hugo --i18n-warnings server