Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Regression in 0.60.0 for $headless ? #6552

Closed
jensamunch opened this issue Nov 28, 2019 · 12 comments · Fixed by #6558
Closed

Regression in 0.60.0 for $headless ? #6552

jensamunch opened this issue Nov 28, 2019 · 12 comments · Fixed by #6558
Labels
Bug
Milestone

Comments

@jensamunch
Copy link

@jensamunch jensamunch commented Nov 28, 2019

What version of Hugo are you using (hugo version)?

Moving from 0.59.1 to 0.60.1 quietely (no warnings) stopped showing our headless content.

Here's an example of the code that outputs nothing with 0.60.0

<section class="customer-logos section">
	<div class="container">
		<div class="customer-logos-inner section-inner has-top-divider">
			<h2 class="section-title text-center mt-0">{{ .Site.Params.logos }}</h2>
			<div class="customer-logos-wrap is-revealing">
				{{ $headless := .Site.GetPage "page" "headless/customer-logos" }}
				{{ $reusablePages := $headless.Resources.Match "*" }}
				{{ range $reusablePages }}
				<div class="customer-logo">
					<a href="{{ .Params.link }}" target="_blank">
						{{ with .Params.image }}
						{{ $original := resources.Get .  }}
						{{ $coverScaled2x := $original.Resize "x160 center" }}
						{{ $coverScaled1x := ($coverScaled2x.Resize "x80") }}
						<img srcset="{{ $coverScaled1x.RelPermalink }} 1x, {{ $coverScaled2x.RelPermalink }} 2x" src="{{ $coverScaled1x.RelPermalink }}" width="{{ $coverScaled1x.Width }}" height="{{ $coverScaled1x.Height }}">
						{{ end }}
					</a>
				</div>
				{{ end }}
			</div>
		</div>
	</div>
</section>
@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

image

@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

image

@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

image

@bep bep added this to the v0.60.1 milestone Nov 28, 2019
@onedrawingperday

This comment has been minimized.

Copy link
Contributor

@onedrawingperday onedrawingperday commented Nov 28, 2019

This seems related to what has already been reported in the forum about HTML with indentation contained in shortcodes and partials being wrapped in pre and code elements.

https://discourse.gohugo.io/t/0-60-0-goldmark-html-indentation-in-partial-shortcode-wrapped-in-pre-code/22019/

I have already advised @divinerites to report this bug in the Hugo issue tracker.

@jensamunch as a workaround please remove the indentation from the HTML and let us know..

@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

Ok will try. Super confusing to me since this is a partial template. I wouldn’t expect Hugo to be opinionated about my formatting there. Only in markup.

Isn’t it normal to beautify HTML code for readability?

@divinerites

This comment has been minimized.

Copy link

@divinerites divinerites commented Nov 28, 2019

Yep @jensamunch it is exactly my thought (written in the #6553).

A Workaround is flatting all HTML in partials called by shortcode.

@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

Does atom have a plugin that allows me to flatten all files? Seems like a lot of manual work. Hmm I think I’ll Stay on Black Friday

@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

Hmmm. This doesn't seem to be the same issue. Now back at laptop and there is still no HTML output from flat partial:

<section class="customer-logos section">
<div class="container">
<div class="customer-logos-inner section-inner has-top-divider">
<h2 class="section-title text-center mt-0">{{ .Site.Params.logos }}</h2>
<div class="customer-logos-wrap">
{{ $headless := .Site.GetPage "page" "headless/customer-logos" }}
{{ $reusablePages := $headless.Resources.Match "*" }}
{{ range $reusablePages }}
<div class="customer-logo">
<a href="{{ .Params.link }}" target="_blank">
{{ with .Params.image }}
{{ $original := resources.Get .  }}
{{ $coverScaled2x := $original.Resize "x160 center" }}
{{ $coverScaled1x := ($coverScaled2x.Resize "x80") }}
<img srcset="{{ $coverScaled1x.RelPermalink }} 1x, {{ $coverScaled2x.RelPermalink }} 2x" src="{{ $coverScaled1x.RelPermalink }}" width="{{ $coverScaled1x.Width }}" height="{{ $coverScaled1x.Height }}">
{{ end }}
</a>
</div>
{{ end }}
</div>
</div>
</div>
</section>
@bep

This comment has been minimized.

Copy link
Member

@bep bep commented Nov 28, 2019

Stay on Black Friday

That's tomorrow :-)

This seems to be a bug in Goldmark -- I will take that with him. He is very quick in fixing stuff...

I'm closing this in favour of #6553 .

A general tip about shortcodes and HTML is that in some cases it can make sense to use the {{< separator, which makes sure that the Markdown engine does not mess with it.

@bep bep closed this Nov 28, 2019
@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

Actually wait @bep - this is not the same issue.

My headless folder was called "customer-logos". When I changed it to "customerlogos" everything worked again.

No need to flatten the HTML. So unrelated.

@jensamunch

This comment has been minimized.

Copy link
Author

@jensamunch jensamunch commented Nov 28, 2019

I'm super confused. It's randomly working and not working...I'm just changing file names and formatting..I can't make any sense of a pattern.

@bep

This comment has been minimized.

Copy link
Member

@bep bep commented Nov 29, 2019

I'm super confused. It's randomly working and not working...

It's called parallelism ... I found the bug and will fix it soon.

bep added a commit to bep/hugo that referenced this issue Nov 29, 2019
@bep bep closed this in bb80fff Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.