Skip to content
Snippets Groups Projects
Commit a9acbdb8 authored by Julien Schmidt's avatar Julien Schmidt
Browse files

DRY up layouts

parent 92e61061
No related branches found
No related tags found
No related merge requests found
......@@ -13,10 +13,26 @@
<link rel="canonical" href="{{ .Permalink }}">
</head>
<body>
<!-- Code that all your templates share, like a header -->
{{ block "main" . }}
<!-- The part of the page that begins to differ between templates -->
{{ end }}
<main aria-role="main">
<header>
<h1>{{.Title}}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{.}}</span>
{{ end }}
</header>
<div class="container">
{{ block "main" . }}{{.Content}}{{ end }}
</div>
</main>
<aside>
<h3>Next Office Hours</h3><!-- TODO: translate -->
<ul>
{{ range getJSON "https://sprechstunden.stusta.mhn.de/appointments.json"}}
<li>{{ dateFormat "Monday, Jan 2, 2006 15:04" (int .start) }}-{{ dateFormat "15:04" (int .end) }}</li>
{{ end }}
</ul>
</aside>
<footer>
<div class="container">
<a href="https://stustanet.de/impressum">Impressum</a>
......
{{ define "main" }}
<main aria-role="main">
<header>
<h1>{{.Title}}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{.}}</span>
{{ end }}
</header>
<div class="container">
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
{{.Content}}
</div>
<aside>
<h3>Next Office Hours</h3><!-- TODO: translate -->
<ul>
{{ range getJSON "https://sprechstunden.stusta.mhn.de/appointments.json"}}
<li>{{ dateFormat "Monday, Jan 2, 2006 15:04" (int .start) }}-{{ dateFormat "15:04" (int .end) }}</li>
{{ end }}
</ul>
</aside>
</main>
{{ end }}
{{ define "main" }}{{.Content}}{{ end }}
{{ define "main" }}
<main aria-role="main">
<header>
<h1>{{.Title}}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{.}}</span>
{{ end }}
</header>
<div class="container">
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
{{.Content}}
</div>
<aside>
<h3>Next Office Hours</h3><!-- TODO: translate -->
<ul>
{{ range getJSON "https://sprechstunden.stusta.mhn.de/appointments.json"}}
<li>{{ dateFormat "Monday, Jan 2, 2006 15:04" (int .start) }}-{{ dateFormat "15:04" (int .end) }}</li>
{{ end }}
</ul>
</aside>
</main>
{{ end }}
{{ define "main" }}{{.Content}}{{ end }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment