Where would be the correct place to include the code for page title, meta tags, css fonts and so on when using Mantra?
I was wondering if there is a way around wrapping everything into a blaze template that includes that…
Where would be the correct place to include the code for page title, meta tags, css fonts and so on when using Mantra?
I was wondering if there is a way around wrapping everything into a blaze template that includes that…
Read on react-mounter for including page title and meta tags. There are nothing about blaze in Mantra as it is architecture for React.
Thanks!
meteor-dochead is a great solution.
Example for including CSS. They also support title, meta, JS and JSON data:
Server side:
var linkInfo = {
rel: "stylesheet",
href: "https://fonts.googleapis.com/icon?family=Material+Icons"
};
DocHead.addLink(linkInfo);
Where I should put this code above in the Mantra app?
Create a new file: /client/configs/page_setup.js with the following code:
export default function () {
var title = "Your Page Title";
DocHead.setTitle(title);
var metaInfo = {name: "description", content: "DESCRIPTION"};
DocHead.addMeta(metaInfo);
var linkInfo = {rel: "stylesheet", href: "https://fonts.googleapis.com/icon?family=Material+Icons"};
DocHead.addLink(linkInfo);
}
Add the following to the file /client/main.js
import PageSetup from “./configs/page_setup”;
PageSetup();