I have a backbone application built on an Express JS API and Backbone JS frontend.
Every model and collection, thus consumes from the API, and I render them into the templates provided by a backbone view.
My attempt is this : Everytime the route changes (In turn, rendering a new view) I would like to change contents of the header tag - OGP related content, twitter cards, meta tags that help in SEO. I am not asking how to implement this, but this is the plan.
Are rumors true that OGP will not work this way? Do client side apps have no chance of having OGP entries which are dynamically changed by routes?
If yes, how should I change the way the app behaves without completely changing to server side rendering?
BackboneJS is a lightweight JavaScript library that allows to develop and structure the client side applications that run in a web browser. It offers MVC framework which abstracts data into models, DOM into views and bind these two using events.
You can use the Backbone. Model without jQuery, but Backbone.
Backbone. js is a model view controller (MVC) Web application framework that provides structure to JavaScript-heavy applications. This is done by supplying models with custom events and key-value binding, views using declarative event handling and collections with a rich application programming interface (API).
js respectively. The rest of your application code should be divided into modules that can live under their own modules directory. A module is an encapsulated group of structures (for the purposes of our post, Backbone structures) that work cohesively to provide a subset of functionality in your application.
Most OGP libraries will only parse HTML and not execute JavaScript. So the only way to go is server side rendering.
React has libraries like Helmet which helps with this. You can take inspiration from it to build it on Backbone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With