hugo-theme-moments/layouts/partials/row.html
2021-08-05 13:38:08 +08:00

84 lines
No EOL
3.1 KiB
HTML

<div class="row">
<!-- 时间 -->
<div class="col-sm-4 time">
<h2>{{ .Date.Format "Jan 2"}}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }}</h2>
<h4>{{ .Date.Format "2006"}}</h4>
</div>
<!-- 正文 -->
<div class="col-sm-8">
<!-- 抬头 -->
<!-- 头像前面margin2px -->
<div style="margin-top: 2px;">
{{ with .Params.avatar }}
<img src='{{ . }}' class="avatar">
{{ else }}
<img src='{{ .Site.Params.avatar}}' class="avatar">
{{ end }}
<div class="intro">
{{ with .Params.name }}
<h4 class="text-primary name">{{ . }}</h4>
{{ else }}
<h4 class="text-primary name">{{ .Site.Params.name }}</h4>
{{ end }}
<div>
{{ $tags_filtered := slice}}
{{ with .Params.tags }}
{{ range . }}
{{ with .}}
{{ $tags_filtered = $tags_filtered | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ with $tags_filtered }}
{{ range . }}<span class="tag text-muted">{{ . }}</span>{{ end }}
{{ end }}
</div>
</div>
</div>
<!-- 抬头后面内容右平移5px,与头像兼容显得自然 -->
<div style="padding-left: 5px; padding-right: 5px;">
<!-- 文字 -->
<div class="context">
{{ .Content }}
</div>
<!-- 图片 -->
{{ with .Params.pic }}
<img src="{{ . }}" class="img-fluid pic1" alt="Responsive image"></img>
{{ end }}
<!-- 图片集 -->
{{ $pic_set_filtered := slice}}
{{ with .Params.pic_set }}
{{ range . }}
{{ with .}}
{{ $pic_set_filtered = $pic_set_filtered | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ with $pic_set_filtered }}
{{ partial "pic_set.html" (dict "pic_set" .) }}
{{ end }}
{{ $link_link := .Params.link }}
{{ $link_logo := .Params.link_logo }}
{{ $link_text := .Params.link_text }}
{{ with .Params.link }}
{{ partial "link-block.html" (dict "logo" $link_logo "a" $link_link "word" $link_text)}}
{{ end }}
<!-- 附注信息 -->
<div>
<p class="text-black-50 note">
{{ .Date.Format "15:04" }} {{ .Params.note }}
</p>
<i class="far fa-heart" style="float: right; margin-right: 5px; color:#808080"></i>
</div>
</div>
<!-- 分隔线 -->
<hr style="clear: both">
</div>
</div>