3 Star 0 Fork 0

gpress/gpress-geekdoc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
bodystart.html 8.27 KB
一键复制 编辑 原始数据 按行查看 历史
springrain 提交于 2025-01-01 13:40 +08:00 . 增加single单页模板
{{ $site := site }}
{{ $treeCategory := treeCategory "* from category WHERE status in (1,2) order by status desc,sortNo desc" }}
{{ $content := selectList "content" "" 1 1000 "id,categoryID,title FROM content WHERE status in (1,2) order by status desc,sortNo desc" }}
{{template "base.html" }}
<main class="container flex flex-even">
<aside class="gdoc-nav">
<nav>
<div class="gdoc-search flex align-center">
<svg class="gdoc-icon gdoc_search">
<use xlink:href="#gdoc_search"></use>
</svg>
<input type="text" id="gdoc-search-input" class="gdoc-search__input" placeholder="Search..." aria-label="Search" maxlength="64" data-site-base-url="https://gitee.com/gpress/gpress-geekdoc" data-site-lang="en" />
<ul id="gdoc-search-results" class="gdoc-search__list"></ul>
</div>
<section class="gdoc-nav--main">
<h2>Navigation</h2>
<ul class="gdoc-nav__list">
{{ range $k,$v := $treeCategory }}
<li>
{{$navCheck:=""}}
{{if eq $k 0}}
{{$navCheck = "checked" }}
{{else if hasPrefix $.Id $v.Id}}
{{$navCheck = "checked" }}
{{end}}
<input type="checkbox" class="gdoc-nav__toggle" id="navtree-{{$v.Id}}" {{$navCheck}} />
{{if $v.HrefURL}}
<label>
<span class="flex">
<a href="{{ hrefURL $v.HrefURL }}" class="gdoc-nav__entry">{{ $v.Name }}</a>
</span>
</label>
{{ else }}
<label for="navtree-{{$v.Id}}" class="flex justify-between align-center">
<span class="flex">{{ $v.Name }}</span>
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_left">
<use xlink:href="#gdoc_keyboard_arrow_left"></use>
</svg>
<svg class="gdoc-icon toggle gdoc_keyboard_arrow_down">
<use xlink:href="#gdoc_keyboard_arrow_down"></use>
</svg>
</label>
{{ end }}
<ul class="gdoc-nav__list">
{{if gt (len $v.Leaf) 0 }}
{{ range $leafk,$leafv := $v.Leaf }}
<li>
<input type="checkbox" class="hidden">
<label>
<span class="flex">
<a href="####" class="gdoc-nav__entry"> {{$leafv.Name}} </a>
</span>
</label>
<ul class="gdoc-nav__list">
{{ range $ck,$cv := $content.Data }}
{{if eq $leafv.Id $cv.CategoryID }}
<li>
<input type="checkbox" class="hidden" />
<label>
<span class="flex">
{{if eq $cv.Id $.Id}}
<a href="{{basePath}}{{ trimPrefixSlash $cv.Id}}" class="gdoc-nav__entry is-active">{{ $cv.Title }}</a>
{{else}}
<a href="{{basePath}}{{ trimPrefixSlash $cv.Id}}" class="gdoc-nav__entry">{{ $cv.Title }}</a>
{{end}}
</span>
</label>
</li>
{{end}}
{{end}}
</ul>
</li>
{{end}}
{{end}}
<!-- 有内容就输出 -->
{{ range $ck,$cv := $content.Data }}
{{if eq $v.Id $cv.CategoryID }}
<li>
<input type="checkbox" class="hidden" />
<label>
<span class="flex">
{{if eq $cv.Id $.Id}}
<a href="{{basePath}}{{ trimPrefixSlash $cv.Id}}" class="gdoc-nav__entry is-active">{{ $cv.Title }}</a>
{{else}}
<a href="{{basePath}}{{ trimPrefixSlash $cv.Id}}" class="gdoc-nav__entry">{{ $cv.Title }}</a>
{{end}}
</span>
</label>
</li>
{{end}}
{{end}}
</ul>
</li>
{{ end }}
</ul>
</section>
<section class="gdoc-nav--more">
<h2>More</h2>
<ul class="gdoc-nav__list">
<li>
<input type="checkbox" class="hidden" />
<label>
<span class="flex">
<svg class="gdoc-icon gdoc_download">
<use xlink:href="#gdoc_download"></use>
</svg>
<a href="https://gitee.com/gpress/gpress-geekdoc/releases" class="gdoc-nav__entry">Releases</a>
</span>
</label>
</li>
<li>
<input type="checkbox" class="hidden" />
<label>
<span class="flex">
<svg class="gdoc-icon gdoc_github">
<use xlink:href="#gdoc_github"></use>
</svg>
<a href="https://gitee.com/gpress/gpress-geekdoc" class="gdoc-nav__entry">View Source</a>
</span>
</label>
</li>
</ul>
</section>
</nav>
</aside>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/gpress/gpress-geekdoc.git
[email protected]:gpress/gpress-geekdoc.git
gpress
gpress-geekdoc
gpress-geekdoc
master

搜索帮助