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

87 lines
3.9 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">
<h2 class="page-title">文章</h2>
</header>
<div id="primary" class="content-area">
<main id="main" class="site-main">
{{if .header}}
<header class="page-header">
<h1 class="page-title">
{{if .search}}
{{.header}}
{{else}}
{{.header |unescaped}}
{{end}}
</h1>
</header>
2023-01-15 09:30:13 +00:00
{{end}}
2023-01-25 18:26:36 +00:00
{{ range $k,$v:=.posts}}
<article id="post-{{$v.Id}}"
class="post-{{$v.Id}} post {{if $v.Thumbnail.Path}}has-post-thumbnail{{end}} type-post status-publish format-standard hentry category">
2023-01-15 09:30:13 +00:00
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}}
{{end}}
</div>
</div>