Skip to content
  • Jamie Tanna's avatar
    Fix: Render `.p-content`s correctly on minified output · 5b028ac3
    Jamie Tanna authored
    As part of investigation for #483, I found that when minifying the
    content for the site, Hugo was removing the lovely whitespace that was
    needed by the `pre-line`s inside `.p-content` blocks.
    
    As a workaround, we can wrap the `.p-content` in a `<pre>`, which will
    then retain the whitespace. We'll then need to ensure that it's styled
    as regular text, rather than the actual `<pre>` tags.
    
    *However*, this does not quite work because then microformats-ruby does
    not parse `.p-content` correctly. Instead, we need to have the
    `.p-content` container as a `<div>` and then place it inside a `<pre>`
    to format it correctly.
    
    Note that we also need to make sure that the `.p-content`s are now
    max-width'd, but only if it's on an actual post page, otherwise it would
    show up as max-width'd on the h-feed, too.
    
    Finally, we need to make sure that we use the `pre-line` so it correctly
    word wraps, otherwise we'll see horrible scroll bars and it'll be a
    pretty naff experie...
    5b028ac3