How to make url slug using LUA?
Posted: Sat Feb 24, 2024 2:26 am
I know there is url.slug() function and i know how to use it too.
I will give you the example of my problem cause i don't know how to explain it
i can't put any lua function inside [=[something]=] cause it's escaping every lua function inside it. I want to make my url post become more seo friendly by adding something like
do you guys have any idea how to achieve this?
Edit : I have follow this official post http://blog.wapka.website/viewtopic.php?t= ... 334f5cf23c, it's using format like this
but it's still not working
I will give you the example of my problem cause i don't know how to explain it
Code: Select all
local param_post = {
limit = 10,
order = "id_desc"
}
local is_ok, postlist = api.post_info(param_post)
local post_index_html = [=[
blah blah
<a href="/post/%id%/%title%>%title%</a>
blah blah
]=]
print(html.render_tag(post_index_html, postlist, true));
Code: Select all
<a href="/post/%id%/url.slug(%title%)">
Edit : I have follow this official post http://blog.wapka.website/viewtopic.php?t= ... 334f5cf23c, it's using format like this
Code: Select all
%title|slug%