Created
March 10, 2021 12:26
-
-
Save euikook/712b370025f1af40efa125a6384e79f2 to your computer and use it in GitHub Desktop.
hugo-tag-cloud-with-jqcloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="https://golangkorea.github.io/js/jqcloud/jqcloud.min.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://golangkorea.github.io/js/jqcloud/jqcloud.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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