Mike Gerwitz

Activist for User Freedom

path: root/src
diff options
authorMike Gerwitz <mtg@gnu.org>2019-01-19 00:50:06 -0500
committerMike Gerwitz <mtg@gnu.org>2019-01-19 00:50:06 -0500
commit89328fe20611da1f34ac633de315a900254267c1 (patch)
treeb0e159b2479d046012e781abff5deb517c6b9dc7 /src
parent20a9d360777dc51341f93da9d9b8ba928c1402b5 (diff)
Generate inline CSS for page header
The idea here is to provide as little CSS as is sensible for the initial page load to be styled in a layout similar to the final layout. This initial styling may be briefly visible on a slow conection. Slow connections can happen for a variety of reasons. For example, I'm a Tor user, and connection speeds vary. Mobile connection speeds can also vary wildly. This adds a few hundred bytes, but I was able to cut it down quite a bit, and I don't find this to be unreasonable relative to the other data on each page.
Diffstat (limited to 'src')
2 files changed, 4 insertions, 1 deletions
diff --git a/src/header.tpl.htm b/src/header.tpl.htm
index f2aa0e7..a8047b3 100644
--- a/src/header.tpl.htm
+++ b/src/header.tpl.htm
@@ -7,6 +7,8 @@
<link rel="stylesheet" type="text/css" href="/style.css" />
<title>@PAGE_TITLE@Mike Gerwitz</title>
<meta name="viewport" content="initial-scale=1.0" />
+ <style>
+ </style>
<body class="@PAGE_TYPE@">
diff --git a/src/mkheader b/src/mkheader
index 292fe4f..05920c5 100755
--- a/src/mkheader
+++ b/src/mkheader
@@ -46,7 +46,8 @@ main()
sed "s#@PAGE_TITLE@#$title${title:+ \\&mdash; }#g
- s#@PAGE_TYPE@#$type#g" \
+ s#@PAGE_TYPE@#$type#g
+ /<style>/rinline.css" \