aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-05 18:24:33 -0300
committerEuAndreh <eu@euandre.org>2020-08-05 18:24:33 -0300
commitaf70656ad80b56f5ef263b6f23c4580dab06cd78 (patch)
tree9282abda6746c93b6ba7868d56222beb74394cdb
parentUse tidy to format HTML (diff)
downloadeuandre.org-af70656ad80b56f5ef263b6f23c4580dab06cd78.tar.gz
euandre.org-af70656ad80b56f5ef263b6f23c4580dab06cd78.tar.xz
Remove HTML Tidy step
It conflicts with rouge, and changes the visualization of the final HTML. So I can look at a CSS locally served by 'jekyll serve' but in the end final output is different.
Diffstat (limited to '')
-rw-r--r--default.nix9
-rwxr-xr-xscripts/tidy-content.sh35
2 files changed, 1 insertions, 43 deletions
diff --git a/default.nix b/default.nix
index 98ac3c3..0a5ad82 100644
--- a/default.nix
+++ b/default.nix
@@ -33,15 +33,10 @@ in rec {
});
docs = utils.baseTask.overrideAttrs (baseAttrs: {
name = "${baseAttrs.name}-docs";
- buildInputs = [ jekyllEnv pkgs.html-tidy pkgs.moreutils ];
+ buildInputs = [ jekyllEnv ];
buildPhase = ''
patchShebangs .
jekyll build -d $out
- ./scripts/tidy-content.sh $out || {
- echo 'Error in formatting HTML. Reproduce with: '
- echo ' jekyll build && ./scripts/tidy-content.sh _site/'
- exit 1
- }
'';
});
};
@@ -58,8 +53,6 @@ in rec {
buildInputs = [
jekyllEnv
(pkgs.hunspellWithDicts (with pkgs.hunspellDicts; [ en-us ]))
- pkgs.html-tidy
- pkgs.moreutils
];
};
publishScript = utils.overwritingPublishScript {
diff --git a/scripts/tidy-content.sh b/scripts/tidy-content.sh
deleted file mode 100755
index 14e2edc..0000000
--- a/scripts/tidy-content.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-set -Eeuo pipefail
-
-end="\033[0m"
-red="\033[0;31m"
-red() { echo -e "${red}${1}${end}"; }
-
-usage() {
- red "Missing argument <${1}>.\n"
- cat <<EOF
-Usage:
- $0 <INPUT_DIR>
-
- Arguments:
- INPUT_DIR Input directory with the static HTML to be tidy-ed
-
-Examples:
- $0 _site/
-EOF
-}
-
-INPUT_DIR="${1:-}"
-[[ -z "${INPUT_DIR}" ]] && {
- usage 'INPUT_DIR'
- exit 2
-}
-
-format() {
- echo "${1}" >&2
- tidy --quiet yes -utf8 -indent <(tidy --quiet yes -utf8 -indent "${1}") | sponge "${1}"
-}
-export -f format
-
-find "${INPUT_DIR}" -type f -name '*.html' -print0 | \
- xargs -0 -I{} bash -c "format {}"