Solvedassemble yfm in partials doesn't work

Hi, I'm trying to use yfm in partials, and my case test is this:

page.hbs

...
{{> foo }}
...

foo.hbs

---
bar: baz

---
<p>{{foo.bar}}</p>

It renders an empty paragraph.

I'm using latest assemble release: 0.12.0

Any help?

9 Answers

✔️Accepted Answer

Since you're using the built-in Handlebars syntax for the partial: {{> foo }}, assemble does not merge the partial data onto the page context.

You can use assemble's built in partial helper to render the partial instead of using {{> foo}}:

{{partial "foo"}}

This will use the modified .data property when rendering foo.

If you don't want to use onMerge to modify the .data property, you can access the data by property name inside the partial like:

{{bar}}

Related Issues:

3
assemble yfm in partials doesn't work
Since you're using the built-in Handlebars syntax for the partial: {{> foo }} assemble does not merg...
716
jekyll Jekyll serve fails on Ruby 3.0
I think you want bundle add webrick. My Environment Software Version(s) Operating System Ubuntu 20.0...
88
vuepress Fix babel useBuiltIns core-js warning
Adding corejs: 3.0.0 in the .babelrc file turned off the warnings. I confirm that this is an issue r...
86
jekyll Cannot install Jekyll on MacOS Mojave
I cannot I used Jekyll on my MacBook Pro without any problem in the previous version of MacOS I upda...
57
jekyll unable to build a jekyll site … invalid date
I've solved it! It seems that you need to place the line exclude: [vendor] in _config.yml found this...
56
vuepress vuepress dev: throws res.getHeader() is not a function
The dependency chain is webpack-serve -> koa-webpack -> webpack-dev-middleware and it's caused by th...
45
jekyll Jekyll 4.0 Ideas
Please please support for i18n At least 2 languages Many plug-ins break or don't work with ghpages. ...
45
vuepress Blog Support roadmap (Resolved)
RSS/JSON Feed Draft post Ability to eliminates the .html extension Split date into subdirs: blog/201...
36
vuepress Hot reload not working
watchpack: 1.6.1 I noticed that the webpack hot update plugin watchpack is now 1.7.2 I compared the ...
36
vuepress Option to automatically list sub-directory in the sidebar
I like this idea too To be honest that's what I expected to happen I've got a docs/components folder...
22
eleventy Slug filter doesn't create url safe slugs.
yup @zachleat it does replace the slug so I just do remove some chars to make it little bit prettier...
22
vuepress Automatic Reload not working?
I got it working by downgrading dependency watchpack to 1.6.1 Added resolutions section to package.j...
20
eleventy Official Asset Pipeline
I've been using a stylesheet.11ty.js template file to compile CSS (via postcss in my case) I have an...
18
vuepress Unknown Custom Element - <v-#####>
@davision A quick fix for this issue in enhanceApp.js (for 1.0.0-alpha.42): This will (I think) fix ...
16
hugo Add a base set of resource filters/processors
re: @budparr I find tools like PurgeCSS or PurifyCSS—which remove unused CSS—pretty valuable ...
16
jekyll bundler: failed to load command: jekyll
Found this previous issue - ffi/ffi#368 The following fixed my problem: Got it working now! For thos...
15
eleventy How to create sitemap.xml?
Hi @rolandtoth I’ve created one for my (yet un-launched) site You can use the following template (th...
14
eleventy Eleventy reusable components shortcode
Thanks for thinking out loud here this is super helpful feedback to see what you’re trying to do May...
14
hugo The big assets handling / resource transformation funcs naming thread
This looks mighty cool but how about using a shorter namespace than resources? Like asset ...
13
hugo Override section url
Just thought I'd chime in and say that this is my single biggest issue using Hugo at the moment ...
13
jekyll jekyll install leads to immediate errors
Something that's not clearly stated in our docs: Running Jekyll commands with recent versions ...
13
wowchemy hugo themes TOC for blog posts
@CarlosVecina Change the file <root dir>/layouts/_default/single.html as follows: and add the follow...
12
hugo Add image processing support for WebP image resources
webp is currently not supported I guess that is probably not crystal clear in the documentation and ...
12
vuepress [Proposal] Plugin API
I actually prefer a simple object-based API as @ycmjason suggested Background Hey guys ...
11
vuepress Has anyone gotten mermaid working?
This is how I got it working on mermaid v7.1.2 and vuepress v0.14.0 And my README.md looks like: ⚠️ ...
10
jekyll Blank new blog generated with Jekyll-3.2.1 on Windows
Temporary Fix I have traced that missing drive letter to site.in_theme_dir(base ...
8
blogdown Problem with blogdown::new_site using starter-hugo-academic
Should be fixed now Please try the development version of blogdown: Thanks! I have posted this issue...
7
eleventy getting data from a .json file in node_modules
Thanks @robb0wen Your example made to try and swap styles.colors.properties to styles.colour.propert...
5
jekyll jekyll 3.8.3 | Error: uninitialized constant FFI::Platform::CPU
Hmm. this is indeed frustrating Looks like you'll have to resort to setting up local bundles for eve...
4
blogdown Hugo generated .Summary lacks manual cut-off in .Rmd
It looks like Blogdown knits to html although the partials are properly processed features like summ...
3
eleventy Is it possible to paginate collection data?
To answer your second question @paulrobertlloyd the permalink front matter key can use template synt...
3
jekyll Defaults: Path scope with subfolders
After a bit of testing it seems like it won't work if the value for path scope ends with a slash So ...
3
blogdown blogdown:::serve_site() keeps opening new browser tabs
@denizCvrl Thank you soooo much! By running blogdown::serve_site() multiple times ...
3
blogdown Getting started with Wowchemy
@apreshill If you are using the latest dev version of blogdown In the NEWS.md it says: When creating...
224
bazel Bazel 0.8.1: Build fails with "Xcode version must be specified to use an Apple CROSSTOOL" on OSX High Sierra
FYI: I encountered similar issue recently This is similar to #3063 but not quite the same so I'm add...
104
bazel Ubuntu 16.04 PPA key expired
I can confirm that reinstalling the key resolves the issue; sudo apt-get update runs successfully Th...
60
msbuild Cannot find reference assemblies for .NET 3.5 or lower using core msbuild
I got this working by adding the following to the .csproj file: Unfortunately dotnet/sdk supports ta...
37
cloud builders Mounting files in /workspace to docker run steps
Ah ok; I think I've got it This is somewhat related to #345 Following the steps in this comment work...
31
msbuild Add support for non-string assembly attributes
Sorry for being late to the party on this I know it's closed but I think it's worth considering reop...
30
msbuild "MSB3823: Non-string resources require the property GenerateResourceUsePreserializedResources to be set to true" if TargetFramework=net48
I did not quite understand We have a few projects that muti target .net core and the old fashioned ....
24
bazel Error while building tensorflow 0.11.0 - cache (directory not empty)
I attempted both solutions suggest by @sfincke and @yselivonchyk but without luck Finally ...
21
bazel Bazel installer stopped working after d3f8efc, if project has .bazelversion file
We would like to kindly request this issue to be reopened as it does appears to have broken both Baz...
21
bazel a way at start a repl
@damienmg I think this is pretty standard for any build tool whose language has a repl: Clojure: lei...
20
cloud builders How do I run kubectl after image push?
Hey! Good news the up-scoping feature is now live That means that you can add permission for Contain...
19
tensorflow windows wheel failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
I haven't seen this error before Try set CUDA_VISIBLE_DEVICES=0 Hi ...
18
bazel Compatibility with Xcode and Command Line Developer Tools on macOS
I've just hit this on a fresh Bazel clone (bc5a9b1): Environment: macOS 10.14.6 Xcode 10.3 I can con...
16
cloud builders Fetch repositories with submodules
You can use the source repositories of gcloud instead of github It is unclear how repositories with ...
16
cloud builders Document how to connect to a database
Cloud Build uses cloudbuild Docker network so we can minimize use of raw docker run without Docker C...
12
msbuild Setting BaseIntermediateOutputPath correctly in a SDK-based project is hard
To summarize if I want to override my intermediate and output folders NuGet restore drops the projec...
11
cloud builders Google Cloud Build for Github does not fetch submodules
Try this (I use BitBucket but change the url appropriately): It works for me Thanks ...