summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-01-04 23:42:20 -0600
committersanine <sanine.not@pm.me>2022-01-04 23:42:20 -0600
commit6d43402c49e6f8c9a2548c628c98fb8431ce7971 (patch)
tree04efef353baed6ccbb9284d71909764ac1686ebf
parent78ee0de29b46f5faed6ca2ae5222c64fbd9a2c1e (diff)
fix bug with rss generation
-rw-r--r--src/lua-script/script.h40
-rw-r--r--src/lua-script/script.lua40
2 files changed, 42 insertions, 38 deletions
diff --git a/src/lua-script/script.h b/src/lua-script/script.h
index 8f0b7cc..3789738 100644
--- a/src/lua-script/script.h
+++ b/src/lua-script/script.h
@@ -486,27 +486,29 @@ const char *argent_script =
" output_file:write(output_data)\n"
" output_file:close()\n"
"\n"
- " for pattern in pairs(argent.config.rss_include) do\n"
- " if string.match(filename, pattern)\n"
- " or string.match(parent..filename, pattern)\n"
- " then -- add to the RSS feed!\n"
- " if not result.date then\n"
- " argent.log(\n"
- " 'warn',\n"
- " fmt(\n"
- " '%q did not specify a date; it will not be included in rss.xml!',\n"
- " parent..filename\n"
+ " if argent.rss_channel then\n"
+ " for pattern in pairs(argent.config.rss_include) do\n"
+ " if string.match(filename, pattern)\n"
+ " or string.match(parent..filename, pattern)\n"
+ " then -- add to the RSS feed!\n"
+ " if not result.date then\n"
+ " argent.log(\n"
+ " 'warn',\n"
+ " fmt(\n"
+ " '%q did not specify a date; it will not be included in rss.xml!',\n"
+ " parent..filename\n"
+ " )\n"
" )\n"
- " )\n"
- " return\n"
+ " return\n"
+ " end\n"
+ " \n"
+ " argent.rss_channel:addItem{\n"
+ " title=result.title,\n"
+ " link=argent.config.site_address..parent..output_name,\n"
+ " description = result.description,\n"
+ " pubDate = result.date,\n"
+ " }\n"
" end\n"
- " \n"
- " argent.rss_channel:addItem{\n"
- " title=result.title,\n"
- " link=argent.config.site_address..parent..output_name,\n"
- " description = result.description,\n"
- " pubDate = result.date,\n"
- " }\n"
" end\n"
" end\n"
" end\n"
diff --git a/src/lua-script/script.lua b/src/lua-script/script.lua
index 0a6323a..f372b2b 100644
--- a/src/lua-script/script.lua
+++ b/src/lua-script/script.lua
@@ -485,27 +485,29 @@ return function(config)
output_file:write(output_data)
output_file:close()
- for pattern in pairs(argent.config.rss_include) do
- if string.match(filename, pattern)
- or string.match(parent..filename, pattern)
- then -- add to the RSS feed!
- if not result.date then
- argent.log(
- 'warn',
- fmt(
- '%q did not specify a date; it will not be included in rss.xml!',
- parent..filename
+ if argent.rss_channel then
+ for pattern in pairs(argent.config.rss_include) do
+ if string.match(filename, pattern)
+ or string.match(parent..filename, pattern)
+ then -- add to the RSS feed!
+ if not result.date then
+ argent.log(
+ 'warn',
+ fmt(
+ '%q did not specify a date; it will not be included in rss.xml!',
+ parent..filename
+ )
)
- )
- return
+ return
+ end
+
+ argent.rss_channel:addItem{
+ title=result.title,
+ link=argent.config.site_address..parent..output_name,
+ description = result.description,
+ pubDate = result.date,
+ }
end
-
- argent.rss_channel:addItem{
- title=result.title,
- link=argent.config.site_address..parent..output_name,
- description = result.description,
- pubDate = result.date,
- }
end
end
end