wp-go/app/theme/twentyseventeen/posts/index.gohtml

82 lines
3.7 KiB
Plaintext
Raw Permalink Normal View History

2023-01-15 09:30:13 +00:00
{{template "layout/base" .}}
{{define "content" }}
2023-01-25 18:26:36 +00:00
<div class="site-content-contain">
<div id="content" class="site-content">
{{if .posts}}
<div class="wrap">
<header class="page-header">
2023-02-09 12:49:33 +00:00
{{if .header}}
<h1 class="page-title">{{.header | unescaped}}</h1>
{{else}}
<h2 class="page-title">文章</h2>
{{end}}
2023-01-25 18:26:36 +00:00
</header>
<div id="primary" class="content-area">
<main id="main" class="site-main">
{{ range $k,$v:=.posts}}
2023-04-16 08:37:27 +00:00
<article id="post-{{$v.Id}}" class="{{ $v|postsFn $.calPostClass}}">
2023-03-29 13:58:39 +00:00
{{if $v.IsSticky}}
<svg class="icon icon-thumb-tack" aria-hidden="true" role="img">
<use href="#icon-thumb-tack" xlink:href="#icon-thumb-tack"></use>
</svg>
{{end}}
2023-01-25 18:26:36 +00:00
<header class="entry-header">
<div class="entry-meta">
<span class="screen-reader-text">发布于 </span>
<a href="/p/{{$v.Id}}" rel="bookmark">
<time class="entry-date published" datetime="{{$v.PostDateGmt}}">{{$v.PostDate|dateCh}}
</time><time class="updated" datetime="{{$v.PostModifiedGmt}}">{{$v.PostModified|dateCh}}
</time>
</a>
</div>
<h3 class="entry-title">
<a href="/p/{{$v.Id}}" rel="bookmark">{{$v.PostTitle}}</a>
</h3>
</header>
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
{{if $v.Thumbnail.Path}}
<div class="post-thumbnail">
<a href="/p/{{$v.Id}}" >
<img width="{{$v.Thumbnail.Width}}" height="{{$v.Thumbnail.Height}}" src="{{$v.Thumbnail.Path}}" class="attachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image" alt="{{$v.PostTitle}}" decoding="async" loading="lazy" srcset="{{$v.Thumbnail.Srcset}}" sizes="{{$v.Thumbnail.Sizes}}">
</a>
</div>
{{end}}
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
<!-- .entry-header -->
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
<div class="entry-content">
{{$v.PostContent|unescaped}}
</div>
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
<!-- .entry-content -->
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
</article>
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
<!-- #post-{{$v.Id}} -->
{{end}}
{{template "layout/page" .}}
</main>
<!-- .site-main -->
</div>
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
<aside id="secondary" class="widget-area" aria-label="博客边栏">
{{template "layout/sidebar" .}}
</aside>
</div>
2023-01-15 09:30:13 +00:00
2023-01-25 18:26:36 +00:00
{{else }}
{{template "layout/empty" .}}
{{end}}
</div>
2024-01-14 14:07:16 +00:00
{{template "common/colophon" .}}
2023-01-25 18:26:36 +00:00
</div>
2023-03-03 15:09:39 +00:00
{{end}}