diff --git a/.gitmodules b/.gitmodules index 790df32f..7457c6cd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,3 @@ path = cmake url = https://git.yzena.com/Yzena/YCMake.git branch = master -[submodule "docs/scripts"] - path = docs/scripts - url = https://git.yzena.com/Yzena/doc_scripts.git diff --git a/docs/scripts b/docs/scripts deleted file mode 160000 index a20f00e7..00000000 --- a/docs/scripts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a20f00e7842aa2003a898075845d27f7ced1095a diff --git a/docs/tools/compress.sh b/docs/tools/compress.sh new file mode 100755 index 00000000..18a8657e --- /dev/null +++ b/docs/tools/compress.sh @@ -0,0 +1,88 @@ +#! /bin/bash +# +# ***** BEGIN LICENSE BLOCK ***** +# +# Copyright 2017-2022 Yzena Tech +# +# Licensed under the Yzena Network License, Version 0.1 (the "Yzena Network +# License" or "YNL"). You may not use this file except in compliance with the +# Yzena Network License. +# +# You may obtain a copy of the Yzena Network License at +# +# https://yzena.com/yzena-network-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the Yzena Network License is distributed under the +# following disclaimer: +# +# As far as the law allows, this software comes as is, without any +# warranty or condition, and no contributor will be liable to anyone for +# any damages related to this software or this license, under any kind of +# legal claim. +# +# ****** END LICENSE BLOCK ****** +# + +usage() { + printf 'usage: %s \n' "$0" + exit 1 +} + +compress() { + f="$1" + zopfli "$f" --stdout > "$f.gz" +} + +export -f compress + +set -e + +script="$0" +scriptdir=$(dirname "$script") + +if [ "$#" -ge 1 ]; then + build_dir="$1" + shift +else + usage +fi + +if [ "$#" -ge 1 ]; then + docs_dir="$1" + shift +else + usage +fi + +if [ -f "$scriptdir/../purgecss.config.js" ]; then + printf '\nPurging CSS...' + cp "$scriptdir/../purgecss.config.js" "$docs_dir" + npx purgecss -c "purgecss.config.js" -o "$build_dir/_static" + printf 'Done\n' +fi + +exts="html +css +js +ttf +woff2 +atom +stl +xml +svg +eot +ico +gaml +json" + +s="" + +for t in $exts; do + temp=$(find $build_dir -type f -name "*.$t") + if [ "$temp" != "" ]; then + s=$(printf '%s\n%s' "$temp" "$s") + fi +done + +printf '%s\n' "$s" | parallel --progress --eta -j$CORES compress diff --git a/docs/tools/copy_static.sh b/docs/tools/copy_static.sh new file mode 100755 index 00000000..058f44ab --- /dev/null +++ b/docs/tools/copy_static.sh @@ -0,0 +1,51 @@ +#! /bin/bash +# +# ***** BEGIN LICENSE BLOCK ***** +# +# Copyright 2017-2022 Yzena Tech +# +# Licensed under the Yzena Network License, Version 0.1 (the "Yzena Network +# License" or "YNL"). You may not use this file except in compliance with the +# Yzena Network License. +# +# You may obtain a copy of the Yzena Network License at +# +# https://yzena.com/yzena-network-license/ +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the Yzena Network License is distributed under the +# following disclaimer: +# +# As far as the law allows, this software comes as is, without any +# warranty or condition, and no contributor will be liable to anyone for +# any damages related to this software or this license, under any kind of +# legal claim. +# +# ****** END LICENSE BLOCK ****** +# + +usage() { + printf 'usage: %s