From: Dan Allen Date: Wed, 19 Jun 2019 08:58:46 +0000 (-0600) Subject: refactor the head partials X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c2f8f2f2be8e792e5123b8bd1be01e61703a3baf;p=working%2Feg-antora.git refactor the head partials - add more fine-grained partials - introduce defaultPageTitle variable - stub in favicon --- diff --git a/src/layouts/404.hbs b/src/layouts/404.hbs index 46bc48e..3974113 100644 --- a/src/layouts/404.hbs +++ b/src/layouts/404.hbs @@ -1,11 +1,7 @@ - - - {{detag (or page.title 'Page Not Found')}}{{#if site.title}} :: {{site.title}}{{/if}} - -{{> head}} +{{> head defaultPageTitle="Page Not Found"}} {{> header}} diff --git a/src/layouts/default.hbs b/src/layouts/default.hbs index e7710ca..fc17bf1 100644 --- a/src/layouts/default.hbs +++ b/src/layouts/default.hbs @@ -1,23 +1,7 @@ - - - {{{detag (or page.title 'Untitled')}}}{{#if site.title}} :: {{site.title}}{{/if}} - {{#if page.canonicalUrl}} - - {{/if}} - {{#if page.description}} - - {{/if}} - {{#if page.keywords}} - - {{/if}} - {{#if (or antoraVersion site.antoraVersion)}} - - {{/if}} - -{{> head}} +{{> head defaultPageTitle="Untitled"}} {{> header}} diff --git a/src/partials/head-icons.hbs b/src/partials/head-icons.hbs new file mode 100644 index 0000000..aa089d0 --- /dev/null +++ b/src/partials/head-icons.hbs @@ -0,0 +1 @@ + {{!-- --}} diff --git a/src/partials/head-info.hbs b/src/partials/head-info.hbs new file mode 100644 index 0000000..d0a3653 --- /dev/null +++ b/src/partials/head-info.hbs @@ -0,0 +1,14 @@ + {{#if page.canonicalUrl}} + + {{/if}} + {{#if page.component}} + {{#if page.description}} + + {{/if}} + {{#if page.keywords}} + + {{/if}} + {{/if}} + {{#if (or antoraVersion site.antoraVersion)}} + + {{/if}} diff --git a/src/partials/head-meta.hbs b/src/partials/head-meta.hbs index 541516c..1aef0af 100644 --- a/src/partials/head-meta.hbs +++ b/src/partials/head-meta.hbs @@ -1 +1 @@ -{{! Add additional meta tags here}} + {{!-- Add additional meta tags here --}} diff --git a/src/partials/head-prelude.hbs b/src/partials/head-prelude.hbs new file mode 100644 index 0000000..a8b267d --- /dev/null +++ b/src/partials/head-prelude.hbs @@ -0,0 +1,2 @@ + + diff --git a/src/partials/head-scripts.hbs b/src/partials/head-scripts.hbs index d113389..882f117 100644 --- a/src/partials/head-scripts.hbs +++ b/src/partials/head-scripts.hbs @@ -1,6 +1,4 @@ -{{#if site.keys.googleAnalytics}} -{{#with site.keys.googleAnalytics}} - - -{{/with}} -{{/if}} + {{#if site.keys.googleAnalytics}} + + + {{/if}} diff --git a/src/partials/head-styles.hbs b/src/partials/head-styles.hbs new file mode 100644 index 0000000..c1df1ae --- /dev/null +++ b/src/partials/head-styles.hbs @@ -0,0 +1 @@ + diff --git a/src/partials/head-title.hbs b/src/partials/head-title.hbs new file mode 100644 index 0000000..c96c8f2 --- /dev/null +++ b/src/partials/head-title.hbs @@ -0,0 +1 @@ + {{{detag (or page.title defaultPageTitle)}}}{{#if site.title}} :: {{site.title}}{{/if}} diff --git a/src/partials/head.hbs b/src/partials/head.hbs index b4ee621..7dd18b2 100644 --- a/src/partials/head.hbs +++ b/src/partials/head.hbs @@ -1,2 +1,7 @@ +{{> head-prelude}} +{{> head-title}} +{{> head-info}} +{{> head-styles}} {{> head-meta}} {{> head-scripts}} +{{> head-icons}}