Skip to content

Commit

Permalink
Ensure assets resolve from the domain root.
Browse files Browse the repository at this point in the history
  • Loading branch information
NickColley committed May 31, 2018
1 parent 4bb0f5d commit ddf78a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/views/examples/template-custom/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

{% set htmlClasses = 'app-html-class' %}
{% set htmlLang = 'fr' %}
{% set assetPath = '/' %}
{% set assetPath = '' %}
{% set themeColor = 'blue' %}
{% set bodyClasses = 'app-body-class' %}

Expand Down
14 changes: 7 additions & 7 deletions src/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
<meta name="theme-color" content="{{ themeColor | default('#0b0c0c') }}" /> {# Hardcoded value of $govuk-black #}

{% block headIcons %}
<link rel="shortcut icon" href="{{ assetPath | default('assets/') }}images/favicon.ico" type="image/x-icon" />
<link rel="mask-icon" href="{{ assetPath | default('assets/') }}images/govuk-mask-icon.svg" color="{{ themeColor | default('#0b0c0c') }}"> {# Hardcoded value of $govuk-black #}
<link rel="apple-touch-icon" sizes="180x180" href="{{ assetPath | default('assets/') }}images/govuk-apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="167x167" href="{{ assetPath | default('assets/') }}images/govuk-apple-touch-icon-167x167.png">
<link rel="apple-touch-icon" sizes="152x152" href="{{ assetPath | default('assets/') }}images/govuk-apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" href="{{ assetPath | default('assets/') }}images/govuk-apple-touch-icon.png">
<link rel="shortcut icon" href="{{ assetPath | default('/assets') }}/images/favicon.ico" type="image/x-icon" />
<link rel="mask-icon" href="{{ assetPath | default('/assets') }}/images/govuk-mask-icon.svg" color="{{ themeColor | default('#0b0c0c') }}"> {# Hardcoded value of $govuk-black #}
<link rel="apple-touch-icon" sizes="180x180" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="167x167" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-167x167.png">
<link rel="apple-touch-icon" sizes="152x152" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon.png">
{% endblock %}

{% block head %}{% endblock %}

{# The default og:image is added below head so that scrapers see any custom metatags first, and this is just a fallback #}
<meta property="og:image" content="{{ assetPath | default('assets/') }}images/govuk-opengraph-image.png">
<meta property="og:image" content="{{ assetPath | default('/assets') }}/images/govuk-opengraph-image.png">
</head>
<body class="govuk-template__body {{ bodyClasses }}">
<script>document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');</script>
Expand Down

0 comments on commit ddf78a5

Please sign in to comment.