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

fix(shortcode): allow passing html attributes to image #477

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/posts/2015-03-11-boxen-tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ laptop? We'll look at Boxen and how to set it up to get the most out of it.
"""
proof = false
+++
{{< image "automate-all-the-things.jpg" "Automate all the things!" "float-right" >}}
{{< image "automate-all-the-things.jpg" "Automate all the things!" `class="float-right"` >}}

A while back I wrote about [The Perfect Dev Setup]({{< ref "2012-02-02-perfect-dev-setup-lion" >}}) that walked through what I considered to be (at the time), the perfect development setup. Part of the reason I wrote a post about it so that I could repeat it on any machine that I used, but it would still take time and copy/pasting commands. Surely there must be a better way?

Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/image.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ with resources.Get (path.Join "images" (index .Params 0)) }}
<img
{{ with index $.Params 2 }}class="{{ . }}"{{ end }}
{{ index $.Params 2 | safeHTMLAttr }}
src="{{ .RelPermalink }}"
width="{{ .Width }}"
height="{{ .Height }}"
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
'./content/**/*.{html,js,md}',
'./layouts/**/*.{html,js}',
],
safelist: [{ pattern: /^hero-/ }, 'float-right'],
safelist: [{ pattern: /^hero-/ }],
theme: {
heroes: [
'main',
Expand Down
Loading