Although Publii is focused on blogs and news sites, it can also be used for business or any other purpose.
I noticed that an Article shcema was automatically implemented. This is very positive if the whole website is news and articles but in my case I make websites of all kinds so a good implementation of the schema is key to the success of the web. In this sense, in a very simple way, you can disable the article schema and embed a custom schema.
The truth is that this is very useful because if we do everything at once we will have a section where embed html and javascript code independently in each article.
Attached are screenshots and the files to be modified. I used the Simple theme (v.6.2.2)
Archive: C:\Users\*\Documents\Publii\themes\simple\config.json
"postConfig": [
{
"name": "customHeadPost",
"label": "Custom head post",
"value": "",
"type": "text",
"group": "Custom Head post"
},
{
"name": "articleSchema",
"label": "Article Schema",
"value": 1,
"type": "select",
"options": [
{
"label": "Enabled",
"value": 1
},
{
"label": "Disabled",
"value": 0
}
]
},
.....
Archive: C:\Users\*\Documents\Publii\themes\simple\partials\head.hbs
In the head file we locate {{jsonLD}} which is responsible for performing the schema task and replace it with this code:
{{#if @config.post.articleSchema}}
{{jsonLD}}
{{/if}}
And now in any part before the closing of the <head> we include the following
{{#if @config.post.customHeadPost}}
{{{@config.post.customHeadPost}}}
{{/if}}
This would be all. By default everything remains as usual, but within each post will have added 2 new sections, one to disable the Article Schema for that particular post (you can also configure a global rule in theme settings) and you can also embed custom code in the head of that particular article.