{"action":"created","issue":{"url":"https://api.github.com/repos/gohugoio/hugo/issues/4953","repository_url":"https://api.github.com/repos/gohugoio/hugo","labels_url":"https://api.github.com/repos/gohugoio/hugo/issues/4953/labels{/name}","comments_url":"https://api.github.com/repos/gohugoio/hugo/issues/4953/comments","events_url":"https://api.github.com/repos/gohugoio/hugo/issues/4953/events","html_url":"https://github.com/gohugoio/hugo/issues/4953","id":341594993,"node_id":"MDU6SXNzdWUzNDE1OTQ5OTM=","number":4953,"title":"ByLinkTitle seemingly sorts by date if link title not explicitly set","user":{"login":"zombiezen","id":181535,"node_id":"MDQ6VXNlcjE4MTUzNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/181535?v=4","gravatar_id":"","url":"https://api.github.com/users/zombiezen","html_url":"https://github.com/zombiezen","followers_url":"https://api.github.com/users/zombiezen/followers","following_url":"https://api.github.com/users/zombiezen/following{/other_user}","gists_url":"https://api.github.com/users/zombiezen/gists{/gist_id}","starred_url":"https://api.github.com/users/zombiezen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zombiezen/subscriptions","organizations_url":"https://api.github.com/users/zombiezen/orgs","repos_url":"https://api.github.com/users/zombiezen/repos","events_url":"https://api.github.com/users/zombiezen/events{/privacy}","received_events_url":"https://api.github.com/users/zombiezen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-16T16:46:25Z","updated_at":"2018-07-16T18:48:48Z","closed_at":null,"author_association":"NONE","body":"I have a bunch of content in my Hugo site that I'm sorting by link title in a list template (using `.Data.Pages.ByLinkTitle`).  However, `.ByLinkTitle` appears to not work as documented; it appears to be sorting by date order. `.ByTitle` works as expected.  All of the content being sorted does not have an explicit link title set, but they do all have titles set in the front matter. I'm able to reproduce this on Hugo 0.44.\r\n\r\nThe site source is [here](https://github.com/zombiezen/gg/tree/42822ca436c3f1bf994ffb77f616be099cbb405f/docs), you can reproduce by changing [this line of layouts/commands/list.html](https://github.com/zombiezen/gg/blob/42822ca436c3f1bf994ffb77f616be099cbb405f/docs/layouts/commands/list.html#L9) to use `.ByLinkTitle` and seeing the effects on `/cmd/`.  Let me know if you need a more minimal reproduction case.\r\n\r\nBased on examining the Hugo source briefly, what I'm suspecting here is that `Page.linkTitle` is not being set correctly to the implicit default of title when considering for sort, but I couldn't confirm this with certainty."},"comment":{"url":"https://api.github.com/repos/gohugoio/hugo/issues/comments/405343004","html_url":"https://github.com/gohugoio/hugo/issues/4953#issuecomment-405343004","issue_url":"https://api.github.com/repos/gohugoio/hugo/issues/4953","id":405343004,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTM0MzAwNA==","user":{"login":"bep","id":394382,"node_id":"MDQ6VXNlcjM5NDM4Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/394382?v=4","gravatar_id":"","url":"https://api.github.com/users/bep","html_url":"https://github.com/bep","followers_url":"https://api.github.com/users/bep/followers","following_url":"https://api.github.com/users/bep/following{/other_user}","gists_url":"https://api.github.com/users/bep/gists{/gist_id}","starred_url":"https://api.github.com/users/bep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bep/subscriptions","organizations_url":"https://api.github.com/users/bep/orgs","repos_url":"https://api.github.com/users/bep/repos","events_url":"https://api.github.com/users/bep/events{/privacy}","received_events_url":"https://api.github.com/users/bep/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T18:48:48Z","updated_at":"2018-07-16T18:48:48Z","author_association":"MEMBER","body":"I just checked the code, and it sorts by `linkTitle` only -- which I think is wrong, but not in the way you describe.\r\n\r\nI would expect it to sort by `LinktTitle` (the method), which has a fallback to `title` if no `linkTitle` etc. Now you will get odd results for the pages where no value is set for that field in front matter. We should probably also do the same the other way around for ByTitle.\r\n\r\n"}}
{"actor":{"display_login":"bep"}}