jnordberg / wintersmith

A flexible static site generator
http://wintersmith.io/
MIT License
3.5k stars 332 forks source link

Fixes Feed Not Displaying Author Name #329

Closed davidsivocha closed 6 years ago

davidsivocha commented 6 years ago

By Default, the feed doesn't actually show the author name as it's not loaded

By creating a variable that correctly reads from the article metadata to pull in the JSON of the Author we can present the article author name in the feed.

jnordberg commented 6 years ago

Thanks! Can you add a fallback if the author.json is not found?

davidsivocha commented 6 years ago

Added a one liner, that creates a basic empty object tree so that it doesn't throw an error

davidsivocha commented 6 years ago

I've refactored now. It will look for an author.json

If one is found it will use that, otherwise it will use the default original behaviou

jnordberg commented 6 years ago

Looks good, tested?

davidsivocha commented 6 years ago

Tested under the following circumstances.

  1. author.json not present - Uses default behaviour
  2. author.json present with no name field - will display no author data. No errors. behaviour intended
  3. author.json present with name field - displays name from author json. Behaviour intended
davidsivocha commented 6 years ago

All test cases compile successfully with wintersmith build flagging no errors

jnordberg commented 6 years ago

Thanks!

A+++ would merge again

davidsivocha commented 6 years ago

Haha thanks. I'll have to see what else I can contribute to this!