Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Margin along sides of post disappear after adding section heading. #591

Closed
austinwpearce opened this issue Feb 20, 2021 · 3 comments · Fixed by CaiJimmy/hugo-theme-stack#162
Labels
bug an unexpected problem or unintended behavior

Comments

@austinwpearce
Copy link

austinwpearce commented Feb 20, 2021

Describe the bug
Margin along sides of post disappear after adding section heading. I don't think it is the theme, but maybe it is just a problem with the interactions between blogdown and newer version of hugo or markdown flavors.

To Reproduce
Steps to reproduce the behavior:

  • Create site using CaiJimmy/hugo-theme-stack as theme in blogdown in RStudio.
  • Create new post.
  • Add body text.
  • Render site/page.
  • Then add a section heading in the middle of the post.
  • Render site again, at which point the margins disappear.

Expected behavior

  • I would expect that after a section heading, the body text and images would still have a margin.

Screenshots

The body text above the section heading preceding the first heading of the post, but after the section heading, the margins disappear.

image

Desktop (please complete the following information):
Windows 10
Chrome 88
Hugo 0.81
Latest blogdown version
Latest RStudio version

Additional context
Site rendered with blogdown package in RStudio. This behavior is likely not due to the theme choice, as the theme demo page shows posts with margins all the way through even after section headings.

@austinwpearce austinwpearce added the bug an unexpected problem or unintended behavior label Feb 20, 2021
@austinwpearce
Copy link
Author

austinwpearce commented Feb 21, 2021

I heard back from the Hugo theme creator. He said:

That's probably something related to Blogdown's Markdown render engine, it should wrap text inside <p> tag.

hugo-theme-stack/assets/scss/partials/layout/article.scss

Lines 192 to 195 in 96db925

& > p {
margin: 1.5em 0;
padding: 0 var(--card-padding);
}

@yihui
Copy link
Member

yihui commented Mar 4, 2021

Thanks! I just submitted a fix to the theme: CaiJimmy/hugo-theme-stack#162

@austinwpearce
Copy link
Author

Works! We all appreciate your responsiveness and attention to details. Thanks, @yihui.

CaiJimmy pushed a commit to CaiJimmy/hugo-theme-stack that referenced this issue Mar 6, 2021
…162)

Fixes rstudio/blogdown#591: not only `<p>` but also `<div>` could be the direct child of `.article-content`, so we also need the padding for `<div>`. The `div`s are generated by Pandoc, instead of Hugo's Markdown renderer. I think it will be great to support both ways.
rinav pushed a commit to rinav/hugo-theme-stack that referenced this issue Apr 23, 2021
…aiJimmy#162)

Fixes rstudio/blogdown#591: not only `<p>` but also `<div>` could be the direct child of `.article-content`, so we also need the padding for `<div>`. The `div`s are generated by Pandoc, instead of Hugo's Markdown renderer. I think it will be great to support both ways.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants