Import qrcode.js and add option to print URLs as QR codes

This commit is contained in:
Clara Wildpaner
2022-08-14 22:38:34 +02:00
parent f24f9cc97e
commit 53bb9cce1e
3 changed files with 636 additions and 0 deletions

View File

@@ -67,6 +67,27 @@
</a>
</div>
</div>
{{ if .Site.Params.footer.qr_print }}
<div class="row d-none d-print-block">
<div class="col col-lg-2">
{{ $qrcode := resources.Get "js/qrcode.js" | minify }}
<script src="{{ $qrcode.Permalink }}"></script>
<div id="qrcode">
<script type="text/javascript">
new QRCode(document.getElementById("qrcode"), {
text: "{{ .Page.RelPermalink | absURL }}",
width: 128,
height: 128,
});
</script>
</div>
</div>
<div class="col col-md-auto">
{{ .Page.RelPermalink | absURL }}
</div>
</div>
{{ end }}
</div>
</footer>