mirror of https://github.com/aredn/aredn.git
Modify the style sheet URL to let the browser cache (#297)
while still supporting switching the style
This commit is contained in:
parent
8947e6f23c
commit
7a4ae6d057
|
@ -48,13 +48,15 @@ function html.header(title, close)
|
||||||
html.print("<meta name='robots' content='noindex'>")
|
html.print("<meta name='robots' content='noindex'>")
|
||||||
|
|
||||||
-- set up the style sheet
|
-- set up the style sheet
|
||||||
if not nixio.fs.stat("/tmp/web") then
|
local link = nixio.fs.readlink("/tmp/web/style.css")
|
||||||
nixio.fs.mkdir("/tmp/web")
|
if not link then
|
||||||
|
if not nixio.fs.stat("/tmp/web") then
|
||||||
|
nixio.fs.mkdir("/tmp/web")
|
||||||
|
end
|
||||||
|
link = "/www/aredn.css"
|
||||||
|
nixio.fs.symlink(link, "/tmp/web/style.css")
|
||||||
end
|
end
|
||||||
if not nixio.fs.readlink("/tmp/web/style.css") then
|
html.print("<link id='stylesheet_css' rel=StyleSheet href='/style.css?_=" .. link .. "' type='text/css'>")
|
||||||
nixio.fs.symlink("/www/aredn.css", "/tmp/web/style.css")
|
|
||||||
end
|
|
||||||
html.print("<link id='stylesheet_css' rel=StyleSheet href='/style.css?" .. os.time() .. "' type='text/css'>")
|
|
||||||
if close then
|
if close then
|
||||||
html.print("</head>")
|
html.print("</head>")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue