Last active
March 14, 2019 12:29
-
-
Save trevanhetzel/b6134081e7d8617d8f9b to your computer and use it in GitHub Desktop.
Retrieve & show ALL tags used on a Ghost blog
This file contains hidden or 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
// 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