Mike Gerwitz

Free Software Hacker+Activist

aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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)
downloadthoughts-89328fe20611da1f34ac633de315a900254267c1.zip
thoughts-89328fe20611da1f34ac633de315a900254267c1.tar.gz
thoughts-89328fe20611da1f34ac633de315a900254267c1.tar.bz2
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')
-rw-r--r--src/header.tpl.htm2
-rwxr-xr-xsrc/mkheader3
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>
</head>
<body class="@PAGE_TYPE@">
<header>
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" \
src/header.tpl.htm
}