Skip to content

Instantly share code, notes, and snippets.

@godfreyd
Last active May 31, 2017 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godfreyd/fba71361207a95134982579c13b0050d to your computer and use it in GitHub Desktop.
Save godfreyd/fba71361207a95134982579c13b0050d to your computer and use it in GitHub Desktop.
block('root').replace()(function() {
var ctx = this.ctx,
data = this.data = ctx.data,
meta = data.meta || {},
og = meta.og || {};
if (ctx.context) return ctx.context;
return {
block: 'page',
title: data.title,
favicon: '/images/favicon.ico',
styles: [
{
elem: 'css',
url: '/index.min.css'
}
],
scripts: [
{
elem: 'js',
url: '/index.min.js'
}
],
head: [
{ elem: 'meta', attrs: { name: 'description', content: meta.description } },
{ elem: 'meta', attrs: { property: 'og:title', content: og.title || data.title } },
{ elem: 'meta', attrs: { property: 'og:url', content: og.url } },
{ elem: 'meta', attrs: { property: 'og:site_name', content: og.siteName } },
{ elem: 'meta', attrs: { property: 'og:locale', content: og.locale || 'en_US' } },
{ elem: 'meta', attrs: { property: 'og:type', content: 'website' } },
{ elem : 'meta', attrs : { name : 'viewport', content : 'width=device-width, initial-scale=1' } }
],
mods: {
theme: 'islands',
view: data.view
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment