New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let collections have custom titles and descriptions #261

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@benjaminwil
Copy link

benjaminwil commented Jan 18, 2019

For collection feeds, you may want more control over the <title> of your feed. Previously, collection feeds had titles like this:

Site Title | Collection

This is an excellent fallback. But in some circumstances it is not acceptable:

Site Title | Secondary_blog_about_mysql

The site administrator may instead want a cleaner title, like "Site Title | Secondary Blog About MySQL" or even "Blog about MySQL".

Similarly, collection feeds would inherit the site.description value for their <subtitle>. This is a great fallback, but perhaps the collection feed description requires a more comprehensive (and different) description than the posts collection.

Because Jekyll collections can have arbitrary settings, we can use them to set things like titles and descriptions:

collections:
  secondary_blog_about_mysql:
    title: "Blog about MySQL"
    description: "Maybe the best blog about MySQL, actually."
    output: true

Because this is a part of the global collections configuration, we can use these new title and description values elsewhere on the site – not just in relation to the feed.

benjaminwil added some commits Jan 18, 2019

Let collections set custom feed titles
For collection feeds, you may want more control over the name of your
feed. Previously, collection feeds had titles like this:

> Site Title | Collection

This is an excellent fallback. But in some circumstances it is not
acceptable:

> Site Title | Secondary_blog_about_mysql

The site administrator may instead want a cleaner title, like "Site
Title | Secondary Blog About MySQL" or even "Blog about MySQL".

Because Jekyll collections can have arbitrary settings, we can use them
to set things like `title`s:

    collections:
      secondary_blog_about_mysql:
        title: "Blog about MySQL"
        output: true

Because this is a part of the global `collections` configuration, we can
use this new `title` attribute elsewhere on the site -- not just in
relation to the feed.
Let collections set custom feed descriptions
This commit, like my previous commits, lets collection metadata give
collection feeds more customizable metadata. Now collections with a
`title` and `description`  will inform the feed's `<title>` and
`<subtitle>` values.

@benjaminwil benjaminwil force-pushed the benjaminwil:master branch from 18f16a8 to 62e8e16 Jan 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment