3 Star 0 Fork 0

gpress/gpress-geekdoc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
content.html 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
<!-- 查询 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" }}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/gpress/gpress-geekdoc.git
[email protected]:gpress/gpress-geekdoc.git
gpress
gpress-geekdoc
gpress-geekdoc
master

搜索帮助