Skip to content

Instantly share code, notes, and snippets.

@euikook
Created March 10, 2021 12:26
Show Gist options
  • Save euikook/712b370025f1af40efa125a6384e79f2 to your computer and use it in GitHub Desktop.
Save euikook/712b370025f1af40efa125a6384e79f2 to your computer and use it in GitHub Desktop.
hugo-tag-cloud-with-jqcloud
<link rel="stylesheet" href="https://golangkorea.github.io/js/jqcloud/jqcloud.min.css">
<script src="https://golangkorea.github.io/js/jqcloud/jqcloud.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var words = [
{{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
{ text: {{ $name }}, weight: {{ len $taxonomy.Pages }}, link: {{ (print ("/tags/" | relLangURL) ($name | urlize)) }} },
{{ end }}
]
$('#tags-cloud').jQCloud(words, { autoResize: true });
});
</script>
<div style="width:90%; min-height:300px" id="tags-cloud"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment