-
Notifications
You must be signed in to change notification settings - Fork 78
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
Inserting HTML into items #15
Comments
Have you tried formatting the link using markdown instead of HTML? I would also try escaping the double quotation marks in the URL. |
Yeah, I've tried both. In yml, you just use a backslash to escape, right?
Like <a href = \"https://www.google.com\">link</a>. Neither is working so
far.
…On Thu, Apr 8, 2021 at 7:26 AM ⚔️ DR ⚔️ ***@***.***> wrote:
Have you tried formatting the link using markdown instead of HTML? I would
also try escaping the double quotation marks in the URL.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOE5YQRWLC2ECDTTEFY4STTHW4JNANCNFSM42RMBERQ>
.
|
Ok. When I have some time I'll look into it. Thanks for the report. |
What worked for me was saving the following html-code as <section>
<span class="icon {{ .style }}"></span>
<h3>{{ .name }}</h3>
{{ with .content }}<p>{{ . | safeHTML }}</p>{{ end }}
</section> That way html syntax in the content field of each item is parsed correctly |
you can do it with pure markdown, but for this you need to adjsut the template. Just change
actually it should work what you are trying to do. Somethin like Edit: I just tried it and it is working: |
I'm attempting to insert a link into the text for an Items element using HTML, but Hugo fails to build the page and throws this error: "failed to load data: "/Users/austinj/Documents/GitHub/retract/data/items.yml:23:1": failed to unmarshal YAML: yaml: line 23: did not find expected key". Line 23 is where I've done the following:
- name : "Title here"
content : "Content here and here is a <a href="https://www.github.com">link</a>."
style : "solid style2 major fa-cog"
Is there a way to add a link into the text of an item element?
The text was updated successfully, but these errors were encountered: