jason-dour/hugo-preproc

Need to refactor configuration file syntax.

Closed this issue · 1 comments

# Clearly this example is rather dull; it simply echoes the name of the found file.

Propose the following:

git:
  - path: path/to/repo
    processors:
      - mode: [ head | each | all ]
        file: path/to/outputfile
        template: "template string"
  - path:
    processors:
      - mode: [ head | each | all ]
        file: path/to/outputfile
        template: "template string"
exec:
  - path: path/to/search
    pattern: *.md
    command: "echo {{ . }}"

Allows for:

  • Multiple repositories
    • Hugo publication pipelines containing multiple repos may be rare, but I already have one such case.
  • Multiple actions per repository
  • Moves Git mode from key to value, simplifies parsing and sanity checking.
  • Clarifies "processors" as "exec" handlers.
  • Each handler type starts as an array (git, exec).