Best way to modify core functionality without changing the core files

Hi All,

I am new to ghost CMS, I have some scripts related to SEO script(JS) which needs to be added in post page which should be generated from the server-side so that it can be rendered on the loading of the page and the google bot can have a track of it easily. (Note: I don’t want manipulation from the client end).
For that, I checked throughout the forum and also I checked in the source code but I am not getting the best way to achieve it. Please help me with this.

  • Ghost Version - 3.0.3

@shubham what exactly needs to be generated server-side?

In general, if you need to have deeper control over your rendered site content than the handlebars theming API allows then using Ghost in a headless JAMStack configuration may be a better fit. We have docs on some of the various frontend frameworks/static site generators that you can use in our docs…

1 Like

Hi Kevin,
Thanks for you response!!

Please correct me if I am wrong somewhere.
As per your suggestion, I have read the document and checked the custom integration too since it is somewhat relatable as per my need. But In that section, I found webhooks which will be connected to a particular integration and will trigger that particular webhook on a specific event.
What my expectation is:
Suppose there is a specific post page so whenever that post is loading in the browser that time whatever response is coming from the ghost(Basically it will return post HTML content), so on that HTML content I want to do some manipulation from the server end only and in result, the updated content should appear on the client end.

Now if I will go with the ghost’s custom integration with webhook then how I can achieve it? Because webhooks are having events related to POST/UPDATE requests only. And as I studied about the webhooks I found that if there is frequent request then we shouldn’t use webhooks as well as for GET request there are not an option to create webhooks on basis of the event.

Regards
Shubham

@shubham it’s difficult to make suggestions for how to work with your use-case without knowing exactly what the use-case is.

What exactly do you need to output in the HTML that has to be generated server side and how does it change for every page view?

@kevin Actually, in post page there are faqs and answers as well for which I have to create script schema which will be in the form of json/array and later on, on the basis of that the google bot will do the indexing.
I can do this on the client end only, but the problem here is that the javascript code will run once the DOM is loaded fully due to which it won’t be accessible by google bot.
So to achieve that functionality I want to prepare that script schema on the server side only so that it will be accessible by google bot.
If you have an alternate option then please let me know else tell me how to achieve it?

Please help me with above…I didn’t get any response.