From 7e99cdef291f037aa4935ef5d96a3430896efa2a Mon Sep 17 00:00:00 2001 From: peelz Date: Wed, 3 Aug 2022 21:34:42 -0400 Subject: [PATCH] Implement rudimentary cache busting for lua docs --- luacs-docs/lua/templates/ldoc.ltp | 17 +++++++++++++---- luacs-docs/scripts/http_server.py | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/luacs-docs/lua/templates/ldoc.ltp b/luacs-docs/lua/templates/ldoc.ltp index 2173af01e..d1b41430f 100644 --- a/luacs-docs/lua/templates/ldoc.ltp +++ b/luacs-docs/lua/templates/ldoc.ltp @@ -1,5 +1,7 @@ {% +math.randomseed(os.time()) + local baseUrl = ldoc.css:gsub("ldoc.css", "") local repo = "https://github.com/evilfactory/LuaCsForBarotrauma" local pageTitle = mod and (ldoc.display_name(mod) .. " - " .. ldoc.title) or ldoc.title @@ -13,6 +15,13 @@ function ldoc.url(path) return baseUrl .. path end +function ldoc.asset_url(path) + local uuid = string.gsub("xxxxxxx", "x", function(c) + return string.format("%x", math.random(0, 0xf)) + end) + return baseUrl .. path .. "?v=" .. uuid +end + function ldoc.realm_icon(realm) return "" end @@ -97,8 +106,8 @@ end {% end %} - - + + @@ -120,8 +129,8 @@ end - - + +