JumpButton Studio SEO for Handlebars
JumpButton Studio SEO
Add all metatags quickly for Handlebars and Express.JS Projects.
Update Log
After noticing a large amount of downloads for this plugin I decided to write a README.MD file as you can see
v 1.0.2
* Added some bug fixes to the default values.
+ Added a new: seo.getDefaultTitle()
Install
npm i --save jbs-seo-handlebars
Basic Usage
Directory Structure:
.
├── app.js
└── views
├── contact.hbs
├── home.hbs
└── layouts
└── main.hbs
2 directories, 3 files
app.js:
Creates a super simple Express app with Handlebars view engine and how to implement the SEO System.
const PORT = 8080;const express = ;const exphbs = ;const seo = defaultAuthor: "Lycrios" // Author Tag defaultDescription: "A handlebars/express package for easy SEO implmentation." // Description Tag defaultUrl: "https://www.jumpbuttonstudio.com/" // Canonical and og:url Tags defaultImage: "https://www.jumpbuttonstudio.com/img/logo.png" // og:image defaultKeywords: "seo,handlebars,express" // Keywords Tag defaultTitle: "JBS Seo Handlebars" // The Default Title og_type: "website" // Optional robots: "index,follow" // Optional; // These are default values that can be overridden. const app = ; app;app; app; app; app;
views/layouts/main.hbs
The main layout is the HTML page wrapper which can be reused for the different views of the app. {{{body}}}
is used as a placeholder for where the main content should be rendered.
{{{tags}}} {{title}} {{{body}}}
views/home.hbs
The content for the app's home view which will be rendered into the layout's {{{body}}}
.
Example App: {{title}}
views/contact.hbs
The content for the app's contact view which will be rendered into the layout's {{{body}}}
.
Contact Us Page
Rendered HTML
This is the rendered html for the home page.
JBS Seo Handlebars Example App: JBS Seo Handlebars