refactor url+path generation
This commit is contained in:
parent
52cca8eef2
commit
e9d4163a5d
@ -10,10 +10,7 @@ local function RSShandler(self)
|
|||||||
local latest_path, latest_name = hotmixes.utils.these_latest( path )
|
local latest_path, latest_name = hotmixes.utils.these_latest( path )
|
||||||
|
|
||||||
local host = self.req.parsed_url.scheme .. '://' .. self.req.parsed_url.host
|
local host = self.req.parsed_url.scheme .. '://' .. self.req.parsed_url.host
|
||||||
local data_path = host .. '/data/' .. self.titles.url .. '/'
|
self.datapath = host .. '/data/' .. self.titles.url .. '/'
|
||||||
local latest_json = {}
|
|
||||||
latest_json["files"] = {}
|
|
||||||
|
|
||||||
self.latestpath = latest_path
|
self.latestpath = latest_path
|
||||||
self.latestname = latest_name
|
self.latestname = latest_name
|
||||||
|
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
<% for i, file in ipairs(latestpath) do %>
|
<% for i, file in ipairs(latestpath) do %>
|
||||||
<item>
|
<item>
|
||||||
<title><%= latestname[i] %></title>
|
<title><%= latestname[i] %></title>
|
||||||
<link><%= 'https://' .. titles.url .. '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %></link>
|
<link><%= datapath .. '/' .. file:gsub("#", "%%23") %></link>
|
||||||
<description><![CDATA[<%= latestname[i] %>]]></description>
|
<description><![CDATA[<%= latestname[i] %>]]></description>
|
||||||
<guid><%= 'https://' .. titles.url .. '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %></guid>
|
<guid><%= datapath .. '/' .. file:gsub("#", "%%23") %></guid>
|
||||||
</item>
|
</item>
|
||||||
<% end %>
|
<% end %>
|
||||||
</channel>
|
</channel>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user