still icon indicating copy to clipboard operation
still copied to clipboard

HTML Preprocessor

Open elinol opened this issue 4 years ago • 11 comments

I'm trying to add a preprocessor in for my .html-files since they contain front matter, but they are ignored on compilation.

preprocessors: %{
    ".html" => [AddContent, EEx, Frontmatter, OutputPath, AddLayout, Save]
  }

Are .html files maybe excluded per se?

elinol avatar Apr 28 '21 07:04 elinol

Hi! It seems to work for me. I've pushed an example here for you. The only thing I did differently is I changed the order of EEx with FrontMatter because otherwise, the variables defined in frontmatter will not be available when it runs through EEx. If you're not using variables from frontmatter, then what you did should work. Do you see any errors on the console?

gabrielpoca avatar Apr 30 '21 13:04 gabrielpoca

Hi! After putting the html-preprocessor in default preprocessors instead of in config.exs is works out alright. Thanks for helping me out!

elinol avatar May 05 '21 10:05 elinol

Wait @gabrielpoca, you mean that we should be changing the preprocessors by editing the still dependency? This case is using Still as a dep in another application.

I imagine the config :still, preprocessors key should work and that's what we aren't having luck with.

lawik avatar May 06 '21 09:05 lawik

@lawik no no, you should change it in the config like we show here. @elinol I'm sorry, I took the easiest route in my example, here's a similar example in my website that uses Still

gabrielpoca avatar May 06 '21 09:05 gabrielpoca

Alright, we are having some weird problems. Will keep digging.

Thanks :)

lawik avatar May 06 '21 10:05 lawik

@lawik 👍 let me know if I can help

gabrielpoca avatar May 06 '21 13:05 gabrielpoca

Elin pinned it down. We hadn't aliased the modules in the config. This triggers not error from what I saw :D It should probably check if there is a run function defined and log an error for a bad preprocessor or something, because this is a fairly hard-to-debug failure.

lawik avatar May 06 '21 14:05 lawik

this is a fairly hard-to-debug failure.

Second this, saw a few other users with the same issue. The fact that we have aliased is confusing people. I'll update the docs and try to add a specific error

frm avatar May 06 '21 15:05 frm

image Yeah, it already happened to me as well. I tried it out, and I get this error in the console, but we should push this to the error overlay.

gabrielpoca avatar May 06 '21 18:05 gabrielpoca

For us it might have drowned, we had some .DS_Store errors so I might have conflated them. Sounds like good fixes :)

On Thu, May 6, 2021 at 8:41 PM Gabriel Poça @.***> wrote:

[image: image] https://user-images.githubusercontent.com/934580/117349023-d10a9a00-aea2-11eb-9cf2-3c965f8dc366.png Yeah, it already happened to me as well. I tried it out, and I get this error in the console, but we should push this to the error overlay.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/still-ex/still/issues/153#issuecomment-833767379, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPBIJM2RWRCZ5EXTEPDUGLTMLPD3ANCNFSM43WPFPRQ .

lawik avatar May 06 '21 20:05 lawik

Found it 😅 there's a bug in the error reporting system. Those are the worst 😭 this is what I see now that's fixed

localhost_3000_

It could be a better error, but it's an improvement. I'll open a fix

gabrielpoca avatar May 06 '21 20:05 gabrielpoca