use base and blocks pattern instead of partials (#75)

This commit is contained in:
Joe Palmieri 2018-04-24 16:42:32 -07:00 committed by Shawn Erquhart
parent 40defd77c3
commit 283cc37f74
4 changed files with 23 additions and 16 deletions

View File

@ -0,0 +1,21 @@
<!doctype html>
<html lang="{{ $.Site.Language.Lang }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<base href="{{ if getenv "CONTEXT" }}{{ cond (eq "production" (getenv "CONTEXT")) (getenv "URL") (getenv "DEPLOY_PRIME_URL") }}{{ else }}{{ $.Site.BaseURL }}{{ end }}">
<title>{{ $.Site.Title }}</title>
<link rel="stylesheet" href="css/main.css"/>
</head>
<body>
{{ block "header" . }}{{ partial "header" . }}{{end}}
{{ block "main" . }}{{end}}
{{ block "footer" . }}{{ partial "footer" . }}{{end}}
<script src="app.js"></script>
</body>
</html>

View File

@ -1,4 +1,4 @@
{{ partial "header" . }}
{{ define "main" }}
<h1>Hugo with Gulp, PostCSS and Webpack</h1>
@ -6,4 +6,4 @@
Hooray 🎉 - you've built this with <a href="https://github.com/netlify/victor-hugo">Victor-Hugo</a>!
</p>
{{ partial "footer" . }}
{{end}}

View File

@ -1,4 +0,0 @@
<script src="app.js"></script>
</body>
</html>

View File

@ -1,10 +0,0 @@
<!doctype html>
<html lang="{{ $.Site.Language.Lang }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<base href="{{ if getenv "CONTEXT" }}{{ cond (eq "production" (getenv "CONTEXT")) (getenv "URL") (getenv "DEPLOY_PRIME_URL") }}{{ else }}{{ $.Site.BaseURL }}{{ end }}">
<title>{{ $.Site.Title }}</title>
<link rel="stylesheet" href="css/main.css"/>
</head>
<body>