Skip to content

Instantly share code, notes, and snippets.

@bymathias
Created June 30, 2020 12:53
Show Gist options
  • Select an option

  • Save bymathias/539c3f8bca9bee148b39700f2d33a431 to your computer and use it in GitHub Desktop.

Select an option

Save bymathias/539c3f8bca9bee148b39700f2d33a431 to your computer and use it in GitHub Desktop.
-
var { options, files } = self.htmlWebpackPlugin
var { env, app, layout, page } = options
include _mixins
doctype
html(class="no-js has-navbar-fixed-top" lang=app.lang)
head
//- Set character encoding for the document (first)
meta(charset='utf-8')
//- Metadata about the HTML document
title #{page.title} | #{app.title}
meta(name='description' content=page.description || app.description)
//- Viewport for responsive web design
meta(name='viewport' content='width=device-width, initial-scale=1')
//- Google Search Console, Yandex, Bing Webmasters, Alexa
meta(name='google-site-verification' content=app.google.verify_id)
meta(name='yandex-verification' content=app.yandex.verify_id)
meta(name='msvalidate.01' content=app.bing.verify_id)
meta(name='alexaVerifyID' content=app.alexa.verify_id)
//- Facebook Open Graph data
//- meta(property='fb:app_id' content=app.facebook.app_id)
//- Open Graph Metadata
meta(property='og:url' content=env.APP_CLIENT_URL)
meta(property='og:type' content='website')
meta(property='og:title' content=page.title)
meta(property="og:image" content=env.APP_CLIENT_URL + page.image_url)
meta(property='og:description' content=page.description)
meta(property='og:site_name' content=app.title)
meta(property='article:author' content=page.author)
//- Twitter Cards
meta(name='twitter:card' content='summary')
meta(name='twitter:site' content=app.twitter.username)
//- meta(name='twitter:creator' content='@individual_account')
//- meta(name='twitter:url' content='')
meta(name='twitter:title' content=page.title)
meta(name='twitter:description' content=page.description)
meta(name='twitter:image' content=page.image_url)
//- IE Pinned Sites
meta(name='msapplication-tooltip' content=app.description)
meta(name='msapplication-starturl' content=env.APP_CLIENT_URL + '/index.html?pinned=true')
meta(name='msapplication-navbutton-color' content=app.theme_color)
//- Disable link highlighting upon tap in IE10
//- Similar to -webkit-tap-highlight-color in iOS Safari
meta(name='msapplication-tap-highlight' content='no')
//- Use SVG as a favicon for the most modern browsers
//- see: https://caniuse.com/#feat=link-icon-svg
link(rel='icon' type='image/svg+xml' href=env.APP_CLIENT_URL + '/favicon.svg')
// If a browser doesn’t support a SVG favicon
each size in ['16x16', '32x32']
link(rel='alternate icon' type='image/png' sizes=size href=env.APP_CLIENT_URL + '/favicon-' + size + '.png')
link(rel='alternate icon' href=env.APP_CLIENT_URL + '/favicon.ico')
//- Android Chrome homescreen icons
link(rel='manifest' href=env.APP_CLIENT_URL + '/site.webmanifest')
meta(name='mobile-web-app-capable' content='yes')
meta(name='theme-color' content=app.theme_color)
meta(name='application-name' content=app.title)
//- Windows 8 tile icons
meta(name='msapplication-config' content=env.APP_CLIENT_URL + '/browserconfig.xml')
meta(name='msapplication-TileColor' content=app.theme_color)
//- Apple touch icons and startup images
link(rel='apple-touch-icon' href=env.APP_CLIENT_URL + '/apple-touch-icon.png')
meta(name='apple-mobile-web-app-capable' content='yes')
meta(name='apple-mobile-web-app-status-bar-style' content='black-translucent')
meta(name='apple-mobile-web-app-title' content=app.title)
//- Opera Coast icon
//- link(rel='icon' type='image/png' sizes='228x228' href=env.APP_CLIENT_URL + '/coast-228x228.png')
each css in files.css
link(rel='stylesheet' href=env.APP_CLIENT_URL + '/' + css)
body
nav.navbar.is-fixed-top.has-shadow
.container
.navbar-brand
a(class='navbar-item has-text-weight-bold' href=env.APP_CLIENT_URL)=app.title
span.navbar-burger.burger(data-target='navbarMenuHeroA')
span
span
span
.navbar-menu#navbarMenuHeroA
.navbar-end
a(class='navbar-item' href=env.APP_CLIENT_URL + '/services') Services
a(class='navbar-item' href=env.APP_CLIENT_URL + '/about') About
span.navbar-item.buttons
a(class='button is-info' href=env.APP_CLIENT_URL + '/contact.html')
span.icon
i.fas.fa-at
span Contact
if layout === 'bare'
section.hero.is-fullheight-with-navbar
.hero-body
block content
p Hello World! Bare layout.
.hero-foot
footer.footer
+footer__legal()
else
#wrapper
block content
p Hello World! Default layout.
footer.footer
+footer__legal()
each js in files.js
script(src=env.APP_CLIENT_URL + '/' + js)
if env.PRODUCTION
//- Google Analytics: change UA-XXXXX-Y in `config.json` to be your site's ID.
script.
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
ga('create', '#{app.google.analytics_id}', 'auto');
ga('set', 'anonymizeIp', true);
ga('set', 'transport', 'beacon');
ga('send', 'pageview')
script(src='https://www.google-analytics.com/analytics.js' async)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment