add format and music shortcode

This commit is contained in:
Dillon ZENG 2019-08-09 01:54:09 +08:00
parent 5e55b25c8a
commit 0e48c9f3e3
7 changed files with 64 additions and 1 deletions

View file

@ -196,6 +196,22 @@
color: #7E848F;
}
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
.align-left {
text-align: left;
}
.float-right {
float: right;
}
}
p {

View file

@ -36,6 +36,14 @@
{{ $countdown := `
<script src="https://cdn.jsdelivr.net/npm/jquery-countdown@2.2.0/dist/jquery.countdown.min.js" integrity="sha256-Ikk5myJowmDQaYVCUD0Wr+vIDkN8hGI58SGWdE671A8=" crossorigin="anonymous"></script>
` }}
<!-- jQuery.countdown https://github.com/hilios/jQuery.countdown/ -->
{{ $metingjs := `
<!-- require APlayer -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<!-- require MetingJS -->
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>
` }}
{{ $jquery | safeHTML }}
{{ $typeit | safeHTML }}
@ -49,8 +57,14 @@
{{ end }}
{{ if .IsPage }}
{{ $prettify | safeHTML }}
{{ if .Params.Code }}
{{ $prettify | safeHTML }}
{{ end }}
{{ if .Params.Music }}
{{ $metingjs | safeHTML }}
{{ end }}
{{ $countdown | safeHTML }}
{{ $scripts = $scripts | append $dynamicToTop }}
{{ if $postHasImages }}

View file

@ -0,0 +1,3 @@
<div class='align-center'>
{{ .Inner }}
</div>

View file

@ -0,0 +1,3 @@
<div class='align-left'>
{{ .Inner }}
</div>

View file

@ -0,0 +1,3 @@
<div class='align-right'>
{{ .Inner }}
</div>

View file

@ -0,0 +1,3 @@
<div class='float-right'>
{{ .Inner }}
</div>

View file

@ -0,0 +1,21 @@
{{ if .IsNamedParams }}
<meting-js server={{ .Get "server" }} type={{ .Get "type" }} id={{ .Get "id" }}
{{ with .Get "autoplay" }}
autoplay={{ . }}
{{ end }}
{{ with .Get "mini" }}
mini={{ . }}
{{ end }}
{{ with .Get "fixed" }}
fixed={{ . }}
{{ end }}
{{ with .Get "list-folded" }}
list-folded={{ . }}
{{ end }}
{{ with .Get "list-max-height" }}
list-max-height={{ . }}
{{ end }}
theme="#A9A9B3"></meting-js>
{{ else }}
<meting-js server={{ .Get 0 }} type={{ .Get 1 }} id={{ .Get 2 }} theme="#A9A9B3"></meting-js>></meting-js>
{{ end }}