Skip to content

Commit

Permalink
Merge pull request #11 from recrwplay/head-fixes
Browse files Browse the repository at this point in the history
Head fixes
  • Loading branch information
ggrossetie authored Dec 8, 2020
2 parents f4ecf11 + e45dfd6 commit 1f2107f
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 22 deletions.
3 changes: 3 additions & 0 deletions preview-src/private-page.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= Private Page
:page-no-index:
:page-no-canonical:
4 changes: 3 additions & 1 deletion preview-src/ui-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ page:
- content: Deprecated
url: deprecated.html
urlType: internal

- content: Private Page
url: private-page.html
urlType: internal

asciidoc:
attributes:
Expand Down
3 changes: 3 additions & 0 deletions src/partials/head-gtm.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#unless page.attributes.disabletracking}}
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-WK23PSS');</script>
{{/unless}}
8 changes: 6 additions & 2 deletions src/partials/head-info.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{#with page.canonicalUrl}}
{{#unless (ne page.attributes.no-canonical undefined)}}
{{#if page.canonicalUrl}}
<link rel="canonical" href="{{{this}}}">
{{/with}}
{{else}}
<link rel="canonical" href="https://neo4j.com{{{ page.attributes.canonical-root }}}{{ page.url }}">
{{/if}}
{{/unless}}
{{#unless (eq page.attributes.pagination undefined)}}
{{#with page.previous}}
<link rel="prev" href="{{{relativize ./url}}}">
Expand Down
16 changes: 5 additions & 11 deletions src/partials/head-meta.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<meta name="feedback" content="{{{this}}}">
{{/with}}

{{!-- Swiftype - TODO: to remove --}}
<meta class="swiftype" name="post-type" data-type="enum" content="{{{ or page.attributes.type 'Developer Guide' }}}">
<meta class="swiftype" name="neo4j-site" data-type="enum" content="Developer Site">
{{!-- Swiftype --}}
<meta class="swiftype" name="post-type" data-type="enum" content="{{{ or (or page.attributes.search-type page.attributes.type) 'Developer Guide' }}}">
<meta class="swiftype" name="neo4j-site" data-type="enum" content="{{{ or page.attributes.search-site 'Developer Site' }}}">
<meta class="swiftype" name="main-search-priority" data-type="integer" content="3">
{{#with page.attributes.environment}}
<meta class="swiftype" name="environment" data-type="string" content="{{{this}}}">
Expand All @@ -35,17 +35,15 @@
<meta name="twitter:creator" content="@neo4j" />
<meta name="twitter:site" content="@neo4j" />
<meta property="og:type" content="{{{ or page.attributes.postttype 'article' }}}" />
{{#with (or page.attributes.ogtitle page.title) }}
<meta property="og:title" content="{{{detag this}}} - Neo4j Graph Database Platform" />
{{/with}}
<meta property="og:title" content="{{#with (or page.attributes.ogtitle page.title) }}{{{detag this}}}{{/with}} - {{#with page.component.title}}{{{detag this}}}{{/with}}" />
<meta property="og:locale" content="{{{ or page.attributes.locale 'en_US' }}}">
{{#with (or page.attributes.ogimage 'https://dist.neo4j.com/wp-content/uploads/20190822071359/neo4j-database-meta-image.png' )}}
<meta property="og:image" content="{{{this}}}" />
{{/with}}
{{#with page.description}}
<meta property="og:description" content="{{this}}">
{{/with}}

<meta property="og:url" content="https://neo4j.com{{ page.attributes.canonical-root }}{{ page.url }}">
{{#with page.attributes.player}}
<meta name="twitter:player" content="{{this}}" />
<meta name="twitter:player:width" content="360" />
Expand All @@ -59,8 +57,4 @@
<meta name="twitter:description" content="{{this}}" />
{{/with}}
{{/with}}

<meta property="og:url" content="https://neo4j.com{{ page.attributes.canonical-root }}{{ page.url }}">
<link rel="canonical" href="https://neo4j.com{{ page.attributes.canonical-root }}{{ page.url }}">

<link rel="shortcut icon" href="https://neo4j.com/wp-content/themes/neo4jweb/favicon.ico" />
4 changes: 4 additions & 0 deletions src/partials/head-prelude.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1">
<meta name="msvalidate.01" content="B5163518CBE4A854B63801277FE5E35C" />
<meta name="google-site-verification" content="ucqagxjVuq0lJZeLKs0F5AppzK111lNt3IoxU6mzlJE" />
{{#if (ne page.attributes.no-index undefined) }}
<meta name="robots" content="noindex" />
{{else}}
<meta name="robots" content="index, follow" />
{{/if}}
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />

Expand Down
4 changes: 1 addition & 3 deletions src/partials/head-scripts.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{{#unless page.attributes.disabletracking}}
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-WK23PSS');</script>
{{/unless}}
{{! add scripts here }}
6 changes: 1 addition & 5 deletions src/partials/head-title.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<title>
{{{detag (or page.title defaultPageTitle)}}}
{{!-- {{#with site.title}} - {{this}}{{/with}} --}}
- Neo4j Graph Database Platform
</title>
<title>{{{detag (or page.title defaultPageTitle)}}}{{#with page.component.title}} - {{this}}{{/with}}</title>
1 change: 1 addition & 0 deletions src/partials/head.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{> head-prelude}}
{{> head-gtm}}
{{> head-title}}
{{> head-info}}
{{> head-styles}}
Expand Down

0 comments on commit 1f2107f

Please sign in to comment.