-
Notifications
You must be signed in to change notification settings - Fork 0
/
_getExternalData.sh
executable file
·51 lines (41 loc) · 1.52 KB
/
_getExternalData.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Script to get all external data and create the necessary pages
##############################################################################
### Step 1:
###
### Redirect structure
# Recreate the old MediaWiki based file structure and set it to redirect
# to the old homepage
defaultOldTarget="http://www.cometvisu.de/wiki/"
defaultNewTarget="/CometVisu/"
redirections=(`curl -L https://raw.githubusercontent.com/CometVisu/CometVisu/gh-pages/redirect-structure.map`)
for redirection in "${redirections[@]}" ; do
source="${redirection%%|*}"
target="${redirection##*|}"
if [ x$target = x ]
then
target=$defaultOldTarget$source
else
target=$defaultNewTarget$target
fi
mkdir -p "wiki/$source"
echo "---
layout: redirected
sitemap: false
redirect_to: $target
---
" > "wiki/$source/index.md"
done
##############################################################################
### Step 2:
###
### Manual data about widgets and plugins
curl -L https://raw.githubusercontent.com/CometVisu/CometVisu/gh-pages/CVElements.yml > _data/CVElements.yml
##############################################################################
### Step 3:
###
### Get contributors from GitHub for CometVisu/CometVisu - this must be done
### semi automatic at the moment, as site.github.contributors does only
### contian the information for the repository CometVisu/cometvisu.github.io
### and no transversal is possible at the moment
curl -L https://api.github.com/repos/CometVisu/CometVisu/contributors > _data/contributors.json