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 host = self.req.parsed_url.scheme .. '://' .. self.req.parsed_url.host
|
||||
local data_path = host .. '/data/' .. self.titles.url .. '/'
|
||||
local latest_json = {}
|
||||
latest_json["files"] = {}
|
||||
|
||||
self.datapath = host .. '/data/' .. self.titles.url .. '/'
|
||||
self.latestpath = latest_path
|
||||
self.latestname = latest_name
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
<% for i, file in ipairs(latestpath) do %>
|
||||
<item>
|
||||
<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>
|
||||
<guid><%= 'https://' .. titles.url .. '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %></guid>
|
||||
<guid><%= datapath .. '/' .. file:gsub("#", "%%23") %></guid>
|
||||
</item>
|
||||
<% end %>
|
||||
</channel>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user