The name of the data file must match either the post or the directory it resides within.Additional Customizations Jump to heading # Using the above in posts/posts.json will configure a layout for all of the templates inside of posts/*. json files) available to all templates.Įxamples Jump to heading # Apply a default layout to multiple templates Jump to heading #įilename posts/posts.json Parent Directory Data File (data applies to all templates in posts/**/*, including subdirectories).Directory Data File (data applies to all templates in posts/subdir/*).Template Data File (data is only applied to posts/subdir/my-first-blog-post.md).merged with any Layout Front Matter Data.Eleventy will look for data in the following places (starting with highest priority, local data keys override global data): For that use, we also search for JSON and JavaScript Data Files in specific places in your directory structure.įor example, consider a template located at posts/subdir/my-first-blog-post.md. While you can provide global data files to supply data to all of your templates, you may want some of your data to be available locally only to one specific template or to a directory of templates. Apply a default layout to multiple templates.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |