Verified Commit 8bf08e27 authored by Silvio Rhatto's avatar Silvio Rhatto
Browse files

Fix: compile: minor improvements

parent 8f00b8d7
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
DIRNAME="`dirname $0`"
BASEDIR="$DIRNAME/.."
DOCS="docs"
REPO="https://gitlab.torproject.org/tpo/tpa/wiki-replica"
REPO="https://gitlab.torproject.org/tpo/tpa/wiki-replica.git"

# Check for sudo
if [ "`whoami`" != "root" ]; then
@@ -32,21 +32,8 @@ function clone_or_update {
  fi
}

# Apply global heuristics in all wikis
function apply_global_heuristics {
  # Replace Home.md with README.md
  find $DOCS -iname 'home.md' | while read entry; do
    path="`dirname $entry`"
    file="`basename $entry`"
    mv "$path/$file" "$path/README.md"
  done

  # Edits using sed
  find $DOCS -name '*.md' -exec sed -i -f scripts/fixes.sed {} \;
}

# Remove assets that can increase the build size
function remove_assets {
function remove_some_assets {
  # Remove sidebars
  # This should be done at mkdocs.yml instead
  #find $DOCS -name '_sidebar.md' -exec rm {} \;
@@ -63,11 +50,24 @@ function remove_assets {
  true
}

# Apply global heuristics in all wikis
function apply_global_heuristics {
  # Replace Home.md with README.md
  find $DOCS -iname 'home.md' | while read entry; do
    path="`dirname $entry`"
    file="`basename $entry`"
    mv "$path/$file" "$path/README.md"
  done

  # Edits using sed
  find $DOCS -name '*.md' -exec sed -i -f scripts/fixes.sed {} \;
}

# Clone or update repository
clone_or_update

# Remove some assets
remove_assets
remove_some_assets

# Apply global heuristics
apply_global_heuristics