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

137 lines
8.1 KiB
Plaintext
Raw Permalink Normal View History

2022-09-18 14:06:27 +00:00
{{template "layout/base" .}}
2022-09-21 13:49:14 +00:00
2022-09-18 14:06:27 +00:00
{{define "content"}}
2022-09-19 09:39:00 +00:00
{{ if .post.PostContent}}
2023-01-25 18:26:36 +00:00
{{if .post.Thumbnail.Path}}
<div class="single-featured-image-header">
<img width="{{.post.Thumbnail.OriginAttachmentData.Width}}" height="{{.post.Thumbnail.OriginAttachmentData.Height}}" src="{{.post.Thumbnail.Path}}" class="attachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image" alt="{{.post.PostTitle}}" decoding="async" loading="lazy" srcset="{{.post.Thumbnail.Srcset}}" sizes="{{.post.Thumbnail.Sizes}}">
</div>
{{end}}
<div class="site-content-contain">
<div id="content" class="site-content">
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main">
<article id="post-{{.post.Id}}" class="post-{{.post.Id}} post type-post status-publish format-standard hentry {{if .post.Thumbnail.Path}}has-post-thumbnail{{end}} category-uncategorized">
2022-09-19 09:39:00 +00:00
2023-01-25 18:26:36 +00:00
<header class="entry-header">
<div class="entry-meta">
<span class="posted-on">
<span class="screen-reader-text">发布于</span>
<a href="/p/{{.post.Id}}" rel="bookmark">
<time class="entry-date published" datetime="{{.post.PostDateGmt}}">{{.post.PostDate|dateCh}}
</time>
<time class="updated" datetime="{{.post.PostModifiedGmt}}">{{.post.PostModified|dateCh}}
</time>
</a>
</span>
<span class="byline">
<span class="author vcard">
<a class="url fn n" href="/p/author/{{.user.UserLogin}}">{{.user.UserLogin}}</a>
</span>
</span>
</div>
<h1 class="entry-title">{{.post.PostTitle}}</h1>
</header><!-- .entry-header -->
<div class="entry-content">
{{.post.PostContent|unescaped}}
</div><!-- .entry-content -->
<footer class="entry-footer">
<span class="cat-tags-links">
{{if .post.CategoriesHtml}}
<span class="cat-links">
<svg class="icon icon-folder-open" aria-hidden="true" role="img"> <use href="#icon-folder-open" xlink:href="#icon-folder-open"></use> </svg>
<span class="screen-reader-text">分类 </span>
{{.post.CategoriesHtml|unescaped}}
</span>
{{end}}
{{if .post.TagsHtml}}
<span class="tags-links">
<svg class="icon icon-hashtag" aria-hidden="true" role="img"> <use href="#icon-hashtag" xlink:href="#icon-hashtag"></use> </svg>
<span class="screen-reader-text">标签 </span>
{{.post.TagsHtml|unescaped}}
</span>
{{end}}
</span>
</footer>
<!-- .entry-footer -->
</article><!-- #post-1 -->
{{ if .showComment}}
<div id="comments" class="comments-area">
{{ if gt .post.CommentCount 0}}
<h2 class="comments-title">“{{.post.PostTitle}}”的{{.post.CommentCount}}个回复 </h2>
2023-01-25 18:26:36 +00:00
<ol class="comment-list">
{{.comments|unescaped}}
</ol>
{{end}}
{{if eq .post.CommentStatus "open"}}
{{template "respond" .}}
<!-- #respond -->
2023-01-25 18:26:36 +00:00
{{else}}
<p class="no-comments">评论已关闭。</p>
{{end}}
</div><!-- .comments-area -->
{{end}}
<nav class="navigation post-navigation" aria-label="文章">
<h2 class="screen-reader-text">文章导航</h2>
<div class="nav-links">
{{if gt .prev.Id 0}}
<div class="nav-previous">
<a href="/p/{{.prev.Id}}" rel="prev">
<span class="screen-reader-text">上一篇文章</span>
<span aria-hidden="true" class="nav-subtitle">上一篇</span>
<span class="nav-title">
<span class="nav-title-icon-wrapper">
<svg class="icon icon-arrow-left" aria-hidden="true" role="img"> <use href="#icon-arrow-left" xlink:href="#icon-arrow-left"></use>
</svg>
</span> {{.prev.PostTitle}}
</span>
</a>
2023-01-25 18:26:36 +00:00
</div>
{{end}}
{{if gt .next.Id 0}}
<div class="nav-next">
<a href="/p/{{.next.Id}}" rel="next">
<span class="screen-reader-text" aria-hidden="true">下一篇文章</span>
<span aria-hidden="true" class="nav-subtitle">下一篇</span>
<span class="nav-title">{{.next.PostTitle}}
<span class="nav-title-icon-wrapper">
<svg class="icon icon-arrow-right" aria-hidden="true" role="img"> <use href="#icon-arrow-right" xlink:href="#icon-arrow-right"></use> </svg>
</span>
</span>
</a>
2023-01-25 18:26:36 +00:00
</div>
{{end}}
</div>
</nav>
</main><!-- .site-main -->
2022-09-19 09:39:00 +00:00
</div>
2023-01-25 18:26:36 +00:00
<aside id="secondary" class="widget-area" aria-label="博客边栏">
{{template "layout/sidebar" .}}
</aside>
</div>
</div>
2022-09-19 09:39:00 +00:00
</div>
2023-01-25 18:26:36 +00:00
2022-09-19 09:39:00 +00:00
{{else}}
{{template "layout/empty"}}
{{end }}
2022-09-18 14:06:27 +00:00
{{end}}
2023-01-25 18:26:36 +00:00
{{ define "footerx"}}
2022-09-21 13:49:14 +00:00
<script src='/wp-includes/js/comment-reply.min.js?ver=6.0.2' id='comment-reply-js'></script>
2023-01-25 18:26:36 +00:00
{{end}}