Unbroke partials.
This commit is contained in:
parent
0ad5ee059f
commit
7f2c8dfd26
|
@ -411,14 +411,8 @@ public class MustachePartialTag : MustacheTag {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let withoutLast = page.deletingLastFilePathComponent
|
let withoutLast = page.deletingLastFilePathComponent
|
||||||
let pageDir: String
|
let slash = withoutLast[withoutLast.startIndex] == "/" ? "/" : ""
|
||||||
if withoutLast.isEmpty { // foo.mustache
|
let pageDir = slash + withoutLast.characters.split(separator: "/").map(String.init).joined(separator: "/")
|
||||||
pageDir = "."
|
|
||||||
} else if withoutLast.hasSuffix("/") {
|
|
||||||
pageDir = withoutLast
|
|
||||||
} else {
|
|
||||||
pageDir = "."
|
|
||||||
}
|
|
||||||
let fullPath = pageDir + "/" + self.tag + "." + mustacheExtension
|
let fullPath = pageDir + "/" + self.tag + "." + mustacheExtension
|
||||||
do {
|
do {
|
||||||
let template = try getTemplateFromCache(fullPath)
|
let template = try getTemplateFromCache(fullPath)
|
||||||
|
|
Loading…
Reference in New Issue