Set meta headers by default

Hello,

I know how to set defaults meta headers in the configuration site, but I don’t know how to prefill the common meta in my FrontMatter header for all my pages. I dont want to c/v all my every-pages meta at each creation of a page…

Do you know how I can deal with it ?

Thank you
Arcturus Capture d’écran 2016-09-10 à 17

There is no way currently. Could be done with a plugin though.

Ok thanks, any suggestion for that plugin ?

Might be an interesting project. I’ll tinker a bit.

Oh, so you’re saying you’d want to set metadata by taxonomy? Like the same meta for all pages in a category or tag?

Obviously you can put meta tags in your templates, if they’re truly global.

@rhukster So can you inject headers during the onBuildPagesInitialized event? Ideally I’d just inject the metadata headers into page header and let the core Grav system process them. I’ll keep looking for a plugin that does something like that, but let me know if you know of one.

Ahh. Found Common\Page\Header API. We’ll see how that goes.

My goal is simply having typical metadata (H1, image, etc.) add by default in the header markdown of each article to fill them ^^ no needs of a huge things. But thanks to you for your ideas and projects :smiley:

Can you give an example of what you mean? “Metadata” usually means tags or the YAML at the top of the raw article file, but

and tags are neither of those things. If you want some sort of boilerplate to appear in each article, you can do that by modifying twig templates. Any example would be helpful.

Yes :slight_smile: For each page I want the title be the and I want to create a different “h1” for exemple. I want also set up manually Facebook markups or the Twitter ones. It’s not convenient to set it in the twig template, because I want edit it for each page.

You can put it in twig and still customize. You can add per-page headers that get passed on to the twig template: https://learn.getgrav.org/content/headers#custom-page-headers.

Ok nice but still, I just want that the admin panel just add this things in the frontmatter of each page :

title: "Things"
h1: "Things"
facebook-page: “things”

And not have to copy/paste it every time :slight_smile: