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

Allow HTML to be rendered in sidebar description #123

Closed
jcoffa opened this issue Aug 24, 2023 · 1 comment · Fixed by #129
Closed

Allow HTML to be rendered in sidebar description #123

jcoffa opened this issue Aug 24, 2023 · 1 comment · Fixed by #129

Comments

@jcoffa
Copy link

jcoffa commented Aug 24, 2023

This would allow links and line-breaks to be used:

[params]
description = 'A portfolio for <a href="https://www.my-company.com">work</a><br>A tech blog for fun'

Which would render like:

image

I believe the change could be small as well; the description can be piped into the safeHTML function inside layouts/sidebar/title.html like so:

<div class="sidebar-about">

    <!-- ... -->

    <p class="lead">
    {{ with .Site.Params.description }}{{. | safeHTML}}{{end}}
    <!--                                   ^^^^^^^^^^ new change -->
    </p>
</div>
@lukeorth lukeorth linked a pull request Sep 10, 2023 that will close this issue
@lukeorth
Copy link
Owner

Thank you, @jcoffa! Great suggestion, and an easy copy/paste solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants