Thank you. “Consider Mmark” seems like good advice, and I have investigated. The ability to include arbitrary files is exactly what I want. There are hints that others have done this successfully, but no matter what I try the file I am attempting to include cannot be found.
Mmark docs tell me
Including other files can done be with {{filename}}, if the path of filename is not
absolute, the filename is taken relative to working directory of the Mmark process.
Given “content/quick-start/index.mmark”, what variation of {{ ugh.mmark }}, and it’s location on disk will cause it to be actually included – ideally using a relative path?
I believe I have tried every combination of everything, including an absolute path of /tmp against a chmod a+rw’ed file and I get nothing but no such file or directory
What incredibly simple thing am I missing? Thank you!
2017/01/09 10:48:58 mmark: failed: ` ugh.mmark ': open ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` content/ugh.mmark ': open content/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /content/ugh.mmark ': open /content/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` partials/ugh.mmark ': open partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /partials/ugh.mmark ': open /partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` layouts/partials/ugh.mmark ': open layouts/partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /layouts/partials/ugh.mmark ': open /layouts/partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /home/kerry/hugo/sample/layouts/partials/ugh.mmark ': open /home/kerry/hugo/sample/layouts/partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /tmp/ugh.mmark ': open /tmp/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` ugh.mmark ': open ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` content/ugh.mmark ': open content/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /content/ugh.mmark ': open /content/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` partials/ugh.mmark ': open partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /partials/ugh.mmark ': open /partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` layouts/partials/ugh.mmark ': open layouts/partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /layouts/partials/ugh.mmark ': open /layouts/partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /home/kerry/hugo/sample/layouts/partials/ugh.mmark ': open /home/kerry/hugo/sample/layouts/partials/ugh.mmark : no such file or directory
2017/01/09 10:48:58 mmark: failed: ` /tmp/ugh.mmark ': open /tmp/ugh.mmark : no such file or directory
If you want to play along at home, here’s a small script that illustrates the problem:
rm -rf include-fail
hugo new site include-fail
cd include-fail
hugo new _index.mmark
echo 'Before Include >>> ' >> content/_index.mmark
echo '{{ /tmp/include-this.mmark }}' >> content/_index.mmark
echo '<<< After Include' >> content/_index.mmark
# Here is the file I want to include
echo ' -- this should be included --' > /tmp/include-this.mmark
git clone --depth=1 https://github.com/key-amb/hugo-theme-bootie-docs.git themes/bootie-docs
hugo server --theme=bootie-docs --buildDrafts
When it runs we see:
Checking connectivity... done.
Started building sites ...
2017/01/09 11:38:04 mmark: failed: ` /tmp/include-this.mmark ': open /tmp/include-this.mmark : no such file or directory
Built site for language en:
This is an old thread, but in case someone stumbles up on it: mmark will be deprecated, so it would be better not to depend on it. There’s a nice thread here that shows how to build an include shortcode: