diff options
| author | dvs1 | 2025-01-15 08:35:33 +1000 |
|---|---|---|
| committer | dvs1 | 2025-01-15 08:35:33 +1000 |
| commit | d01670bee661ec6f520f2676466a7094712d197d (patch) | |
| tree | 5279c7fc38c5f4e3430a486bbf97f117dacf7ca4 | |
| parent | Leave more foot prints. (diff) | |
| download | notYetAnotherWiki-d01670bee661ec6f520f2676466a7094712d197d.zip notYetAnotherWiki-d01670bee661ec6f520f2676466a7094712d197d.tar.gz notYetAnotherWiki-d01670bee661ec6f520f2676466a7094712d197d.tar.bz2 notYetAnotherWiki-d01670bee661ec6f520f2676466a7094712d197d.tar.xz | |
Allow separate title and pagetitle. Use title for menu text.
| -rw-r--r-- | default.template | 2 | ||||
| -rwxr-xr-x | notYetAnotherWiki.lua | 15 |
2 files changed, 11 insertions, 6 deletions
diff --git a/default.template b/default.template index a0ac53f..af5d701 100644 --- a/default.template +++ b/default.template | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | <meta charset="utf-8"> | 4 | <meta charset="utf-8"> |
| 5 | <meta name="generator" contents="lcmark"> | 5 | <meta name="generator" contents="lcmark"> |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> |
| 7 | <title>$pagetitle$</title> | 7 | <title>$title$</title> |
| 8 | <link rel="icon" type="image/png" href="$favicon$" /> | 8 | <link rel="icon" type="image/png" href="$favicon$" /> |
| 9 | <style> | 9 | <style> |
| 10 | html {font-family: sans-serif;} | 10 | html {font-family: sans-serif;} |
diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index f85a521..5b38aa7 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua | |||
| @@ -239,12 +239,17 @@ for name, file in pairs(Files) do | |||
| 239 | if name == f then | 239 | if name == f then |
| 240 | metadata.menu = metadata.menu .. '<p>' .. f .. '</p>' | 240 | metadata.menu = metadata.menu .. '<p>' .. f .. '</p>' |
| 241 | else | 241 | else |
| 242 | local url = nil | 242 | local title, url = nil, nil |
| 243 | if '' == path then url = Files[f].metadata.URL else url = Files[path .. '/' .. f].metadata.URL end | 243 | if '' == path then |
| 244 | if nil ~= url then | 244 | title = Files[f].metadata.title |
| 245 | metadata.menu = metadata.menu .. '<p><a href="' .. url .. '">' .. f .. ' ☝</a></p>' | 245 | url = Files[f].metadata.URL |
| 246 | else | 246 | else |
| 247 | metadata.menu = metadata.menu .. '<p><a href="' .. f .. '.HTML">' .. f .. '</a></p>' | 247 | title = Files[path .. '/' .. f].metadata.title |
| 248 | url = Files[path .. '/' .. f].metadata.URL | ||
| 249 | end | ||
| 250 | if nil == title then title = f end | ||
| 251 | if nil ~= url then metadata.menu = metadata.menu .. '<p><a href="' .. url .. '">' .. title .. ' ☝</a></p>' | ||
| 252 | else metadata.menu = metadata.menu .. '<p><a href="' .. f .. '.HTML">' .. title .. '</a></p>' | ||
| 248 | end | 253 | end |
| 249 | end | 254 | end |
| 250 | end | 255 | end |
