forked from OI-wiki/OI-wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·24 lines (19 loc) · 1.1 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# Push HTML files to gh-pages automatically.
# Fill this out with the correct org/repo
ORG=24OI
REPO=OI-wiki
# This probably should match an email for one of your users.
set -e
# Clone Theme for Editing
if [ ! -d "mkdocs-material" ] ; then
git clone --depth 1 https://github.com/squidfunk/mkdocs-material.git
fi
sed -i "s/name: 'material'/name: null\n custom_dir: 'mkdocs-material\/material'\n static_templates:\n - 404.html/g" mkdocs.yml
# Change Google CDN to loli.net
sed -i 's/fonts.gstatic.com/gstatic.loli.net/g' mkdocs-material/material/base.html
sed -i 's/fonts.googleapis.com/fonts.loli.net/g' mkdocs-material/material/base.html
sed -i 's/{{ page.content }}/{% set pagetime = config.extra.pagetime %} {% if page and page.meta and page.meta.pagetime is string %} {% set pagetime = page.meta.pagetime %} {% endif %}{% if pagetime %}<blockquote class="page-time"><\/blockquote>{% endif %}\n {{ page.content }}/g' mkdocs-material/material/base.html
cp ./static/disqus.html mkdocs-material/material/partials/integrations/disqus.html
mkdocs build -v