mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
feat: add Mention shortcode to mention people
To mention someone, type `{{% mention "username" %}}` where `username` corresponds to a user account in Academic. This will create a link to the user's profile page.
Close #1421
This commit is contained in:
1 parent
9cbf5f8ffc
commit
d0fb759153
1 file changed
+10
@@ -0,0 +1,10 @@
|
||||
{{- $username := .Get 0 -}}
|
||||
{{- $username_url := $username | urlize -}}
|
||||
{{- $taxonomy := "authors" -}}
|
||||
{{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy $username_url) -}}
|
||||
{{- $name := $profile_page.Params.name | default ($username|markdownify) -}}
|
||||
{{- with $profile_page -}}
|
||||
<a href="{{$profile_page.RelPermalink}}">{{$name}}</a>
|
||||
{{- else -}}
|
||||
{{- $name -}}
|
||||
{{- end -}}
|
||||
Reference in new issue
Block a user