Change logic of input and output targets of post-processing scripts
What does this MR do and why?
Change logic of input and output targets of post-processing scripts. This was mainly done to make minify
work again.
- Simplify
compress_images.sh
to provide only one target. - Simplify
normalize-links.sh
to provide output and input targets. - Simplify
minify-assets.sh
to provide output and input targets, and run minify only once in the whole site directory. - Change
single.Dockerfile
to account for the script changes.
Fixes #1612 (closed).
How to set up and validate locally
Without Docker
- Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
- Check out this branch.
- Compile the site:
make compile
- Use the scripts for post-processing:
scripts/normalize-links.sh public 15.11 scripts/compress_images.sh public mkdir dest scripts/minify-assets.sh dest public
- When
minify-assets.sh
is run, you should see the following output:INFO: Assets minified! INFO: Size before minifying: 2.4G INFO: Size after minifying: 950M INFO: Checking that the number of source and destination files is the same... SUCCESS: File count in public and dest: 3005/3005 INFO: Checking that the number of source and destination directories is the same... SUCCESS: Directory count in public and dest: 630/630
Mimicking the Docker build
- Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
- Check out this branch.
- Build the 15.11 image:
docker build --build-arg NANOC_ENV=production --build-arg VER=15.11 --build-arg SEARCH_BACKEND="lunr" --tag docs:15.11 -f dockerfiles/single.Dockerfile .
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Achilleas Pipinellis