dwyl / ampl

:iphone: :zap: Ampl transforms Markdown into AMP-compliant html so it loads super-fast!
GNU General Public License v2.0
58 stars 3 forks source link

Grunt #34

Open Stefany93 opened 6 years ago

Stefany93 commented 6 years ago

Is there a way to implement this to Grunt? Thanks so much.

nelsonic commented 6 years ago

@Stefany93 thanks for your question. could you please clarify: are you asking if you can use the ampl node module with the Grunt.js task runner / build tool? https://gruntjs.com ?

Stefany93 commented 6 years ago

^^ Hi nelsonic, thank you for replaying, and yes that's what I need - I have a stream of markdown I am converting into HTML but I need it to convert to AMP!

nelsonic commented 6 years ago

@Stefany93 if you can share some of your Grunt code (even temporarily) we can help you implement. thanks.

Stefany93 commented 6 years ago

^^ Sure thing, here it is https://gist.github.com/Stefany93/ecd334fae0ddd866bf9a77898f0fd833

nelsonic commented 6 years ago

@Stefany93 thanks for sharing link to Gist. could you please add a comment to it, something to the effect of:

// transform Markdown to AMP-compliant HTML here!

So that it's easier for both to understand where the transformation needs to occur? at present there is no mention of "amp": no-mention-of-amp-in-grunt-file

Stefany93 commented 6 years ago

Hi, I am currently converting the markdown to html in a handlebars template, if that helps:

{{#markdown}}{{content.body}}{{/markdown}}

nelsonic commented 6 years ago

@Stefany93 The workflow for using ampl is quite basic:

So instead of using helper-markdown you would use ampl. I would recommend reading: https://gruntjs.com/creating-plugins

Stefany93 commented 6 years ago

^^ Thank you nelsonic, I will try that.

nelsonic commented 6 years ago

@Stefany93 keep us posted with how you get on. (if you need any "help", just give us as much info as you can...)