weddell-static-site-generator-pug-stub

1.4.0 • Public • Published

Weddell Static Site Generator Pug Stub

This pug file is intended for use as a starting point for a pug template. It includes some basic boilerplate, and can be adapted to a variety of needs.

Locals Context

This template makes use of the route, router, params, redirectTo and path locals as populated by Weddell Static Site Generator.

It also looks for the following:

locale and locales

Object and Array[Object]

If your locals context has a locale member, this will be used as the current locale context for the template. The locales member will be used as a comprehensive array of locales supported by the app. Thes properties will be used to generate alt link tags and other meta tags in accordance with Google SEO recommendations. Locales should be of the following format:

{
    code: 'en-US',
    region: {
        code: 'US',
        name: 'United State'
    },
    language: {
        code: 'en',
        name: 'English'
    }
}

gtmContainerId

String

If a gtmContainerId member is found, a GTM tag will be added to the head.

scripts

Array[String]

If a scripts member is found, each string in the array will be used to append script tags to the page footer. These can be relative links or FQDNs.

stylesheets

Array[String]

If a stylesheets member is found, each item in the array will be used to append link stylesheet tags to the page header. These can be relative links or FQDNs.

url

String

Base URL context used by this app (where it will eventually be hosted).

metadata

Object

Object used to populate various meta tags. The object should be of the format:

{
    title: "My Site Title",
    description: "This is a description of my website",
    thumb: "https://cdn.mywebsite.com/my-image"
}

favicons

Array[Object]

If a favicons member is found, it will be used to append favicon link tags to the header. Favicon objects should be of the format:

{
    size: "32x32",
    href: "https://cdn.mysite.com/myicon.ico"
}

page

Object

If a page member is found, it will be used to append arbitrary HTML content to the page in various places.

{
    headHTML: "<div>My Head HTML will go in the head tag</div>",
    footerHTML: "<div>My footer HTML will go right after the bodyContent block</div>",
    bodyHTML:  "<div>My body HTML will go right after the opening body tag"
}

metaRefresh

bool

Determines whether a meta refresh tag is added to the head in case of a route redirect. Does not support hash in URL.

Pug blocks

Pug allows for template inheritance appends and overrides. The following blocks are made available in this template:

head

Immediately follows the opening head tag. Other blocks are nested inside of this one, so be careful overriding it.

meta

pageMeta

bodyHTML

bodyContent

footerHTML

headerHTML

Readme

Keywords

Package Sidebar

Install

npm i weddell-static-site-generator-pug-stub

Weekly Downloads

7

Version

1.4.0

License

MIT

Unpacked Size

7.39 kB

Total Files

3

Last publish

Collaborators

  • grygabrielphon