Skip to content

Commit

Permalink
Fix for audio (#39)
Browse files Browse the repository at this point in the history
* fix: audio fix

* chore: audio fix

* chore: fix about
  • Loading branch information
shivan-s authored Oct 30, 2024
1 parent a2213d5 commit 863094c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ div.content {

& ul ol {
list-style-position: inline;
padding-left: var(--small-gap);
padding-left: var(--normal-gap);
}

& pre:has(code) {
Expand Down Expand Up @@ -430,7 +430,7 @@ div.content {
}
}

figure:has(img) {
figure:has(img, audio) {
display: flex;
flex-direction: column;
justify-content: center;
Expand Down
Binary file added content/posts/test-post/audio.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion content/posts/test-post/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cover:
audio:
src: audio.mp3
caption: caption
hidden: true
hidden: false
---

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 hidden>{{ .Page.Title }}</h1>
<h2>About</h2>
</a>
</header>
<p>{{ truncate 25 .Content }}</p>
<p>{{ truncate 256 .Content }}</p>
<footer>
<a href="{{ .RelPermalink }}">Read more...</a>
</footer>
Expand Down
10 changes: 4 additions & 6 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>{{ .Title }}</h1>
><a href="{{ .Params.githubRepo }}">Suggest Changes</a></span
>
</small>
{{ if not (.Param "cover.hidden") }}
{{ if not (.Param "cover.hidden" | default true) }}
{{ $src := (.Param "cover.image") | default "" }}
{{ $alt := (.Param "cover.alt") | default "" }}
{{ $caption := (.Param "cover.caption") | default false }}
Expand All @@ -26,13 +26,11 @@ <h1>{{ .Title }}</h1>
{{ end }}
</figure>
{{ end }}
{{ if not (.Param "audio.hidden") }}
{{ if not (.Param "audio.hidden" | default true) }}
{{ $src := (.Param "audio.src") | default "" }}
{{ $caption := (.Param "audio.caption") | default false }}
{{ $caption := (.Param "audio.caption") | default "Listen to audio version" }}
<figure>
{{ if $caption }}
<figcaption>{{ $caption }}</figcaption>
{{ end }}
<figcaption>{{ $caption }}</figcaption>
<audio controls src="{{ $src }}"></audio>
</figure>
{{ end }}
Expand Down

0 comments on commit 863094c

Please sign in to comment.