11ty / eleventy-base-blog

A starter repository for a blog web site using the Eleventy static site generator.
https://eleventy-base-blog.netlify.app/
MIT License
1.21k stars 619 forks source link

No whitespace left between tags in post.njk when styles are disabled #94

Closed siimpragi closed 2 years ago

siimpragi commented 3 years ago

I noticed a minor issue with the post.njk layout. Leading and trailing whitespace is stripped from the .post-tag anchor elements. As a result, when styles are disabled, these elements run against each other.

tag-spacing

This doesn't happen to tags in other layouts where some whitespace is preserved.

Could the solution be to allow some whitespace and wrap these <time> and <a>-s in post.njk in a flex container? Maybe this way, when styles are enabled, we avoid getting " " + element's margin.

P.S. Eleventy is awesome! 😄 This template is a great starting point.

zachleat commented 2 years ago

I fixed this one! Make sure you’re familiar with https://mozilla.github.io/nunjucks/templating.html#whitespace-control too

Personally I like to use {%- at the beginning and %} at the end of tags