hugo-quiz
hugo-quiz copied to clipboard
CDN issue
Hello,
I successfully integrated 'hugo-quiz' into my website. However, I encountered an issue I'd like to address. Despite using Hugo without minification for the quiz-specific pages, I faced corruption problems in the production environment due to the CDN (CloudFlare).
I resolved this by configuring CloudFlare "Page Rules" to disable "Performance" for these pages.
However, I believe it would be more effective if this issue could be resolved on your end. Perhaps allowing the option to pass a JSON array with the questions instead of relying on Markdown could be a viable solution.
Related to this. It'd be great if we could still use minification when using the shortcode. @eyal7773, how did you disable minification on specific pages?
In addition, I'm also using Cloudflare Pages to deploy my site, but everything is fine on my side as long as I disable HTML minification.
Related to this. It'd be great if we could still use minification when using the shortcode. @eyal7773, how did you disable minification on specific pages?
In addition, I'm also using Cloudflare Pages to deploy my site, but everything is fine on my side as long as I disable HTML minification.
Hi @rodrigoalcarazdelaosa , To hack the minification issue, I wrote a small script, which do the "hugo" compiling process twice :
- Once without minification (using the cli option
--config SOME_FILE
- Then Copy the relevant articles to side folder
- Then run hugo again - but with minification.
- And then copy the relevant articles to the published folder, instead of the minified files.
#!/bin/bash
echo "-------- BUILD WITHOUT MINIFY --- JUST FOR TESTS FOLDER ----"
hugo --gc --cleanDestinationDir --config config-no-minify.yml
echo "-------- COPY the test folder aside, to use it later -------"
cp -r ./public/someFolder ../tmp-tests
echo "-------- BUILD WITH MINIFY ---------------------------------"
hugo --gc --cleanDestinationDir --minify
echo "-------- COPY the not-minified tests -----------------------"
cp -r ../tmp-tests/tests/ ./public/someFolder/
And the config-no-minify.yml
file , include this lines :
minify:
disableXML: false
minifyOutput: false
Hope it will help you.
Thanks! Let's continue discussion here: https://github.com/bonartm/quizdown-js/issues/53