Possible to output no content for a section?

I’d like to create a folder in content called “blocks” and have the content within it available to add to other templates, but not generate output itself.

Use case: I want to have a user editable “announcement” banner on all pages of the site.

Is this possible? E.g. in config.toml, something like…

[outputs]
home = [ “HTML”, “JSON”]
page = [ “HTML”, “JSON”]
section = [ “HTML”, “JSON”]
section–blocks = []

Just to expand - the client is editing the site on Forestry.io and needs to have the fully featured WYSIWYG editor for these items, so unfortunately site params and front matter won’t do the trick.

Thanks for your help!

I don’t think there is a config option, custom outputs can only be set by “Page Kind (i.e, page, home, section, taxonomy, or taxonomyTerm)”.

Announcement banners could be done with data files. If I were making it for a client, I would have a simple announcement.yml with a minimal amount of fields; the presumption is the announcement will be simple, and only one will run at a time. You can make it as complex as you need, though.

Here’s an issue on Github relating to this topic.

And, the last post on this thread presents a hacky solution, which I’m currently using but honestly don’t feel very comfortable with:

2 Likes

Thanks. This looks like the best option for the moment.