Sitemap

Newbies ask your questions here
Post Reply
Newbie
Posts: 1
Joined: Thu Sep 19, 2024 10:10 am

Sitemap

Post by Newbie »

How do I add all file links to sitemap.xml?
mdarshad321
Posts: 3
Joined: Fri Sep 20, 2024 11:05 am

Re: Sitemap

Post by mdarshad321 »

local sitemap = [=[<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->


<url>
<loc>https://vidtube.wapka.site/</loc>

<priority>1.00</priority>
</url>
<url>
<loc>https://vidtube.wapka.site/index.html</loc>

<priority>0.80</priority>
</url>]=]

print(string.format(sitemap, os.date("%Y-%b-%dT%X"), os.date("%Y-%b-%dT%X")))

local param_category = {
parent = 0,
limit = 20,
order = "DESC"
}

function date()
return os.date("%Y-%b-%dT%X")
end

local category_xml = [=[
<url>
<loc>https://vidtube.wapka.site/category/%id ... slug%</loc>

<priority>0.80</priority>
</url>]=]

local is_ok, categorylist = api.forum_info(param_category)

print(html.render_tag(category_xml, categorylist, true));


local post_xml = [=[
<url>
<loc>https://vidtube.wapka.site/post/%id%/%t ... slug%</loc>

<priority>0.80</priority>
</url>]=]

local is_ok, postlist = api.forum_info(param_post)

print(html.render_tag(post_xml, postlist, true));

print("</urlset>")
Newbeee
Posts: 10
Joined: Tue Sep 10, 2024 7:17 pm

Re: Sitemap

Post by Newbeee »

Thanks mashad but can you please use the code tag to compile the code so I can copy it
Post Reply