feat: add shortcodes from minimo theme
This commit is contained in:
parent
aaa02408a0
commit
546b517742
|
@ -1 +1,3 @@
|
|||
/.hugo_build.lock
|
||||
/public/
|
||||
/themes/emacsy/exampleSite
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Munif Tanjim
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,3 @@
|
|||
<div class='align-center'>
|
||||
{{ .Inner | markdownify }}
|
||||
</div>
|
|
@ -0,0 +1,26 @@
|
|||
<div class='convo'>
|
||||
<ol>
|
||||
{{ range ( split .Inner "\n" ) }}
|
||||
{{ with . }}
|
||||
<li>
|
||||
{{ range $i, $chunk := ( split . "::" ) }}
|
||||
{{ if or $chunk "s" }}
|
||||
{{ if eq $i 0 }}
|
||||
<div class='person'>
|
||||
{{- $chunk | markdownify -}}
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class='sep'>
|
||||
{{- print " " ( $.Get "sep" | default ":" ) " " -}}
|
||||
</div>
|
||||
<div class='text'>
|
||||
{{- $chunk | markdownify -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ol>
|
||||
</div>
|
|
@ -0,0 +1,13 @@
|
|||
{{- if gt ( len .Params ) 1 -}}
|
||||
{{- $.Scratch.Set "format" ( .Get 1 ) -}}
|
||||
{{- else -}}
|
||||
{{- $splits := ( split ( .Get 0 ) "." ) -}}
|
||||
{{- $splitsLength := ( len $splits ) -}}
|
||||
{{- $format := ( index $splits ( sub $splitsLength 1 ) ) -}}
|
||||
{{- $.Scratch.Set "format" $format -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $file := ( .Get 0 ) -}}
|
||||
{{- $format := ( $.Scratch.Get "format" ) -}}
|
||||
|
||||
{{- ( print "```" $format "\n" ( readFile $file ) "\n" "```" ) | markdownify -}}
|
|
@ -0,0 +1,5 @@
|
|||
{{- $displayMode := ( not ( eq ( .Get 0 ) "inline" ) ) -}}
|
||||
|
||||
{{- print ( cond $displayMode "\\[" "\\(" ) }}
|
||||
{{ .Inner }}
|
||||
{{- print ( cond $displayMode "\\]" "\\)" ) -}}
|
|
@ -0,0 +1,7 @@
|
|||
{{- if eq .Page.Params.mermaid true -}}
|
||||
|
||||
<div class="mermaid">
|
||||
{{ safeHTML .Inner }}
|
||||
</div>
|
||||
|
||||
{{- end -}}
|
|
@ -0,0 +1,7 @@
|
|||
<iframe
|
||||
style='width: 100%; height: 500px;'
|
||||
frameborder='0' marginwidth='0' marginheight='0' scrolling='no'
|
||||
src='https://www.slideshare.net/slideshow/embed_code/{{.Get "id"}}?rel=0'
|
||||
allowfullscreen webkitallowfullscreen mozallowfullscreen>
|
||||
</iframe>
|
||||
<br/>
|
|
@ -0,0 +1,5 @@
|
|||
{{ $svg := .Get 0 }}
|
||||
<svg class='icon' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'>
|
||||
{{ $icon := print "svg/" $svg ".svg" | resources.Get }}
|
||||
{{ $icon.Content | replaceRE `(?s)^.*<svg.*?>(.*)<\/svg>.*$` "$1" | safeHTML }}
|
||||
</svg>
|
|
@ -0,0 +1,17 @@
|
|||
<div class='text-shortcode' style='
|
||||
{{- if .IsNamedParams -}}
|
||||
{{- with or ( .Get "s" ) ( .Get "size" ) -}}
|
||||
font-size: {{- . -}}em;
|
||||
{{- end -}}
|
||||
{{- with or ( .Get "c" ) ( .Get "color" ) -}}
|
||||
color: {{- . -}};
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- with .Get 0 -}} font-size: {{- . -}}em; {{- end -}}
|
||||
{{- if gt ( len .Params ) 1 -}}
|
||||
{{- with .Get 1 -}} color: {{- . -}}; {{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
'>
|
||||
{{- .Inner | markdownify -}}
|
||||
</div>
|
|
@ -0,0 +1,3 @@
|
|||
<script type='text/tikz'>
|
||||
{{ .Inner }}
|
||||
</script>
|
Loading…
Reference in New Issue