Skip to content

Instantly share code, notes, and snippets.

@trevanhetzel
Last active March 14, 2019 12:29
Show Gist options
  • Save trevanhetzel/b6134081e7d8617d8f9b to your computer and use it in GitHub Desktop.
Save trevanhetzel/b6134081e7d8617d8f9b to your computer and use it in GitHub Desktop.
Retrieve & show ALL tags used on a Ghost blog
// List item to append tags to
var $tagList = $('.tags');
// Get your data from this nice little endpoint in JSON form
$.get('/ghost/export/', function (data) {
var tags = data.data.tags;
for (var tag in tags) {
var tagName = tags[tag].name,
tagSlug = tags[tag].slug;
$tagList.append('<li><a href="/tag/' + tagSlug + '">' + tagName + '</li>');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment