templates: use partials pattern
Anirudh Oppiliappan x@icyphox.sh
Tue, 05 Apr 2022 13:04:27 +0530
7 files changed,
13 insertions(+),
12 deletions(-)
M
templates/blog.html
→
templates/blog.html
@@ -1,7 +1,7 @@
<!DOCTYPE html> <html lang=en> <head> - {{ template "head.html" }} + {{ template "partials/head.html" }} <link rel="alternate" type="application/rss+xml" title="RSS" href="https://icyphox.sh/blog/feed.xml"> <meta name="description" content="{{ index .Meta "subtitle" }}"> </head>@@ -12,7 +12,7 @@ </title>
<body> <main> <div class="sidenav"> - {{ template "nav.html" }} + {{ template "partials/nav.html" }} </div> {{ .Body }} <table>@@ -29,7 +29,7 @@ {{ end }}
</table> </main> <footer> - {{ template "footer.html" }} + {{ template "partials/footer.html" }} </footer> </body>
M
templates/head.html
→
templates/partials/head.html
@@ -1,4 +1,5 @@
<link rel="stylesheet" href="/static/style.css" type="text/css"> +<link rel="stylesheet" href="/static/syntax.css" type="text/css"> <meta name="viewport" content="initial-scale=1,width"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta charset="UTF-8">
M
templates/index.html
→
templates/index.html
@@ -1,6 +1,6 @@
<html lang=en> <head> - {{ template "head.html" }} + {{ template "partials/head.html" }} <meta name="description" content="{{ index .Meta "subtitle" }}"> </head> <title>@@ -9,14 +9,14 @@ </title>
<body> <main> <div class="sidenav"> - {{ template "nav.html" }} + {{ template "partials/nav.html" }} </div> <article class="tagline"> {{ .Body }} </article> </main> <footer> - {{ template "footer.html" }} + {{ template "partials/footer.html" }} </footer> </body> </html>
M
templates/page.html
→
templates/page.html
@@ -1,7 +1,7 @@
<!DOCTYPE html> <html lang=en> <head> - {{ template "head.html" }} + {{ template "partials/head.html" }} <meta name="description" content="{{ index .Meta "subtitle" }}"> </head> <title>@@ -10,7 +10,7 @@ </title>
<body> <main> <div class="sidenav"> - {{ template "nav.html" }} + {{ template "partials/nav.html" }} </div> <article align="left"> <h1>{{ index .Meta "title" }}</h1>@@ -18,7 +18,7 @@ {{ .Body }}
</article> </main> <footer> - {{ template "footer.html" }} + {{ template "partials/footer.html" }} </footer> </body>
M
templates/text.html
→
templates/text.html
@@ -1,6 +1,6 @@
<html lang=en> <head> - {{ template "head.html" }} + {{ template "partials/head.html" }} <meta name="description" content="{{ index .Meta "subtitle" }}"> </head> <title>@@ -9,7 +9,7 @@ </title>
<body> <main> <div class="sidenav"> - {{ template "nav.html" }} + {{ template "partials/nav.html" }} </div> <article align="left"> <section class="post-date">@@ -28,7 +28,7 @@ <a href="mailto:x@icyphox.sh?Subject=Re: {{ index .Meta "title" }}">email</a>.
</article> </main> <footer> - {{ template "footer.html" }} + {{ template "partials/footer.html" }} </footer> </body>