pixelastic / norska

🏔️ Custom SSG using Pug, Webpack, PostCSS and Tailwind.
https://projects.pixelastic.com/norska/
MIT License
8 stars 0 forks source link

Better markdown support #41

Closed pixelastic closed 4 years ago

pixelastic commented 4 years ago

The default markdown pug method should be a bit more extended in regard to styling and images

For images, here is what is done on videogames.pixelastic.com:

      htmlText = markdown(tabText)
      updatedText = _.replace(htmlText, /img src="(.*?)"/g, `img src="${attributes.placeholder}$1" data-src="${attributes.full}$1" class="lazyload" loading="lazy"`)

It does replace in place the img tag to use cloudinary. It is pretty naive right now, but ideally I should find a way to plugin into the method converting [img] tags and plug it to the actual image methods we already have.

As for styling, maybe we will need some sample styling for the tags generated by the markdown. Maybe tailwind has some pointers on that already.

pixelastic commented 4 years ago

✔ Done