feat: add sign name shortcode

usage:
1. position param:
        {{< sign-name 你的名字 >}}
        {{< sign-name 你的名字 你的Github用户名 >}}
2. named param:
        {{< sign-name name="你的名字" githubname="你的Github用户名" imgsrc="图片URL" >}}
        githubname imgsrc 有且只能有一个
pull/78/head
Coelacanthus 2021-07-07 23:07:36 +08:00 committed by llh721113
parent 77ac2521f6
commit e0bf2919c9
No known key found for this signature in database
GPG Key ID: 462324D846CB53AA
1 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1,5 @@
{{ if .IsNamedParams }}
<p style="text-align: right;"><img src="{{ if .Get "imgsrc" }}{{ .Get "imgsrc" }}{{ else }}https://avatars.githubusercontent.com/{{ if .Get "githubname" }}{{ .Get "githubname" }}{{ else }}{{ .Get "name" }}{{ end }}?v=4?s=64{{ end }}" style="display: inline; height:2em;vertical-align: middle; border-radius: 50%;"/><u>{{ .Get "name" }}</u>投稿</p>
{{ else }}
<p style="text-align: right;">由{{ if len .Params | eq 2 }}<img src="https://avatars.githubusercontent.com/{{ .Get 1 }}?v=4?s=64" style="display: inline; height:2em;vertical-align: middle; border-radius: 50%;"/>{{ else }}{{ end }}<u>{{ .Get 0 }}</u>投稿</p>
{{ end }}