Closed silvenon closed 8 years ago
Is there a way to make something like this work with jekyll-feed?
This is not something that's currently supported. Author information must either be universal in the configuration or specific to the post.
Ok. It's not that big of a deal anyway.
I certainly wouldn't mind supporting something like this if we decide we think having an authors datafile is the "best practice".
Ok, I'll reopen for a possible discussion. Close if you decide against it :+1:
Please do, it would be great to have some official best practices regarding naming stuff in your _config.yml
file and so on, because right now it's a bit of a mess :smiley:
This seems reasonable…
config.yml
:
authors:
default:
name: "Default"
email: "default@domain.com"
url: "http://default.com"
foo:
name: "Foo"
email: "foo@domain.com"
uri: "http://foo.com"
bar:
name: "Bar"
email: "bar@domain.com"
uri: "http://bar.com"
_posts/my-post.md
:
title: My Post
# author defaults to site.authors.default
_posts/my-other-post.md
title: My Other Post
author: foo
# maps to site.authors.foo
But I guess in order for this to make sense, it needs to be a Jekyll feature?
Check out https://github.com/jekyll/jekyll/issues/3983. This may solve everything for you.
@parkr yes, that's perfect :heart:
Because this is really a jekyll shortcoming, not jeykll-feed's, you can close if you want.
As a workaround for author display names you can you the author's display name as the key in the authors yaml hash. This still won't be able to provide you with the author's email & uri for the feed since the plugin will just get the name string, it will provide you with a friendly name though:
_config.yml
:
authors:
Mr Poster:
attribute1: value1
attribute2: value2
_posts/my-post.md
:
title: My Post
author: Mr Poster
If author data is going to be stored separately from the post, it seems that the way to do it would be with a data file, rather than cluttering up the _config.yml
On my blog there are two authors. Their properties are defined in the
_config.yml
:In the post's YAML frontmatter I put:
Then later I extract the actual author with
site.authors[post.author]
. I do this so I don't have to write all those details in each post.Is there a way to make something like this work with jekyll-feed?