forked from nm3clol/nm3clol-express-app
Fixed breadcrumbs
This commit is contained in:
parent
6d53fff6f3
commit
5341507431
|
@ -23,7 +23,7 @@
|
|||
<%= h.trimSlashes({path: value.name}) %>
|
||||
<% } else { %>
|
||||
<a href="/<%= value.url %>">
|
||||
<%= h.getDirectoryTitle({directory: value.name}) %>
|
||||
<%= h.getDirectoryName({directory: value.name}) %>
|
||||
</a>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
|
|
|
@ -24,6 +24,11 @@ const getSiteName = () => {
|
|||
const trimSlashes = ({path}) => {
|
||||
return path.replace(/^[\/\\]|[\/\\]$/g, '');
|
||||
};
|
||||
const getDirectoryName = ({directory}) => {
|
||||
directory = trimSlashes({path: directory});
|
||||
let title = trimSlashes({path: directory.replace("public", "")}).replaceAll(path.sep, path.posix.sep);
|
||||
return (directory=="public") ? getSiteName() : title;
|
||||
};
|
||||
const getDirectoryTitle = ({directory}) => {
|
||||
directory = trimSlashes({path: directory});
|
||||
let title = trimSlashes({path: directory.replace("public", "")}).replaceAll(path.sep, path.posix.sep);
|
||||
|
@ -60,6 +65,7 @@ const printReadme = ({directory}) => {
|
|||
module.exports = {
|
||||
trimSlashes,
|
||||
getSiteName,
|
||||
getDirectoryName,
|
||||
getDirectoryTitle,
|
||||
getWelcomeBanner,
|
||||
shouldShowDirectorySeparator,
|
||||
|
|
Loading…
Reference in New Issue
Block a user