wp-go/app/theme/twentyseventeen/posts/detail.gohtml
2023-05-04 20:37:06 +08:00

135 lines
7.9 KiB
Plaintext

{{template "layout/base" .}}
{{define "content"}}
{{ if and (.post) (gt .post.Id 0) }}
{{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|postsFn .calPostClass}}">
<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>
<ol class="comment-list">
{{.comments|unescaped}}
</ol>
{{end}}
{{if eq .post.CommentStatus "open"}}
{{template "respond" .}}
<!-- #respond -->
{{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>
</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>
</div>
{{end}}
</div>
</nav>
</main><!-- .site-main -->
</div>
<aside id="secondary" class="widget-area" aria-label="博客边栏">
{{template "layout/sidebar" .}}
</aside>
</div>
</div>
{{template "layout/colophon"}}
</div>
{{else}}
{{template "layout/empty"}}
{{end }}
{{end}}