add gemini support

This commit is contained in:
2026-02-16 21:00:04 -05:00
parent 94818e25fe
commit 472e27b1fa
16 changed files with 465 additions and 129 deletions

View File

@@ -121,9 +121,9 @@ function M.fes(proto, header, footer)
if proto == "http" and site_config.favicon then
site_config.favicon =
'<link rel="icon" type="image/x-icon" href="'
.. site_config.favicon
.. '">'
'<link rel="icon" type="image/x-icon" href="'
.. site_config.favicon
.. '">'
end
local default_header
@@ -167,12 +167,20 @@ end
function M:build()
if self.proto == "http" then
local header = self.default_header:gsub("{{TITLE}}", self.title or "Document")
local favicon_html = self.favicon or '<link rel="icon" href="data:image/svg+xml,<svg xmlns=%%22http://www.w3.org/2000/svg%%22 viewBox=%%220 0 100 100%%22><text y=%%22.9em%%22 font-size=%%2290%%22>🔥</text></svg>">'
local header = self.header:gsub("{{TITLE}}", self.title or "Document")
local favicon_html = self.favicon
or
'<link rel="icon" href="data:image/svg+xml,<svg xmlns=%%22http://www.w3.org/2000/svg%%22 viewBox=%%220 0 100 100%%22><text y=%%22.9em%%22 font-size=%%2290%%22>🔥</text></svg>">'
header = header:gsub("{{FAVICON}}", favicon_html)
local footer = self.default_footer:gsub("{{COPYRIGHT}}", self.copyright or symbol.legal.copyright .. "The Copyright Holder")
return header .. table.concat(self.parts, "\n") .. default_footer
local footer = self.footer:gsub(
"{{COPYRIGHT}}",
self.copyright or symbol.legal.copyright .. "The Copyright Holder"
)
return header .. table.concat(self.parts, "\n") .. footer
end
return table.concat(self.parts, "\n")
end