-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move bundle loader into page-template to prevent relative path issues…
… in other projects, and make pattern library templates extend page-template (#323)
- Loading branch information
Showing
4 changed files
with
126 additions
and
139 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="/favicons/favicon.ico"> | ||
<title>{{ pageInfo.title }}</title> | ||
<link rel="stylesheet" href="/css/main.css"> | ||
<link rel="stylesheet" href="/css/patternlib.css"> | ||
</head> | ||
|
||
<body class="patternlib-page{{ ' patternlib-page--example' if example }}{{ ' u-p-no' if page.fullWidth }}"> | ||
{% block master_body %} | ||
{% endblock %} | ||
<script>window.ONS_assets_base_URL = "/" </script> | ||
{% set scripts = "/scripts/main.js,/scripts/patternlib.js" %} | ||
{% include 'styles/page-template/_bundle-loader.njk' %} | ||
<script>document.documentElement.className = document.documentElement.className.replace('no-js','has-js')</script> | ||
{% if devMode %} | ||
<script>document.write('<script src="//' + (location.hostname || 'localhost').split(':')[0] + ':35729/livereload.js" defer></' + 'script>'); </script> | ||
{% endif %} | ||
</body> | ||
</html> | ||
{% extends "styles/page-template/_template.njk" %} | ||
|
||
{% set bodyClasses = "patternlib-page" %} | ||
|
||
{% if page == null %} | ||
{% set page = {} %} | ||
{% endif %} | ||
|
||
{% if example %} | ||
{% set bodyClasses = bodyClasses + " patternlib-page--example" %} | ||
{% endif %} | ||
|
||
{% if page.fullWidth %} | ||
{% set bodyClasses = bodyClasses + " u-p-no" %} | ||
{% endif %} | ||
|
||
{% set page = page | setAttribute("bodyClasses", bodyClasses) %} | ||
|
||
{% block head %} | ||
<link rel="stylesheet" href="/css/patternlib.css"> | ||
{% endblock %} | ||
|
||
{% block page %} | ||
{% block master_body %}{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="/favicons/favicon.ico"> | ||
<title>{{ pageInfo.title }}</title> | ||
<link rel="stylesheet" href="/css/main.css"> | ||
<link rel="stylesheet" href="/css/patternlib.css"> | ||
</head> | ||
|
||
<body class="proto"> | ||
{% block prototype_body %} | ||
{% endblock %} | ||
<script>window.ONS_assets_base_URL = "/" </script> | ||
{% set scripts = "/scripts/main.js,/scripts/patternlib.js" %} | ||
{% include 'styles/page-template/_bundle-loader.njk' %} | ||
{% if devMode %} | ||
<script>document.write('<script src="//' + (location.hostname || 'localhost').split(':')[0] + ':35729/livereload.js" defer></' + 'script>'); </script> | ||
{% endif %} | ||
</body> | ||
</html> | ||
{% extends "styles/page-template/_template.njk" %} | ||
|
||
{% if page == null %} | ||
{% set page = {} %} | ||
{% endif %} | ||
|
||
{% set page = page | setAttribute("bodyClasses", "proto") %} | ||
|
||
{% block page %} | ||
{% block prototype_body %}{% endblock %} | ||
{% endblock %} |