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