Repos / s4g / e2c4568526
commit e2c45685269614dce555adc075cabeef44621805
Author: Nhân <hi@imnhan.com>
Date:   Wed Jul 5 01:02:05 2023 +0700

    put Post style into separate css file too

diff --git a/www/_theme/base.tmpl b/www/_theme/base.tmpl
index 70d9099..9ef2b9e 100644
--- a/www/_theme/base.tmpl
+++ b/www/_theme/base.tmpl
@@ -7,6 +7,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="alternate" type="application/atom+xml" title="Atom feed" href="{{.Feed}}">
   <link rel="stylesheet" href="{{.Site.HomePath}}_theme/base.css">
+  {{- template "head" .}}
 </head>
 
 <body>
diff --git a/www/_theme/home.tmpl b/www/_theme/home.tmpl
index b16dd45..60e9a4a 100644
--- a/www/_theme/home.tmpl
+++ b/www/_theme/home.tmpl
@@ -1,3 +1,5 @@
+{{define "head"}}{{end}}
+
 {{define "body"}}
 <header>
   <h1 class="site-title">{{.Site.Name}}</h1>
diff --git a/www/_theme/post.css b/www/_theme/post.css
new file mode 100644
index 0000000..e1b7a1c
--- /dev/null
+++ b/www/_theme/post.css
@@ -0,0 +1,8 @@
+nav > a {
+  margin-right: 0.5rem;
+}
+
+.posted-on {
+  float: right;
+  font-style: italic;
+}
diff --git a/www/_theme/post.tmpl b/www/_theme/post.tmpl
index 4570873..934c934 100644
--- a/www/_theme/post.tmpl
+++ b/www/_theme/post.tmpl
@@ -1,3 +1,7 @@
+{{- define "head"}}
+  <link rel="stylesheet" href="{{.Site.HomePath}}_theme/post.css">
+{{- end}}
+
 {{define "body"}}
 <nav>
   <a href="{{.Site.HomePath}}">Home</a>
@@ -23,13 +27,4 @@
 {{.Content}}
 </content>
 
-<style>
-nav > a {
-  margin-right: 0.5rem;
-}
-.posted-on {
-  float: right;
-  font-style: italic;
-}
-</style>
-{{end}}
+{{- end}}
diff --git a/www/about/index.html b/www/about/index.html
index b85f9f3..7eefe28 100644
--- a/www/about/index.html
+++ b/www/about/index.html
@@ -7,6 +7,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="alternate" type="application/atom+xml" title="Atom feed" href="/feed.xml">
   <link rel="stylesheet" href="/_theme/base.css">
+  <link rel="stylesheet" href="/_theme/post.css">
 </head>
 
 <body>
@@ -32,17 +33,6 @@ <h2>No really</h2>
 </section>
 
 </content>
-
-<style>
-nav > a {
-  margin-right: 0.5rem;
-}
-.posted-on {
-  float: right;
-  font-style: italic;
-}
-</style>
-
 <footer>
 © 2022–2023 Coolio McCool<br>
 Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>
diff --git a/www/hello/index.html b/www/hello/index.html
index 6ff14fc..f9c85c7 100644
--- a/www/hello/index.html
+++ b/www/hello/index.html
@@ -7,6 +7,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="alternate" type="application/atom+xml" title="Atom feed" href="/feed.xml">
   <link rel="stylesheet" href="/_theme/base.css">
+  <link rel="stylesheet" href="/_theme/post.css">
 </head>
 
 <body>
@@ -30,17 +31,6 @@ <h1 class="post-title">Hello</h1>
 <p>Hello world.</p>
 
 </content>
-
-<style>
-nav > a {
-  margin-right: 0.5rem;
-}
-.posted-on {
-  float: right;
-  font-style: italic;
-}
-</style>
-
 <footer>
 © 2022–2023 Coolio McCool<br>
 Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>
diff --git a/www/mfws.html b/www/mfws.html
index 9ff5b9e..83eb6c9 100644
--- a/www/mfws.html
+++ b/www/mfws.html
@@ -7,6 +7,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="alternate" type="application/atom+xml" title="Atom feed" href="/feed.xml">
   <link rel="stylesheet" href="/_theme/base.css">
+  <link rel="stylesheet" href="/_theme/post.css">
 </head>
 
 <body>
@@ -119,17 +120,6 @@ <h2>Epilogue</h2>
 </section>
 
 </content>
-
-<style>
-nav > a {
-  margin-right: 0.5rem;
-}
-.posted-on {
-  float: right;
-  font-style: italic;
-}
-</style>
-
 <footer>
 © 2022–2023 Coolio McCool<br>
 Made with <a href="https://github.com/nhanb/webmaker2000">WebMaker2000</a>