Skip to content

Commit

Permalink
2023-10-28 22:41:17
Browse files Browse the repository at this point in the history
  • Loading branch information
uidHUB committed Oct 28, 2023
1 parent 917c41e commit 2c779b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ <h1 class="text-center">{{ (.Title) }}</h1>
<li>
{{ if (hasPrefix . "http") }}
{{ $url := (urls.Parse .) }}
<a class="text-reset" href="{{ . }}" target="_blank" rel="noopener nofollow">{{ $url.Host }}</a>
{{ $path := (delimit ((split ($url.Path) "/") | last 2) "/") }}
<a class="text-reset" href="{{ . }}" target="_blank" rel="noopener nofollow">
{{ ($url.Host) }} {{ with ($path) }}({{ . }}){{ end }}
</a>
{{ else }}
{{ . }}
{{ end }}
Expand Down

0 comments on commit 2c779b2

Please sign in to comment.