How best to get YAML variables in a content include from the including file?

22 views
Skip to first unread message

Dave Everitt

unread,
Dec 25, 2019, 3:19:04 PM12/25/19
to nanoc
I have an .md include with no YAML data that's used in several site pages.

content/
  _inc
/
    include
.md # wants YAML variables from including page 'mypage.md'
  subfolder/
    mypage
.md # includes 'include.md' and sets YAML variables




I want YAML data from the including file to be available in the include itself for processing.

I can't find a method in the documentation for this?

Denis Defreyne

unread,
Dec 26, 2019, 5:17:00 AM12/26/19
to na...@googlegroups.com
Hey Dave,

Nanoc doesn’t directly support what you’re trying to do.

One approach that comes to mind would be copy the attributes during preprocessing. This way, you can copy attributes from one item to another. Would that work?

Denis

--
You received this message because you are subscribed to the Google Groups "nanoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nanoc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nanoc/6b4953d1-c691-4171-9ce8-c67ea54f5428%40googlegroups.com.


--

Dave Everitt

unread,
Dec 30, 2019, 11:08:59 AM12/30/19
to nanoc
Thanks Denis - I'll take a look, see what I can do and post the solution back here (if I find one!)
Reply all
Reply to author
Forward
0 new messages