aboutsummaryrefslogtreecommitdiff
path: root/element_include.go
diff options
context:
space:
mode:
Diffstat (limited to 'element_include.go')
-rw-r--r--element_include.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/element_include.go b/element_include.go
index 4b36314..187348b 100644
--- a/element_include.go
+++ b/element_include.go
@@ -43,9 +43,13 @@ func parseInclude(doc *Document, line []byte) (el *elementInclude) {
el.attrs.parseElementAttribute(line[start : start+end+1])
- path = applySubstitutions(doc, path)
- el.fpath = filepath.Join(filepath.Dir(doc.file), string(path))
-
+ var newPath = applySubstitutions(doc, path)
+ if bytes.Contains(path, []byte(docAttrDocdir)) {
+ el.fpath = string(newPath)
+ } else {
+ el.fpath = filepath.Join(doc.docdir, string(newPath))
+ }
+ log.Printf(`parseInclude: fpath: %s`, el.fpath)
el.content, err = os.ReadFile(el.fpath)
if err != nil {
log.Printf(`parseInclude %q: %s`, el.fpath, err)