Should the local site view convert the included file (a markdown file) to HTML and include it where the link has been inserted, or is this only seen in on the converted site?
At the moment the link file seems to be getting ignored in local view, and our publishing pipeline involves merging to a GitHub repo and then using Buddy to push to the live site.
OK; the server should (for this purpose) behave exactly like the “full Hugo build”. I have ittle experience with MMark, so you may wait for other to chime in.
A bit of an update. The file to be included (test-include.md) is getting transformed into HTML, but is not being appended to the file it is being linked from (test.mmark). I have saved test-include.md in the same location as test.mmark. I can see the HTML version of test.mmark if I go directly to localhost:1313/mypath/test-include/.
If you do not want Hugo to generate a page for the included file, then put it outside the content folder. Create an include folder. For Windows it should look something like this.
Hi @Mikhail. I want Hugo to include the content of test-include.md to be generated and appear where I put the link in the mmark file. At the moment that doesn’t happen. No matter where I place test-include.md I get the following when building drafts:
2017/10/04 09:37:31 mmark: failed: /docs/include/test-include.md': open /docs/include/test-include.md: no such file or directory
Other files (graphics) are picked up ok from this location and I’ve checked the names of my files. Even with the file in the same directory as the mmark file refuses to include it. Strange!
Hi @Mikhail It worked when I added this path - /Users/marksouthee/tyk-docs/tyk-docs/static/include/test-include.md
This is totally different to how I link to images etc, hence my confusion.
Hi @Mikhail. that’s possible. This is from the Mmark syntax
“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.”
I’m assuming that the working directory of the Mmark process is the directory the .mmark file is located within my docs structure?
Just want to warn that the files placed in the static folder are copied to the server unchanged. It’s a bad idea to place includes in the static folder.
Thanks for that. The following relative path worked for me. ./static/include/test-include.md The include file ( a .md file) is getting transformed ok, so the location within static seems ok?