代码拉取完成,页面将自动刷新
<!-- 查询 content -->
{{ $contentSQL := "* FROM content WHERE id=? and status<3 order by status desc, sortNo desc" }}
{{ if eq .userType 1}}
{{ $contentSQL ="* FROM content WHERE id=? order by sortNo desc" }}
{{end}}
{{ $content := selectOne "content" $contentSQL .UrlPathParam }}
{{ $prevContent := selectOne "content" "id,title FROM content WHERE status in (1,2) and sortNo < ? order by sortNo desc " $content.SortNo }}
{{ $nextContent := selectOne "content" "id,title FROM content WHERE status in (1,2) and sortNo > ? order by sortNo asc " $content.SortNo }}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>{{ $content.Title }}</title>
<meta name="description" content="{{ $content.Description }}" />
<meta name="keyword" content="{{ $content.Keyword }}" />
{{template "bodystart.html" $content }}
<div class="gdoc-page">
<article class="gdoc-markdown gdoc-markdown__align--left">
<h1>ToC</h1>
<p>{{ safeHTML $content.Summary }}</p>
<div class="gdoc-toc gdoc-toc__level--3">
<nav id="TableOfContents">
{{ safeHTML $content.Toc }}
</nav>
</div>
{{ safeHTML $content.Content }}
</article>
<div class="gdoc-page__footer flex flex-wrap justify-between">
{{if $prevContent.Id }}
<span class="gdoc-page__nav">
<a class="gdoc-page__nav--prev flex align-center" href="{{basePath}}post/{{$prevContent.Id}}" title="{{$prevContent.Title}}">
<i class="gdoc-icon">gdoc_arrow_left_alt</i>{{$prevContent.Title}}
</a>
</span>
{{end}}
{{if $nextContent.Id }}
<span class="gdoc-page__nav">
<a class="gdoc-page__nav--next flex align-center" href="{{basePath}}post/{{$nextContent.Id}}" title="{{$nextContent.Title}}">{{$nextContent.Title}}<i class="gdoc-icon">gdoc_arrow_right_alt</i>
</a>
</span>
{{end}}
</div>
</div>
<script src="{{basePath}}js/search-9719be99.bundle.min.js"></script>
{{template "bodyend.html" }}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。