Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zhaohuabing/hugo-theme-cleanwhite.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/footer.html')
-rw-r--r--layouts/partials/footer.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index f061726..281587e 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -430,3 +430,19 @@
</script>
{{ end }}
+{{ if or .Page.Params.plantuml .Site.Params.plantuml }}
+<!-- PlantUML -->
+<script src="https://cdn.jsdelivr.net/gh/jmnote/plantuml-encoder@1.2.4/dist/plantuml-encoder.min.js" integrity="sha256-Qsk2KRBCN5qVZX7B+8+2IvQl1Aqc723qV1tBCQaVoqo=" crossorigin="anonymous"></script>
+<script>
+(function(){
+ let plantumlPrefix = "language-plantuml";
+ Array.prototype.forEach.call(document.querySelectorAll("[class^=" + plantumlPrefix + "]"), function(code){
+ let image = document.createElement("IMG");
+ image.loading = 'lazy'; // Lazy loading
+ image.src = 'http://www.plantuml.com/plantuml/svg/~1' + plantumlEncoder.encode(code.innerText);
+ code.parentNode.parentNode.insertBefore(image, code.parentNode);
+ code.parentNode.style.display = 'none';
+ });
+})();
+</script>
+{{ end }}