Skip to content

Commit

Permalink
fixes shortcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed Oct 8, 2023
1 parent 42adfa2 commit b70cf90
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
7 changes: 7 additions & 0 deletions page/layouts/shortcodes/a.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<a
{{- range $k, $v := .Params -}}
{{- (printf " %s=%q" $k $v) | safeHTMLAttr -}}
{{- end -}}
>
{{- .Inner | .Page.RenderString -}}
</a>
2 changes: 1 addition & 1 deletion page/layouts/shortcodes/audio.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<figure .Get with {{ "class" }}class="{{ . }}"{{ end }}>
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
<audio controls preload="{{ .Get "preload" | default "metadata" }}">
{{ with .Get "src" }}<source src="{{ . | relURL }}" type="audio/mpeg">{{ end }}
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}
Expand Down
34 changes: 17 additions & 17 deletions page/layouts/shortcodes/embed-pdf.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if not ($.Page.Scratch.Get "embed-pdf-count") -}}

<script src= '/bpe-symbolic-music/js/pdf-js/build/pdf.js' type="text/javascript"></script>
<script type="text/javascript" src= '/bpe-symbolic-music/js/pdf-js/build/pdf.js'></script>
<!-- <script type="text/javascript" src='{{"/js/pdf-js/build/pdf.js" | relURL}}'></script> -->

<style>
Expand All @@ -11,32 +11,32 @@
min-height: 20vh;
/* overflow-y:scroll; */
}

.pdf-canvas {
border: 1px solid black;
direction: ltr;
width: 100%;
height: auto;
display: none;
}

#the-canvas {
border: 1px solid black;
direction: ltr;
width: 100%;
height: auto;
display: none;
}


.pdf-loadingWrapper {
display: none;
justify-content: center;
align-items: center;
width: 100%;
height: 350px;
}

.pdf-loading {
display: inline-block;
width: 50px;
Expand All @@ -47,17 +47,17 @@
animation: spin 1s ease-in-out infinite;
-webkit-animation: spin 1s ease-in-out infinite;
}

{{/* Download link */}}



#overlayText {
word-wrap: break-word;
display: grid;
justify-content: end;
}

#overlayText a {
position: relative;
top: 10px;
Expand All @@ -71,14 +71,14 @@
border-color: #00000030;
text-decoration: none;
}

#overlayText svg {
height: clamp(1em, 2vw, 1.4em);
width: clamp(1em, 2vw, 1.4em);
}



@keyframes spin {
to { -webkit-transform: rotate(360deg); }
}
Expand All @@ -95,7 +95,7 @@
</div>
<div id="overlayText">
<a href="{{ .Get "url" }}" aria-label="Download" download>
<svg aria-hidden="true" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
<path d="M9 13c.3 0 .5-.1.7-.3L15.4 7 14 5.6l-4 4V1H8v8.6l-4-4L2.6 7l5.7 5.7c.2.2.4.3.7.3zm-7 2h14v2H2z" />
</svg>
</a>
Expand Down Expand Up @@ -261,4 +261,4 @@
renderPage(pageNum);
});
})();
</script>
</script>

0 comments on commit b70cf90

Please sign in to comment.