try split page publish
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -1,5 +1,6 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
gem 'asciidoctor', '2.0.10'
|
gem 'asciidoctor', '2.0.11'
|
||||||
|
gem 'asciidoctor-multipage', '0.0.12 '
|
||||||
gem 'concurrent-ruby', '1.1.7'
|
gem 'concurrent-ruby', '1.1.7'
|
||||||
gem 'tilt', '2.0.10'
|
gem 'tilt', '2.0.10'
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
asciidoctor (2.0.10)
|
asciidoctor (2.0.11)
|
||||||
|
asciidoctor-multipage (0.0.12)
|
||||||
|
asciidoctor (>= 2.0.11, < 2.1)
|
||||||
concurrent-ruby (1.1.7)
|
concurrent-ruby (1.1.7)
|
||||||
tilt (2.0.10)
|
tilt (2.0.10)
|
||||||
|
|
||||||
@@ -9,9 +11,10 @@ PLATFORMS
|
|||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
asciidoctor (= 2.0.10)
|
asciidoctor (= 2.0.11)
|
||||||
|
asciidoctor-multipage (= 0.0.12)
|
||||||
concurrent-ruby (= 1.1.7)
|
concurrent-ruby (= 1.1.7)
|
||||||
tilt (= 2.0.10)
|
tilt (= 2.0.10)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.2
|
2.2.5
|
||||||
|
|||||||
29
Makefile
29
Makefile
@@ -1,6 +1,15 @@
|
|||||||
.PHONY: clean
|
.PHONY: clean multipage
|
||||||
|
|
||||||
|
IN = README.adoc
|
||||||
|
OPTS = \
|
||||||
|
--failure-level info \
|
||||||
|
--template-dir template_dir \
|
||||||
|
--trace \
|
||||||
|
-v
|
||||||
OUT = README.html
|
OUT = README.html
|
||||||
|
OUT_DIR = out
|
||||||
|
OUT_MULTIPAGE_DIR = $(OUT_DIR)/multipage
|
||||||
|
OUT_MULTIPAGE = $(OUT_MULTIPAGE_DIR)/README.html
|
||||||
HEAD = head.html
|
HEAD = head.html
|
||||||
BODY = body.html
|
BODY = body.html
|
||||||
FOOT = foot.html
|
FOOT = foot.html
|
||||||
@@ -12,7 +21,7 @@ else
|
|||||||
MEDIA_CMD = -a china-dictatorship-media-base='$(MEDIA)'
|
MEDIA_CMD = -a china-dictatorship-media-base='$(MEDIA)'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(OUT): README.adoc $(HEAD) $(FOOT) template_dir/*
|
$(OUT): $(IN) $(HEAD) $(FOOT) template_dir/*
|
||||||
@# --embedded + head/foot originally added to fix image height:
|
@# --embedded + head/foot originally added to fix image height:
|
||||||
@# https://stackoverflow.com/questions/63464732/how-to-set-a-custom-image-height-for-an-image-in-asciidoctor
|
@# https://stackoverflow.com/questions/63464732/how-to-set-a-custom-image-height-for-an-image-in-asciidoctor
|
||||||
@#
|
@#
|
||||||
@@ -21,13 +30,21 @@ $(OUT): README.adoc $(HEAD) $(FOOT) template_dir/*
|
|||||||
bundle exec asciidoctor \
|
bundle exec asciidoctor \
|
||||||
$(MEDIA_CMD) \
|
$(MEDIA_CMD) \
|
||||||
--embedded \
|
--embedded \
|
||||||
--failure-level info \
|
|
||||||
-o $(BODY) \
|
-o $(BODY) \
|
||||||
--template-dir template_dir \
|
$(OPTS) \
|
||||||
--trace \
|
|
||||||
-v \
|
|
||||||
'$<'
|
'$<'
|
||||||
cat $(HEAD) $(BODY) $(FOOT) > '$@'
|
cat $(HEAD) $(BODY) $(FOOT) > '$@'
|
||||||
|
|
||||||
|
multipage: $(OUT_MULTIPAGE)
|
||||||
|
|
||||||
|
$(OUT_MULTIPAGE): $(IN) template_dir/*
|
||||||
|
bundle exec asciidoctor \
|
||||||
|
-D '$(OUT_MULTIPAGE_DIR)' \
|
||||||
|
-a multipage-level=6 \
|
||||||
|
-b multipage_html5 \
|
||||||
|
-r asciidoctor-multipage \
|
||||||
|
$(OPTS) \
|
||||||
|
'$<'
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(OUT) $(BODY)
|
rm -rf $(OUT) $(BODY)
|
||||||
|
|||||||
12
push
12
push
@@ -3,27 +3,33 @@
|
|||||||
# https://github.com/cirosantilli/china-dictatorship#mirrors
|
# https://github.com/cirosantilli/china-dictatorship#mirrors
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
make
|
make
|
||||||
|
make multipage
|
||||||
git push --follow-tags
|
git push --follow-tags
|
||||||
git push git@gitlab.com:cirosantilli/china-dictatorship.git
|
git push git@gitlab.com:cirosantilli/china-dictatorship.git
|
||||||
|
|
||||||
|
out_dir=out/
|
||||||
|
out_multipage_dir="${out_dir}/multipage"
|
||||||
|
|
||||||
# GitHub pages.
|
# GitHub pages.
|
||||||
# One time initial setup.
|
# One time initial setup.
|
||||||
# git checkout --orphan gh-pages
|
# git checkout --orphan gh-pages
|
||||||
# and copy over https://github.com/cirosantilli/jekyll-min
|
# and copy over https://github.com/cirosantilli/jekyll-min
|
||||||
gh_pages_dir=out/gh-pages
|
gh_pages_dir="${out_dir}/gh-pages"
|
||||||
if [ ! -d "$gh_pages_dir" ]; then
|
if [ ! -d "$gh_pages_dir" ]; then
|
||||||
mkdir -p "$gh_pages_dir"
|
mkdir -p "$gh_pages_dir"
|
||||||
git clone --branch gh-pages --depth 1 "$(git remote get-url origin)" "$gh_pages_dir"
|
git clone --branch gh-pages --depth 1 "$(git remote get-url origin)" "$gh_pages_dir"
|
||||||
fi
|
fi
|
||||||
cp README.html "${gh_pages_dir}/index.html"
|
cp README.html "${gh_pages_dir}/index.html"
|
||||||
|
cp "${out_multipage_dir}/"* "$gh_pages_dir"
|
||||||
|
mv "${gh_pages_dir}/README.html" "${gh_pages_dir}/index-split.html"
|
||||||
git -C "$gh_pages_dir" add .
|
git -C "$gh_pages_dir" add .
|
||||||
if git -C "$gh_pages_dir" commit -m "$(git log -1 --format="%H")"; then
|
if git -C "$gh_pages_dir" commit -m "$(git log -1 --format="%H")"; then
|
||||||
git -C "$gh_pages_dir" push
|
git -C "$gh_pages_dir" push
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# GitLab pages
|
# GitLab pages
|
||||||
out_dir=out/
|
|
||||||
gl_pages_dir="${out_dir}/gl-pages"
|
gl_pages_dir="${out_dir}/gl-pages"
|
||||||
if [ ! -d "$gl_pages_dir" ]; then
|
if [ ! -d "$gl_pages_dir" ]; then
|
||||||
mkdir -p "${out_dir}"
|
mkdir -p "${out_dir}"
|
||||||
@@ -31,6 +37,8 @@ if [ ! -d "$gl_pages_dir" ]; then
|
|||||||
fi
|
fi
|
||||||
make MEDIA=https://gitlab.com/cirosantilli/china-dictatorship-media/-/raw/master OUT="${gl_pages_dir}/public/index.html"
|
make MEDIA=https://gitlab.com/cirosantilli/china-dictatorship-media/-/raw/master OUT="${gl_pages_dir}/public/index.html"
|
||||||
cp .gitlab-ci.yml "${gl_pages_dir}"
|
cp .gitlab-ci.yml "${gl_pages_dir}"
|
||||||
|
cp "${out_multipage_dir}/"* "$gh_pages_dir"
|
||||||
|
mv "${gh_pages_dir}/README.html" "${gh_pages_dir}/index-split.html"
|
||||||
git -C "$gl_pages_dir" add .
|
git -C "$gl_pages_dir" add .
|
||||||
if git -C "$gl_pages_dir" commit -m "$(git log -1 --format="%H")"; then
|
if git -C "$gl_pages_dir" commit -m "$(git log -1 --format="%H")"; then
|
||||||
git -C "$gl_pages_dir" push
|
git -C "$gl_pages_dir" push
|
||||||
|
|||||||
Reference in New Issue
Block a user