perun icon indicating copy to clipboard operation
perun copied to clipboard

[BUG]: Blog example does not produce atom.xml

Open jaidetree opened this issue 6 years ago • 2 comments

REPRODUCTION

  1. Clone the perun repo
  2. cd into examples/blog
  3. Run boot build

EXPECTED

  • atom.xml should be produced using the :original keyword as a filterer

ACTUAL

  • atom-feed states there were no files to output
  • No atom.xml file is emitted

More Context

  • The blog example sets the filterer to :original, without that option it works as expected.

  • The markdown task should be setting :original true as a meta option along with :include-rss and include-atom.

  • May have to do with this line https://github.com/hashobject/perun/blob/master/src/io/perun.clj#L257 which could be removing the :original attribute from the map.

    final-meta (into (map #(dissoc % :rendered :original) output-meta) passthru-meta)
    

jaidetree avatar Feb 11 '19 23:02 jaidetree

I noticed this too. Reading the code, I can't tell what the purpose of :original is--no code uses it, it's not documented in SPEC.md, and it's not clear why the blog example uses it instead of the default filterer.

wiseman avatar May 24 '19 01:05 wiseman

It looks like commit 189403355d91dc8954c0f3fcff04b3ec8d63e0e4 introduced :original:

--- a/src/io/perun/markdown.clj
+++ b/src/io/perun/markdown.clj
@@ -30,7 +30,9 @@
 
 (defn parse-file-defn [lines]
-  (let [metadata {}]
+  ; we use `original` file flag to distinguish between generated files
+  ; (e.x. created those by plugins)
+  (let [metadata {:original true}]

#114 is where :include-atom and :include-rss were added. It might just be that the blog example was not updated at the same time to reflect the new intent.

wiseman avatar May 24 '19 02:05 wiseman