New post in drafts and almost ready. Also on a new computer, so had to re-download all the theme and submodules. Thinking of just converting the box submodule to be native to my blog for easier maintenence. Need to proof this last post on google sheets and publish tomorrow morning.
This commit is contained in:
@ -0,0 +1,64 @@
|
||||
{{/* Source: https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
{{/* OUTDATED: this shortcode is now named "audio-archive", please fix your Markdown files and see this shortcode for an updated version */}}
|
||||
|
||||
{{- $src := .Get 0 -}}
|
||||
|
||||
{{/* Convert URL from archive.org/details/foo to archive.org/metadata/foo */}}
|
||||
{{ $archiveMetadata := replace $src "/details/" "/metadata/" }}
|
||||
|
||||
{{/* Get JSON */}}
|
||||
{{ $dataJ := getJSON $archiveMetadata }}
|
||||
|
||||
{{- $identifier := $dataJ.metadata.identifier -}}
|
||||
{{- $root := "https://archive.org/download" -}}
|
||||
|
||||
{{ "<!-- Shortcode 'archive-audio.html' -->" | safeHTML }}
|
||||
|
||||
<style>
|
||||
|
||||
.audio-treeview {
|
||||
list-style: none;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
|
||||
.audio-treeview li {
|
||||
padding-top: 2em;
|
||||
}
|
||||
|
||||
.audio-treeview li figure {
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<ul class="audio-treeview">
|
||||
{{ range $dataJ.files }}
|
||||
|
||||
{{/* Show Audio files only */}}
|
||||
{{ if or (eq .format "VBR MP3") (eq .format "MPEG-4 Audio") }}
|
||||
<li>
|
||||
{{$path := print $root "/" $identifier "/" .name}}
|
||||
{{/* <a href="{{ $path }}" target="_blank" aria-label="Download {{ index .name }}" download>{{ index .name }}</a> */}}
|
||||
{{/* "index .name:" {{ index .name }} <br> */}}
|
||||
|
||||
{{/* Remove folder from path */}}
|
||||
{{ $fileHeading := replaceRE ".*/" "" .name }}
|
||||
{{/* Remove file extension and display */}}
|
||||
{{ strings.TrimSuffix (path.Ext $fileHeading) $fileHeading }}
|
||||
|
||||
{{/* Embed HTML player */}}
|
||||
<figure>
|
||||
<audio controls class="player">
|
||||
<source src="{{- $path -}}" type="audio/mpeg">
|
||||
</audio>
|
||||
</figure>
|
||||
|
||||
{{/* Add a label depending on metadata */}}
|
||||
{{/* {{ if in .source "original" }}
|
||||
<b>ORIGINAL</b>
|
||||
{{ end }} */}}
|
||||
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
@ -0,0 +1,65 @@
|
||||
{{/* Source: https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{- $src := .Get 0 -}}
|
||||
|
||||
{{/* Convert URL from archive.org/details/foo to archive.org/metadata/foo */}}
|
||||
{{ $archiveMetadata := replace $src "/details/" "/metadata/" }}
|
||||
|
||||
{{/* Get JSON */}}
|
||||
{{ $dataJ := getJSON $archiveMetadata }}
|
||||
|
||||
{{- $identifier := $dataJ.metadata.identifier -}}
|
||||
{{- $root := "https://archive.org/download" -}}
|
||||
|
||||
{{ "<!-- Shortcode 'audio-archive.html' -->" | safeHTML }}
|
||||
|
||||
<style>
|
||||
|
||||
.audio-treeview {
|
||||
list-style: none;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
|
||||
.audio-treeview li {
|
||||
padding-top: 2em;
|
||||
}
|
||||
|
||||
.audio-treeview li figure {
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<ul class="audio-treeview">
|
||||
{{ range $dataJ.files }}
|
||||
|
||||
{{/* Show Audio files only */}}
|
||||
{{ if or (eq .format "VBR MP3") (eq .format "MPEG-4 Audio") }}
|
||||
{{/* Only MP3: */}}
|
||||
{{/* {{ if eq .format "VBR MP3" }} */}}
|
||||
<li>
|
||||
{{$path := print $root "/" $identifier "/" .name}}
|
||||
{{/* <a href="{{ $path }}" target="_blank" aria-label="Download {{ index .name }}" download>{{ index .name }}</a> */}}
|
||||
{{/* "index .name:" {{ index .name }} <br> */}}
|
||||
|
||||
{{/* Remove folder from path */}}
|
||||
{{ $fileHeading := replaceRE ".*/" "" .name }}
|
||||
{{/* Remove file extension and display */}}
|
||||
{{ strings.TrimSuffix (path.Ext $fileHeading) $fileHeading }}
|
||||
|
||||
{{/* Embed HTML player */}}
|
||||
<figure>
|
||||
<audio controls class="player">
|
||||
<source src="{{- $path -}}" type="audio/mpeg">
|
||||
</audio>
|
||||
</figure>
|
||||
|
||||
{{/* Add a label depending on metadata */}}
|
||||
{{/* {{ if in .source "original" }}
|
||||
<b>ORIGINAL</b>
|
||||
{{ end }} */}}
|
||||
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
@ -0,0 +1,28 @@
|
||||
{{/* Source: https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{- $src := "" -}}
|
||||
{{- $caption := "" -}}
|
||||
{{- $class := "" -}}
|
||||
{{- $preload := "" -}}
|
||||
|
||||
|
||||
{{- if .IsNamedParams }}
|
||||
{{- $src = .Get "src" -}}
|
||||
{{- $caption = .Get "caption" -}}
|
||||
{{- $class = .Get "class" -}}
|
||||
{{- $preload = .Get "preload" | default "metadata" -}}
|
||||
{{- else }}
|
||||
{{- $src = .Get 0 -}}
|
||||
{{- $caption = .Get 1 -}}
|
||||
{{- $class = .Get 2 -}}
|
||||
{{- $preload = .Get 3 -}}
|
||||
{{- end }}
|
||||
|
||||
|
||||
<figure {{ with $class }}class="{{ . }}"{{ end }}>
|
||||
<audio controls class="player" preload="{{ $preload }}">
|
||||
{{ with $src }}<source src="{{ . | relURL }}" type="audio/mpeg">{{ end }}
|
||||
</audio>
|
||||
{{/* <a href="{{ .Get "src" }}" class="button small" download><i class="icon fas fa-download"></i></a> */}}
|
||||
{{ with $caption }}<figcaption>{{ . }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
@ -0,0 +1,122 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{/* Available box types: warning, info, important, tip */}}
|
||||
{{- $boxType := .Get 0 | default "info" -}}
|
||||
|
||||
{{/* Workaround markdownify inconsistency for single/multiple paragraphs */}}
|
||||
{{- $raw := (markdownify .Inner | chomp) -}}
|
||||
{{- $block := findRE "(?is)^<(?:address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h(?:1|2|3|4|5|6)|header|hgroup|hr|li|main|nav|noscript|ol|output|p|pre|section|table|tfoot|ul|video)\\b" $raw 1 -}}
|
||||
|
||||
{{/* Count how many times we've called this shortcode and load the css if it's the first time */}}
|
||||
{{- if not ($.Page.Scratch.Get "box_count") -}}
|
||||
|
||||
<style type="text/css">
|
||||
.box-shortcode {
|
||||
padding: 1.6em;
|
||||
padding-top: 1.4em;
|
||||
line-height: 1.4em;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 2em;
|
||||
border-radius: 4px;
|
||||
color: #444;
|
||||
background: #f3ebe850;
|
||||
}
|
||||
|
||||
.box-title {
|
||||
margin: -18px -18px 12px;
|
||||
padding: 4px 18px;
|
||||
border-radius: 4px 4px 0 0;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
background: #6ab0de;
|
||||
}
|
||||
.box-shortcode.warning .box-title {
|
||||
background: #ff6b6b;
|
||||
}
|
||||
.box-shortcode.warning {
|
||||
background: #ff6b6b4f;
|
||||
}
|
||||
.box-shortcode.info .box-title {
|
||||
background: #0089e488;
|
||||
}
|
||||
.box-shortcode.info {
|
||||
background: #0089e41c;
|
||||
box-shadow: 3px 3px 5px #0089e410;
|
||||
}
|
||||
.box-shortcode.important .box-title {
|
||||
background: #f7ec2c;
|
||||
}
|
||||
.box-shortcode.important {
|
||||
background: #f7ec2c7d;
|
||||
}
|
||||
.box-shortcode.tip .box-title {
|
||||
background: #a3ffa34d;
|
||||
}
|
||||
.box-shortcode.tip {
|
||||
background: #a3ffa34d;
|
||||
box-shadow: 3px 3px 5px #0089e410;
|
||||
}
|
||||
.icon-box {
|
||||
display: inline-flex;
|
||||
align-self: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.icon-box img,
|
||||
.icon-box svg {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
fill: currentColor;
|
||||
}
|
||||
.icon-box img,
|
||||
.icon-box.baseline svg {
|
||||
top: 0.125em;
|
||||
position: relative;
|
||||
}
|
||||
.box-shortcode p {
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
.box-shortcode p:first-of-type {
|
||||
display: inline;
|
||||
}
|
||||
.box-shortcode p:nth-of-type(2) {
|
||||
margin-top: 0.6em;
|
||||
}
|
||||
.box-shortcode p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
{{/* SVG icons */}}
|
||||
<svg width="0" height="0" display="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<symbol id="tip-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
|
||||
<path
|
||||
d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/>
|
||||
</symbol>
|
||||
<symbol id="important-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
|
||||
<path
|
||||
d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
|
||||
</symbol>
|
||||
<symbol id="warning-box" viewBox="0 0 576 512" preserveAspectRatio="xMidYMid meet">
|
||||
<path
|
||||
d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>
|
||||
</symbol>
|
||||
<symbol id="info-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
|
||||
<path
|
||||
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- $.Page.Scratch.Add "box_count" 1 -}}
|
||||
|
||||
<div class="box box-shortcode {{ $boxType }}" {{ if len .Params | eq 2 }} id="{{ .Get 1 }}" {{ end }}>
|
||||
<span class="icon-box baseline">
|
||||
<svg><use href="#{{- $boxType -}}-box"></use></svg>
|
||||
</span>
|
||||
{{- if or $block (not $raw) }}
|
||||
{{ $raw }}
|
||||
{{ else }}
|
||||
<p>{{ $raw }}</p>
|
||||
{{ end -}}
|
||||
</div>
|
||||
@ -0,0 +1,45 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{ $options := (.Get 0) | default "by-nc-sa" }}
|
||||
|
||||
<style>
|
||||
.license img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
a.license {
|
||||
text-decoration: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
{{/* Build the URL according to selected license options */}}
|
||||
{{ $urlOptions := replace $options " " "-" }}
|
||||
{{ $url := printf "%v%v%v" "https://creativecommons.org/licenses/" $urlOptions "/4.0" }}
|
||||
|
||||
|
||||
<a class="license" href="{{ $url }}">
|
||||
|
||||
{{ with resources.Get "/creative-commons-icons/cc.jpg" }}
|
||||
<img src="{{ .RelPermalink }}" alt="Creative Commons logo" class="license-logo">
|
||||
{{ end }}
|
||||
|
||||
{{ if in $options "by"}}
|
||||
{{ with resources.Get "/creative-commons-icons/by.jpg" }}
|
||||
<img src="{{ .RelPermalink }}" alt="Creative Commons logo" class="license-logo">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if in $options "nc"}}
|
||||
{{ with resources.Get "/creative-commons-icons/nc.jpg" }}
|
||||
<img src="{{ .RelPermalink }}" alt="Creative Commons logo" class="license-logo">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if in $options "sa"}}
|
||||
{{ with resources.Get "/creative-commons-icons/sa.jpg" }}
|
||||
<img src="{{ .RelPermalink }}" alt="Creative Commons logo" class="license-logo">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
</a>
|
||||
@ -0,0 +1,3 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
</div><div class="column-right">
|
||||
@ -0,0 +1,28 @@
|
||||
{{/* Source: https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{/* Check if the shortcode was already loaded on this page and load CSS only the first time */}}
|
||||
{{- if not ($.Page.Scratch.Get "column_count") -}}
|
||||
<style>
|
||||
div.splitbox {width:100%; overflow:auto;}
|
||||
|
||||
div.splitbox div.column-left {
|
||||
width:48%;
|
||||
float:left;}
|
||||
div.splitbox div.column-right {
|
||||
width:48%;
|
||||
float:right;}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
div.splitbox div.column-left {
|
||||
width:100%;
|
||||
float:left;}
|
||||
div.splitbox div.column-right {
|
||||
width:100%;
|
||||
float:left;}
|
||||
}
|
||||
</style>
|
||||
{{- end -}}
|
||||
|
||||
{{- $.Page.Scratch.Add "column_count" 1 -}}
|
||||
|
||||
<div class="splitbox"><div class="column-left">
|
||||
@ -0,0 +1,58 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{/* Count how many times we've called this shortcode and load the css if it's the first time */}}
|
||||
{{- if not ($.Page.Scratch.Get "details_count") -}}
|
||||
<style>
|
||||
details summary {
|
||||
min-width: 200px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
details summary > * {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
details {
|
||||
margin: 1em;
|
||||
border-radius: 5px;
|
||||
padding: 1em;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 .1rem 1rem -.5rem rgba(0,0,0,.4);
|
||||
}
|
||||
|
||||
summary {
|
||||
padding: 0 1rem .3em 1.2rem;
|
||||
display: block;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
summary:before {
|
||||
content: '>';
|
||||
position: absolute;
|
||||
top: .1rem;
|
||||
left: 0.1rem;
|
||||
transform: rotate(0);
|
||||
/* transform-origin: .2rem 50%; */
|
||||
transition: .3s transform ease;
|
||||
}
|
||||
|
||||
/* THE MAGIC 🧙‍♀️ */
|
||||
details[open] > summary:before {
|
||||
transform: rotate(180deg);
|
||||
content: '-';
|
||||
}
|
||||
|
||||
details summary::-webkit-details-marker {
|
||||
display:none;
|
||||
}
|
||||
|
||||
</style>
|
||||
{{- end -}}
|
||||
{{- $.Page.Scratch.Add "details_count" 1 -}}
|
||||
|
||||
|
||||
<details><summary>{{ .Get 0 | markdownify }}</summary>
|
||||
{{ .Inner | markdownify }}
|
||||
</details>
|
||||
@ -0,0 +1,3 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
</div><div style="clear:both"></div></div>
|
||||
@ -0,0 +1,30 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
<ul class="github-api">
|
||||
{{ $url := .Get "url" }}
|
||||
{{ range getJSON $url }}
|
||||
{{ $p := . }}
|
||||
<li>
|
||||
<div class="github-avatar">
|
||||
<img src="{{$p.owner.avatar_url}}" alt="Avatar of {{$p.owner.login}}" title="Avatar of {{$p.owner.login}}">
|
||||
</div>
|
||||
<div class="github-name">
|
||||
<strong>
|
||||
<a href="{{ $p.html_url }}" target="_blank">{{ $p.name | humanize }}</a>
|
||||
</strong>
|
||||
</div>
|
||||
{{/* {{ $p.full_name }} */}}
|
||||
<div class="github-description">
|
||||
<p>{{ $p.description }}</p>
|
||||
</div>
|
||||
<div class="github-metadata">
|
||||
<small>
|
||||
Stars: {{$p.stargazers_count}} | Forks: {{$p.forks_count}} | Size: {{$p.size}} {{if $p.archived}}| Archived{{end}}<br>
|
||||
Updated at: {{substr $p.updated_at 0 10}} - Language: {{$p.language}}
|
||||
</small>
|
||||
</div>
|
||||
</li>
|
||||
{{/* {{ $p }} */}}
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{- $icon := "" -}}
|
||||
{{- $theme := "" -}}
|
||||
{{- $class := "" -}}
|
||||
{{- $href := "" -}}
|
||||
|
||||
|
||||
{{/* Count how many times we've called this shortcode and load the css if it's the first time */}}
|
||||
{{- if not ($.Page.Scratch.Get "ico_count") -}}
|
||||
<style>
|
||||
.ico {
|
||||
height: 1.15em;
|
||||
width: 1.15em;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
.ico-sm .ico {
|
||||
height: .8em;
|
||||
width: .8em;
|
||||
}
|
||||
.ico-md .ico {
|
||||
height: 1.5em;
|
||||
width: 1.5em;
|
||||
}
|
||||
.ico-xl .ico {
|
||||
height: 2em;
|
||||
width: 2em;
|
||||
}
|
||||
.ico-xxl .ico {
|
||||
height: 3em;
|
||||
width: 3em;
|
||||
}
|
||||
</style>
|
||||
{{- end -}}
|
||||
{{- $.Page.Scratch.Add "ico_count" 1 -}}
|
||||
|
||||
|
||||
{{- if .IsNamedParams }}
|
||||
{{- $icon = .Get "icon" -}}
|
||||
{{- $theme = (.Get "theme" | default "default") -}}
|
||||
{{- $class = .Get "class" -}}
|
||||
{{- $href = .Get "href" -}}
|
||||
{{- else }}
|
||||
{{- $icon = .Get 0 -}}
|
||||
{{- $theme = (.Get 1 | default "default") -}}
|
||||
{{- $class = .Get 2 -}}
|
||||
{{- $href = .Get 3 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not $icon -}}
|
||||
{ {- errorf "Missing required 'icon'. Shortcode: 'ico'." -}}
|
||||
{{- end -}}
|
||||
{{- with .Page.Resources.GetMatch $icon }}
|
||||
{{ $icon = . }}
|
||||
{{ end -}}
|
||||
{{ partial "ico" (dict "icon" $icon "theme" $theme "class" $class "href" $href) }}
|
||||
@ -0,0 +1,4 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{ $file := .Get 0 }}
|
||||
{{ (printf "%s%s" .Page.File.Dir $file) | readFile | replaceRE "^---[\\s\\S]+?---" "" | safeHTML | markdownify }}
|
||||
@ -0,0 +1,21 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{- $title := "" -}}
|
||||
{{- $theme := "" -}}
|
||||
{{- $class := "" -}}
|
||||
|
||||
|
||||
{{- if .IsNamedParams }}
|
||||
{{- $title = .Get "title" -}}
|
||||
{{- $theme = (.Get "theme" | default "default") -}}
|
||||
{{- $class = .Get "class" -}}
|
||||
{{- else }}
|
||||
{{- $title = .Get 0 -}}
|
||||
{{- $theme = (.Get 1 | default "default") -}}
|
||||
{{- $class = .Get 2 -}}
|
||||
{{- end }}
|
||||
|
||||
<div>
|
||||
<h2>{{ $title }}</h2>
|
||||
{{ .Page.TableOfContents }}
|
||||
</div>
|
||||
@ -0,0 +1,35 @@
|
||||
{{/* Source: https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
{{- $src := "" -}}
|
||||
{{- $caption := "" -}}
|
||||
{{- $poster := "" -}}
|
||||
{{- $class := "" -}}
|
||||
{{- $preload := "" -}}
|
||||
|
||||
{{- if .IsNamedParams }}
|
||||
{{- $src = .Get "src" -}}
|
||||
{{- $caption = .Get "caption" -}}
|
||||
{{- $poster = .Get "poster" -}}
|
||||
{{- $class = .Get "class" -}}
|
||||
{{- $preload = .Get "preload" | default "metadata" -}}
|
||||
{{- else }}
|
||||
{{- $src = .Get 0 -}}
|
||||
{{- $caption = .Get 1 -}}
|
||||
{{- $poster = .Get 2 -}}
|
||||
{{- $class = .Get 3 -}}
|
||||
{{- $preload = .Get 4 | default "metadata" -}}
|
||||
{{- end }}
|
||||
|
||||
{{ "<!-- Shortcode 'video.html' -->" | safeHTML }}
|
||||
|
||||
<figure {{ with $class }}class="{{ . }}"{{ end }}>
|
||||
<video playsinline controls class="player" preload="{{ $preload }}" data-poster="{{ $poster }}">
|
||||
{{ with $src }}<source src="{{ . | relURL }}">{{ end }}
|
||||
<p>
|
||||
Your browser does not support HTML5 video.
|
||||
{{ with $src }}Here is <a href="{{ . | relURL }}">">a link to download the video</a>.{{ end }}
|
||||
</p>
|
||||
</video>
|
||||
{{/* <a href="{{ .Get "src" }}" class="button small" download><i class="icon fas fa-download"></i></a> */}}
|
||||
{{ with $caption }}<figcaption>{{ . }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
@ -0,0 +1,45 @@
|
||||
{{/* Source:https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
||||
|
||||
<ul class="wordpress-api">
|
||||
{{ $url := .Get "url" }}
|
||||
{{ range getJSON $url }}
|
||||
{{ $p := . }}
|
||||
{{/* {{ range where $p.categories "=" "1" }} */}}
|
||||
{{/* {{ if eq $p.categories "1" }} */}}
|
||||
<div class="wordpress-article">
|
||||
|
||||
<div class="wordpress-main">
|
||||
<h3>
|
||||
{{ $p.title.rendered | safeHTML | humanize }}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="wordpress-content">
|
||||
{{ $p.content.rendered | safeHTML }}
|
||||
</div>
|
||||
|
||||
<div class="wordpress-metadata">
|
||||
|
||||
Date:
|
||||
{{substr $p.modified 0 10 | time.Format ":date_long" }}
|
||||
|
||||
{{/* Long:
|
||||
{{ $p.date }} */}}
|
||||
|
||||
<a href="{{ $p.link }}">Permalink</a>
|
||||
<p>
|
||||
Attachments:
|
||||
{{/* {{ $p._links.wp:attachment.href }} */}}
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
{{/* {{ $p }} */}}
|
||||
{{ end }}
|
||||
{{/* {{ end }} */}}
|
||||
</ul>
|
||||
Reference in New Issue
Block a user