DocOps / liquidoc-gem

The canonical gem source for LiquiDoc, a ruby-based documentation parsing and rendering utility enabling advanced builds with Asciidoctor, Jekyll, Liquid, and semi-structured data files.
https://docs.docops.org/liquidoc-user-manual.html
MIT License
12 stars 5 forks source link

Enable distinct ingest of core Asciidoctor properties into Jekyll #91

Open briandominick opened 3 years ago

briandominick commented 3 years ago

The attributes-ingestion process for Jekyll render actions subordinates all attributes to the site.asciidoctor.attributes scope, when several attributes we might wish to add should stay in the site.asciidoctor scope. We need to make some of these a distinct ingestion point in the render build node data structure.

There is some illogic in the existing structure, which is:

    builds:
      - backend: jekyll
        properties: # These are site-scoped Jekyll variables
          files:
            - _configs/jekyll-global.yml
            - _configs/jekyll-portal-1.yml
          arguments: # these are for individual variable arguments for the site scope
            destination: build/site/user-basic
        attributes: # these are per-build AsciiDoc attributes, which now all get sandwiched to the site.asciidoctor.attributes scope
          asciidoctor: # <-- THIS is the change -- a tier for document-level (site.asciidoctor) vars.
            base_url:
            safe: unsafe
          portal_term: Guide # back to regular AsciiDoc attributes

So this is kind of the reverse of how the asciidoc-jekyll plugin handles it, but we will reverse this before we hand it over to asciidoc-jekyll. I'm doing it this way for backward compatibility, not because I think it's superior. For 1.0, I might want to change this whole block up.

This change must also accommodate site.asciidoctor objects defined in Jekyll config files -- it's probably a good idea to aggregate those into this new object as well.