getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.6k stars 446 forks source link

option to base disqus thread identifier on slug instead of filename in cache #241

Closed faassen closed 11 years ago

faassen commented 11 years ago

I'm converting my old blog to Nikola and I'm also converting my blog comments to disqus along the way. My conversion code of course knows what slug a file is going to get, but it does not know about nikola's method of generating disqus thread ids based on the filename in its cache.

Since the slug is supposed to be unique (I think?) why can't it be used instead? Anyway, I've hacked the templates in a custom theme to do so; I've modified index.tmpl and post.tmpl to use post.pagenames['en'] as the slug identifier. gallery.tmpl I haven't changed as it bases the identifier on the title instead.

I realize for reasons of backwards compatibility an option is needed to turn on the use of the slug explicitly.

Codewise, couldn't the post be passed to html_disqus_link and html_disqus instead and then these functions can determine how to determine the thread identifier?

ralsina commented 11 years ago

The slug is not globally unique :-(

You can have posts/foo.txt (with slug foo) and stories/bar.txt (with slug foo)