1

I have a simple document like this:

---
title: My First Post
subtitle: My First Post
author: dan
tags: [fruit veggies]
---

My body content

My _config.yml has a typical:

defaults:
  # _docs
  - scope:
      path:         ""
      type:         docs
    values:
      layout:       doc

which outputs the correct HTML files etc.

I want to build a secondary HTML file (for a modal) using that same original document markdown file.

I made a new modal.html layout with my custom html etc and then added:

defaults:
  # _docs
  - scope:
      path:         ""
      type:         docs
    values:
      layout:       doc
  # _modal - partials for help modals
  - scope:
      path:         "modals"
      type:         docs
    values:
      layout:       modal

This works butShould this not work? In my case it doesn't. If I reverse the order I get the modal files but they are written in the docs folder. Perhaps a precedence problem but I am at a loss to figure this out.

Dan Tappin
  • 2,692
  • 3
  • 37
  • 77
  • I did it using two different config files and then executing jekyll twice It is not possible, at least until I know. I did it using two different config files and executing jekyll build twice jekyll build && jekyll --config _config.modal.yml build – corretge Sep 08 '20 at 18:13
  • I am going to try that - if that works I would accept that as an answer for the bounty (unless there is a more direct answer). – Dan Tappin Sep 08 '20 at 23:55
  • Hmm... this isn't working. I want the `docs` collection to be rendered with the `modal` layout but in the `modal` directory vs. the `docs` folder. I made a separate config file but they still overwrite each other - always in the `docs` folder. – Dan Tappin Sep 09 '20 at 00:41

0 Answers0