satelito

Static [web] site (or page) generator (ssg) made with Lua script.
git clone git://soucy.cc/satelito.git
Log | Files | Refs | README

commit 1fa9aedea34dd0888fc773b75331b198bc8d7deb
parent be3a35985c1f1cc5cafbab58cc4c7800db46b90c
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Thu,  7 Oct 2021 08:35:14 -0400

Move rellink at the bottom

Diffstat:
Msatelito/file.lua | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/satelito/file.lua b/satelito/file.lua @@ -62,14 +62,6 @@ function file.get_relpath(filepath, dirname) return filepath:sub((dirname):len() + 1) end -function file.get_rellink(filepath, dirname) - if file.is_index(filepath) then - return '/' .. file.get_dirname(file.get_relpath(filepath, dirname)) - else - return '/' .. file.get_relpath(filepath, dirname):match('(.+)%..*') .. '.html' - end -end - function file.get_permalink(filepath, dirname, url) return url .. '/' .. file.get_relpath(filepath, dirname):match('(.+)%..*') .. '.html' end @@ -112,6 +104,14 @@ function file.is_index(filepath) return (file.get_basename(filepath) == 'index.md') or (file.get_basename(filepath) == 'index.html') end +function file.get_rellink(filepath, dirname) + if file.is_index(filepath) then + return '/' .. file.get_dirname(file.get_relpath(filepath, dirname)) + else + return '/' .. file.get_relpath(filepath, dirname):match('(.+)%..*') .. '.html' + end +end + -- function file.get_collection(filepath, dirname) local collection = {}