1
0
mirror of https://github.com/cirosantilli/china-dictatorship.git synced 2025-09-08 21:50:40 +02:00

create a redirect generation system to help move non dictatorship specifics out

This commit is contained in:
Ciro Santilli
2022-08-04 12:01:44 +00:00
parent 9d3a04412a
commit b1d5e42fdc
3 changed files with 47 additions and 9 deletions

View File

@@ -49,6 +49,7 @@ $(OUT_MULTIPAGE): $(IN) template_dir/*
-r asciidoctor-multipage \
$(OPTS) \
'$<'
./generate-redirects
clean:
rm -rf $(OUT) $(BODY)

View File

@@ -22720,13 +22720,11 @@ see also: <<why-is-ukraine-the-west-s-fault-by-john-mearsheimer-2015,Why is Ukra
TODO migrate all into this README.
. link:censorship.md[Censorship]
. link:media.md[Media]
. link:dissidents.md[Dissidents]
. link:movements.md[Movements against the Dictatorship]
. link:images/[Images]
. link:policies.md[Policies]
. link:stack-overflow.md[Stack Overflow]
. link:stack-overflow-profile.md[Stack Overflow profile]
. https://github.com/cirosantilli/china-dictatorship/blob/master/CONTRIBUTING.md
. https://github.com/cirosantilli/china-dictatorship/blob/master/media.md
. https://github.com/cirosantilli/china-dictatorship/blob/master/dissidents.md
. https://github.com/cirosantilli/china-dictatorship/blob/master/movements.md
. https://github.com/cirosantilli/china-dictatorship/blob/master/policies.md
. https://github.com/cirosantilli/china-dictatorship/blob/master/stack-overflow-profile.md
. Personal
.. link:communities-that-censor-politics.md[Communities that censor politics]
.. https://github.com/cirosantilli/china-dictatorship/blob/master/communities-that-censor-politics.md

39
generate-redirects Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -eu
for fromto in \
'CONTRIBUTING.md https://github.com/cirosantilli/china-dictatorship/blob/master/CONTRIBUTING.md' \
'censorship.md https://github.com/cirosantilli/china-dictatorship/blob/master/censorship.md' \
'communities-that-censor-politics.md https://github.com/cirosantilli/china-dictatorship/blob/master/communities-that-censor-politics.md' \
'dissidents.md https://github.com/cirosantilli/china-dictatorship/blob/master/dissidents.md' \
'flg-organ-harvesting= flg-organ-harvesting' \
'funded- funded-by-cia' \
'high-mountain-and-running-river https://ourbigbook.com/cirosantilli/high-mountain-and-flowing-water' \
'images https://github.com/cirosantilli/china-dictatorship-media' \
'media.md https://github.com/cirosantilli/china-dictatorship/blob/master/media.md' \
'overlook-human-rights-for-profitac overlook-human-rights-for-profit' \
'policies.md https://github.com/cirosantilli/china-dictatorship/blob/master/policies.md' \
'schinese-characters-are-insane chinese-characters-are-insane' \
'stack-overflow-profile.md https://github.com/cirosantilli/china-dictatorship/blob/master/stack-overflow-profile.md' \
'stack-overflow.md stack-overflow' \
'white-snow-in-sunny-spring https://ourbigbook.com/cirosantilli/white-snow-in-sunny-spring' \
do
from="${fromto%% *}"
to="${fromto#* }"
cat <<EOF > "out/multipage/$from.html"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Redirecting...</title>
<link rel="canonical" href="$to"/>
<meta http-equiv="refresh" content="0;url=$to" />
</head>
<body>
<h1>Redirecting...</h1>
<a href="$to">Click here if you are not redirected.</a>
<script>location='$to'</script>
</body>
</html>
EOF
done