mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2026-02-02 15:45:12 +01:00
fix(doc-util): ensure indexes get path prefixes (#36)
This commit is contained in:
parent
0486f08fc1
commit
e7f3020f57
1 changed files with 8 additions and 2 deletions
|
|
@ -33,6 +33,12 @@
|
||||||
|||,
|
|||,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
joinPathPrefixes(prefixes, sep='/')::
|
||||||
|
std.join(sep, prefixes)
|
||||||
|
+ (if std.length(prefixes) > 0
|
||||||
|
then sep
|
||||||
|
else ''),
|
||||||
|
|
||||||
joinPrefixes(prefixes, sep='.')::
|
joinPrefixes(prefixes, sep='.')::
|
||||||
std.join(sep, prefixes)
|
std.join(sep, prefixes)
|
||||||
+ (if std.length(prefixes) > 0
|
+ (if std.length(prefixes) > 0
|
||||||
|
|
@ -345,14 +351,14 @@
|
||||||
if std.length(prefixes) > 0
|
if std.length(prefixes) > 0
|
||||||
then package.name + '.md'
|
then package.name + '.md'
|
||||||
else 'README.md';
|
else 'README.md';
|
||||||
local path = root.joinPrefixes(prefixes, '/');
|
local path = root.joinPathPrefixes(prefixes);
|
||||||
{
|
{
|
||||||
[path + key]: root.renderPackage(package),
|
[path + key]: root.renderPackage(package),
|
||||||
}
|
}
|
||||||
+ (
|
+ (
|
||||||
if std.length(package.subPackages) > 0
|
if std.length(package.subPackages) > 0
|
||||||
then {
|
then {
|
||||||
[package.name + '/index.md']: root.renderIndexPage(package, prefixes),
|
[path + package.name + '/index.md']: root.renderIndexPage(package, prefixes),
|
||||||
}
|
}
|
||||||
else {}
|
else {}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue