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

content adapter: Handle <!--more--> separator in content.value #12556

Closed
jmooring opened this issue May 31, 2024 · 1 comment · Fixed by #12557
Closed

content adapter: Handle <!--more--> separator in content.value #12556

jmooring opened this issue May 31, 2024 · 1 comment · Fixed by #12557
Assignees
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented May 31, 2024

This may not be possible, in which case we should add a note to the content adapter documentation.

func TestFoo(t *testing.T) {
	t.Parallel()

	files := `
-- hugo.toml --
disableKinds = ['home','rss','section','sitemap','taxonomy','term']
[markup.goldmark.renderer]
unsafe = true
-- content/s1/_content.gotmpl --
{{ $page := dict
	"content" (dict "mediaType" "text/markdown" "value" "aaa <!--more--> bbb")
	"title" "p1"
	"path" "p1"
  }}
  {{ .AddPage $page }}
-- layouts/_default/single.html --
summary: {{ .Summary }}|content: {{ .Content}}
`

	b := hugolib.Test(t, files)

	b.AssertFileContent("public/s1/p1/index.html",
		"summary: aaa|content: <p>aaa bbb</p>",
	)
}

The file content assertion fails. Actual content is:

summary: aaa bbb|content: <p>aaa <!--more--> bbb</p>

Note that (a) the summary isn't correct and (b) the <--more--> separator is passed through to content.

Reference: https://discourse.gohugo.io/t/content-adapters-content-summary-not-works/50096/

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants