Skip to content

Commit

Permalink
fix: add missing img
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirrito-k423 committed Mar 29, 2024
1 parent ac485f4 commit 24e199f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
{{ define "main" }}
<div class="topdown-main">
<div class="publications-column full4footer">
<img class="img_url" src="{{ .Params.img_url }}">
<div class="publications-column full4footer">
{{ with .Params.img_url }}
{{ $img := . }}
{{ if strings.HasPrefix $img "http://" -}}
<!-- 外链图片 -->
<img class="landscape" src="{{ $img }}">
{{ else if strings.HasPrefix $img "https://" -}}
<!-- 外链图片 -->
<img class="landscape" src="{{ $img }}">
{{ else -}}
<!-- 内链图片 -->
<img class="landscape" src="{{ $.Site.BaseURL }}/{{ $img }}">
{{ end }}
{{ end }}
<h1 style="text-align:left; font-size: xx-large;color:black;">{{ .Params.title }}</h1>
<!-- <p>排版有待调整</p> -->

Expand Down

0 comments on commit 24e199f

Please sign in to comment.