Pagename() function no longer returns fill extension. Fixes #1274.

This commit is contained in:
Bart Kamphorst
2018-02-05 12:24:29 +01:00
parent 01c7b5f380
commit f75037db42
@@ -1,8 +1,14 @@
// Helpers
function pageName(){
// "my/dir/file" => "file"
return typeof(pageFullPath) == 'undefined' ? undefined : pageFullPath.split('/').pop();
// "my/dir/file.md" => "file"
if (typeof(pageFullPath) == 'undefined') {
return undefined;
} else {
name = pageFullPath.split('/').pop();
return name.substring(0, name.lastIndexOf('.'));
}
}
function pagePath(){
// "my/dir/file" => "my/dir"
return typeof(pageFullPath) == 'undefined' ? undefined : pageFullPath.split('/').slice(0,-1).join('/');