mirror of
https://github.com/yv1ing/MollyBlog.git
synced 2025-09-16 14:53:45 +08:00
new: Added new tab pages and related modules
This commit is contained in:
@@ -35,3 +35,5 @@ site:
|
|||||||
archive:
|
archive:
|
||||||
title: Archive
|
title: Archive
|
||||||
number: 10
|
number: 10
|
||||||
|
tag:
|
||||||
|
number: 10
|
||||||
@@ -4,6 +4,7 @@ type mPost struct {
|
|||||||
TocTitle string `yaml:"toc_title"`
|
TocTitle string `yaml:"toc_title"`
|
||||||
RecentPost mRecentPost `yaml:"recent_post"`
|
RecentPost mRecentPost `yaml:"recent_post"`
|
||||||
Archive mArchive `yaml:"archive"`
|
Archive mArchive `yaml:"archive"`
|
||||||
|
Tag mTag `yaml:"tag"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type mRecentPost struct {
|
type mRecentPost struct {
|
||||||
@@ -15,3 +16,7 @@ type mArchive struct {
|
|||||||
Title string `yaml:"title"`
|
Title string `yaml:"title"`
|
||||||
Number int `yaml:"number"`
|
Number int `yaml:"number"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type mTag struct {
|
||||||
|
Number int `yaml:"number"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,9 +20,14 @@ type MApp struct {
|
|||||||
lute *lute.Lute
|
lute *lute.Lute
|
||||||
engine *gin.Engine
|
engine *gin.Engine
|
||||||
|
|
||||||
Posts []*model.MPost
|
Posts []*model.MPost
|
||||||
TaggedPosts []*model.MPost
|
|
||||||
CategorizedPosts []*model.MPost
|
Tags map[string]string
|
||||||
|
TagsCount map[string]int
|
||||||
|
Categories map[string]string
|
||||||
|
CategoriesCount map[string]int
|
||||||
|
TaggedPosts map[string][]*model.MPost
|
||||||
|
CategorizedPosts map[string][]*model.MPost
|
||||||
|
|
||||||
SrcFiles []model.MFileInfo
|
SrcFiles []model.MFileInfo
|
||||||
}
|
}
|
||||||
@@ -56,7 +61,34 @@ func NewMApp(cfg *config.MConfig) *MApp {
|
|||||||
Port: cfg.Port,
|
Port: cfg.Port,
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
|
|
||||||
|
Tags: make(map[string]string),
|
||||||
|
TagsCount: make(map[string]int),
|
||||||
|
|
||||||
|
Categories: make(map[string]string),
|
||||||
|
CategoriesCount: make(map[string]int),
|
||||||
|
|
||||||
|
TaggedPosts: make(map[string][]*model.MPost),
|
||||||
|
CategorizedPosts: make(map[string][]*model.MPost),
|
||||||
|
|
||||||
lute: lute.New(),
|
lute: lute.New(),
|
||||||
engine: engine,
|
engine: engine,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// resetStorage before each update, delete the cache
|
||||||
|
func (ma *MApp) resetStorage() {
|
||||||
|
ma.Posts = nil
|
||||||
|
ma.Tags = nil
|
||||||
|
ma.Categories = nil
|
||||||
|
ma.CategoriesCount = nil
|
||||||
|
ma.TaggedPosts = nil
|
||||||
|
ma.CategorizedPosts = nil
|
||||||
|
ma.SrcFiles = nil
|
||||||
|
|
||||||
|
ma.Tags = make(map[string]string)
|
||||||
|
ma.TagsCount = make(map[string]int)
|
||||||
|
ma.Categories = make(map[string]string)
|
||||||
|
ma.CategoriesCount = make(map[string]int)
|
||||||
|
ma.TaggedPosts = make(map[string][]*model.MPost)
|
||||||
|
ma.CategorizedPosts = make(map[string][]*model.MPost)
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package mApp
|
package mApp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"html/template"
|
"html/template"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -24,6 +25,7 @@ func (ma *MApp) IndexHandler(ctx *gin.Context) {
|
|||||||
recentPosts = append(recentPosts, tmpPost)
|
recentPosts = append(recentPosts, tmpPost)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return some basic information
|
||||||
resData := gin.H{
|
resData := gin.H{
|
||||||
"site_info": gin.H{
|
"site_info": gin.H{
|
||||||
"logo": ma.Config.MSite.Info.Logo,
|
"logo": ma.Config.MSite.Info.Logo,
|
||||||
@@ -48,6 +50,8 @@ func (ma *MApp) PostHandler(ctx *gin.Context) {
|
|||||||
var success bool
|
var success bool
|
||||||
var html string
|
var html string
|
||||||
var realPost model.MPost
|
var realPost model.MPost
|
||||||
|
|
||||||
|
// traverse to find the corresponding post, read its HTML file, and inject it into the template
|
||||||
for _, post := range ma.Posts {
|
for _, post := range ma.Posts {
|
||||||
if post.HtmlHash == postHash {
|
if post.HtmlHash == postHash {
|
||||||
file, err := os.OpenFile(post.HtmlPath, os.O_RDONLY, 0644)
|
file, err := os.OpenFile(post.HtmlPath, os.O_RDONLY, 0644)
|
||||||
@@ -101,6 +105,85 @@ func (ma *MApp) PostHandler(ctx *gin.Context) {
|
|||||||
ctx.HTML(http.StatusOK, "post.html", resData)
|
ctx.HTML(http.StatusOK, "post.html", resData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ma *MApp) TagHandler(ctx *gin.Context) {
|
||||||
|
tagHash := ctx.Param("hash")
|
||||||
|
tagName := ma.Tags[tagHash]
|
||||||
|
|
||||||
|
// paging logic processing
|
||||||
|
page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1"))
|
||||||
|
size := ma.Config.MSite.Post.Tag.Number
|
||||||
|
|
||||||
|
var prePage, curPage, nxtPage, allPage int
|
||||||
|
allPage = (len(ma.TaggedPosts[tagHash]) + size - 1) / size
|
||||||
|
|
||||||
|
if allPage > 0 {
|
||||||
|
if page <= 0 {
|
||||||
|
curPage = 1
|
||||||
|
} else if page > allPage {
|
||||||
|
curPage = allPage
|
||||||
|
} else {
|
||||||
|
curPage = page
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
curPage = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
prePage = curPage - 1
|
||||||
|
nxtPage = curPage + 1
|
||||||
|
|
||||||
|
if prePage <= 0 {
|
||||||
|
prePage = curPage
|
||||||
|
}
|
||||||
|
|
||||||
|
if nxtPage > allPage {
|
||||||
|
nxtPage = allPage
|
||||||
|
}
|
||||||
|
|
||||||
|
// generate tagged posts
|
||||||
|
start := (curPage - 1) * size
|
||||||
|
offset := curPage * size
|
||||||
|
|
||||||
|
var taggedPosts []model.MPost
|
||||||
|
var tagList [][]interface{}
|
||||||
|
if start >= 0 {
|
||||||
|
for i := start; i < utils.Min(len(ma.TaggedPosts[tagHash]), offset); i++ {
|
||||||
|
tmpPost := *ma.TaggedPosts[tagHash][i]
|
||||||
|
tmpPost.Date = strings.Split(tmpPost.Date, " ")[0]
|
||||||
|
taggedPosts = append(taggedPosts, tmpPost)
|
||||||
|
}
|
||||||
|
|
||||||
|
for tag, num := range ma.TagsCount {
|
||||||
|
tagList = append(tagList, []interface{}{tag, num})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tagListJson, _ := json.Marshal(tagList)
|
||||||
|
resData := gin.H{
|
||||||
|
"site_info": gin.H{
|
||||||
|
"logo": ma.Config.MSite.Info.Logo,
|
||||||
|
"title": ma.Config.MSite.Info.Title,
|
||||||
|
"author": ma.Config.MSite.Info.Author,
|
||||||
|
"language": ma.Config.MSite.Info.Language,
|
||||||
|
"copyright": template.HTML(ma.Config.MSite.Info.Copyright),
|
||||||
|
},
|
||||||
|
"menu": ma.Config.MSite.Menu,
|
||||||
|
"page_info": gin.H{
|
||||||
|
"pre_page": prePage,
|
||||||
|
"cur_page": curPage,
|
||||||
|
"nxt_page": nxtPage,
|
||||||
|
"all_page": allPage,
|
||||||
|
},
|
||||||
|
"tagged_post": gin.H{
|
||||||
|
"posts": taggedPosts,
|
||||||
|
"tag_name": tagName,
|
||||||
|
"tag_hash": tagHash,
|
||||||
|
"tag_list": string(tagListJson),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.HTML(http.StatusOK, "tag.html", resData)
|
||||||
|
}
|
||||||
|
|
||||||
func (ma *MApp) ArchiveHandler(ctx *gin.Context) {
|
func (ma *MApp) ArchiveHandler(ctx *gin.Context) {
|
||||||
page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1"))
|
page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1"))
|
||||||
size := ma.Config.MSite.Post.Archive.Number
|
size := ma.Config.MSite.Post.Archive.Number
|
||||||
@@ -170,6 +253,7 @@ func (ma *MApp) ArchiveHandler(ctx *gin.Context) {
|
|||||||
|
|
||||||
func (ma *MApp) UpdateBlogHandler(ctx *gin.Context) {
|
func (ma *MApp) UpdateBlogHandler(ctx *gin.Context) {
|
||||||
var err error
|
var err error
|
||||||
|
ma.resetStorage()
|
||||||
|
|
||||||
err = ma.loadMarkdownFiles()
|
err = ma.loadMarkdownFiles()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -101,7 +101,11 @@ func (ma *MApp) parseMarkdowns() error {
|
|||||||
Hash: tagHash,
|
Hash: tagHash,
|
||||||
})
|
})
|
||||||
|
|
||||||
ma.TaggedPosts = append(ma.TaggedPosts, &post)
|
ma.Tags[tagHash] = tag
|
||||||
|
ma.TagsCount[tag] += 1
|
||||||
|
ma.TaggedPosts[tagHash] = append(ma.TaggedPosts[tagHash], &post)
|
||||||
|
|
||||||
|
model.SortPostsByDate(ma.TaggedPosts[tagHash])
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, category := range post.Categories {
|
for _, category := range post.Categories {
|
||||||
@@ -111,7 +115,11 @@ func (ma *MApp) parseMarkdowns() error {
|
|||||||
Hash: categoryHash,
|
Hash: categoryHash,
|
||||||
})
|
})
|
||||||
|
|
||||||
ma.CategorizedPosts = append(ma.CategorizedPosts, &post)
|
ma.Categories[categoryHash] = category
|
||||||
|
ma.CategoriesCount[category] += 1
|
||||||
|
ma.CategorizedPosts[categoryHash] = append(ma.CategorizedPosts[categoryHash], &post)
|
||||||
|
|
||||||
|
model.SortPostsByDate(ma.CategorizedPosts[categoryHash])
|
||||||
}
|
}
|
||||||
|
|
||||||
// free the raw tag and category slice
|
// free the raw tag and category slice
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ func (ma *MApp) loadRoutes() {
|
|||||||
ma.engine.GET("/", ma.IndexHandler)
|
ma.engine.GET("/", ma.IndexHandler)
|
||||||
ma.engine.GET("/archive", ma.ArchiveHandler)
|
ma.engine.GET("/archive", ma.ArchiveHandler)
|
||||||
ma.engine.GET("/post/:hash", ma.PostHandler)
|
ma.engine.GET("/post/:hash", ma.PostHandler)
|
||||||
|
ma.engine.GET("/tag/:hash", ma.TagHandler)
|
||||||
|
|
||||||
ma.engine.PUT("/update", ma.UpdateBlogHandler)
|
ma.engine.PUT("/update", ma.UpdateBlogHandler)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,3 +95,10 @@ a:hover {
|
|||||||
.main-menu-link {
|
.main-menu-link {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.special-info-area {
|
||||||
|
height: 340px;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: var(--secondary-text-color) 1px dashed;
|
||||||
|
}
|
||||||
@@ -4,6 +4,18 @@ pre {
|
|||||||
border: var(--secondary-text-color) 1px dashed;
|
border: var(--secondary-text-color) 1px dashed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr, th, td {
|
||||||
|
height: 30px;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px var(--secondary-text-color) solid;
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
.post-menu {
|
.post-menu {
|
||||||
max-width: 1000px;
|
max-width: 1000px;
|
||||||
}
|
}
|
||||||
|
|||||||
53
templates/default/assets/css/tag.css
Normal file
53
templates/default/assets/css/tag.css
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
.tagged-name {
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagged-post-item {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagged-post-item-wrap {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagged-post-item-date {
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagged-post-item-date {
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagged-post-pagination-item {
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-statistics {
|
||||||
|
width: 60%;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-word-cloud-canvas {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
opacity: 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-word-cloud-canvas * {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 992px) {
|
||||||
|
.tag-statistics {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
1243
templates/default/assets/js/lib/wordcloud2.js
Normal file
1243
templates/default/assets/js/lib/wordcloud2.js
Normal file
File diff suppressed because it is too large
Load Diff
12
templates/default/assets/js/tag.js
Normal file
12
templates/default/assets/js/tag.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
const tagWordCloudCanvas = document.getElementById('tag-word-cloud-canvas');
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
list: JSON.parse(tagList),
|
||||||
|
weightFactor: 20,
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
click: (item) => {
|
||||||
|
console.log(item[0], item[1]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
WordCloud(tagWordCloudCanvas, options);
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<div class="container p-3">
|
<div class="container p-3">
|
||||||
<div class="row pt-lg-3">
|
<div class="row pt-lg-3">
|
||||||
<h4 class="history-post-title"># {{ .history_post.title }}</h4>
|
<h4 class="history-post-title"># {{ .history_post.title }}</h4>
|
||||||
<div class="col-12 col-md-8">
|
<div class="col-12 col-lg-9">
|
||||||
<div>
|
<div>
|
||||||
{{ range $i, $v := .history_post.posts }}
|
{{ range $i, $v := .history_post.posts }}
|
||||||
<div class="row history-post-item">
|
<div class="row history-post-item">
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<a href="/post/{{ $v.HtmlHash }}">{{ $v.Title }}</a>
|
<a href="/post/{{ $v.HtmlHash }}">{{ $v.Title }}</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col d-none d-lg-block history-post-item-wrap">
|
<div class="col d-none d-md-block history-post-item-wrap">
|
||||||
<span style="color: var(--secondary-text-color)">
|
<span style="color: var(--secondary-text-color)">
|
||||||
[
|
[
|
||||||
{{ range $i2, $v2 := $v.TagHashes }}
|
{{ range $i2, $v2 := $v.TagHashes }}
|
||||||
@@ -71,6 +71,27 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- special info -->
|
||||||
|
<div class="col-lg-3 d-none d-lg-grid carousel slide special-info-area" id="special-info-area-controls" data-bs-ride="carousel">
|
||||||
|
<div class="carousel-indicators">
|
||||||
|
<button type="button" data-bs-target="#special-info-area-controls" data-bs-slide-to="0" aria-label="Slide 1" class="active" aria-current="true" ></button>
|
||||||
|
<button type="button" data-bs-target="#special-info-area-controls" data-bs-slide-to="1" aria-label="Slide 2"></button>
|
||||||
|
<button type="button" data-bs-target="#special-info-area-controls" data-bs-slide-to="2" aria-label="Slide 3"></button>
|
||||||
|
</div>
|
||||||
|
<div class="carousel-inner">
|
||||||
|
<div class="carousel-item active">
|
||||||
|
1111
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
2222
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
3333
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row pt-3 pt-lg-4">
|
<div class="row pt-3 pt-lg-4">
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<div class="container p-3">
|
<div class="container p-3">
|
||||||
<div class="row pt-lg-3">
|
<div class="row pt-lg-3">
|
||||||
<h4 class="recent-post-title"># {{ .recent_post.title }}</h4>
|
<h4 class="recent-post-title"># {{ .recent_post.title }}</h4>
|
||||||
<div class="col-12 col-md-8">
|
<div class="col-12 col-lg-9">
|
||||||
<div>
|
<div>
|
||||||
{{ range $i, $v := .recent_post.posts }}
|
{{ range $i, $v := .recent_post.posts }}
|
||||||
<div class="row recent-post-item">
|
<div class="row recent-post-item">
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<a href="/post/{{ $v.HtmlHash }}">{{ $v.Title }}</a>
|
<a href="/post/{{ $v.HtmlHash }}">{{ $v.Title }}</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col d-none d-lg-block recent-post-item-wrap">
|
<div class="col d-none d-md-block recent-post-item-wrap">
|
||||||
<span style="color: var(--secondary-text-color)">
|
<span style="color: var(--secondary-text-color)">
|
||||||
[
|
[
|
||||||
{{ range $i2, $v2 := $v.TagHashes }}
|
{{ range $i2, $v2 := $v.TagHashes }}
|
||||||
@@ -70,6 +70,27 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- special info -->
|
||||||
|
<div class="col-lg-3 d-none d-lg-grid carousel slide special-info-area" id="special-info-area-controls" data-bs-ride="carousel">
|
||||||
|
<div class="carousel-indicators">
|
||||||
|
<button type="button" data-bs-target="#special-info-area-controls" data-bs-slide-to="0" aria-label="Slide 1" class="active" aria-current="true" ></button>
|
||||||
|
<button type="button" data-bs-target="#special-info-area-controls" data-bs-slide-to="1" aria-label="Slide 2"></button>
|
||||||
|
<button type="button" data-bs-target="#special-info-area-controls" data-bs-slide-to="2" aria-label="Slide 3"></button>
|
||||||
|
</div>
|
||||||
|
<div class="carousel-inner">
|
||||||
|
<div class="carousel-item active">
|
||||||
|
1111
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
2222
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
3333
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
104
templates/default/html/tag.html
Normal file
104
templates/default/html/tag.html
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
{{ define "tag.html" }}
|
||||||
|
|
||||||
|
<html lang="{{ .site_info.language }}">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>{{ .site_info.title }}</title>
|
||||||
|
<link rel="icon" type="image/x-icon" href="{{ .site_info.logo }}"/>
|
||||||
|
<link rel="stylesheet" href="../assets/css/lib/fontawesome.all.min.css">
|
||||||
|
<link rel="stylesheet" href="../assets/css/lib/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="../assets/css/global.css">
|
||||||
|
<link rel="stylesheet" href="../assets/css/tag.css">
|
||||||
|
<script src="../assets/js/lib/jquery.min.js"></script>
|
||||||
|
<script src="../assets/js/lib/bootstrap.min.js"></script>
|
||||||
|
<script src="../assets/js/lib/fontawesome.all.min.js"></script>
|
||||||
|
<script src="../assets/js/lib/wordcloud2.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="root-container">
|
||||||
|
<!-- header -->
|
||||||
|
<div class="container p-3">
|
||||||
|
<div class="row pt-3 pt-md-4 pt-lg-5">
|
||||||
|
<div class="col main-logo">
|
||||||
|
<div class="main-logo-img" style="background-image: url('{{ .site_info.logo }}');"></div>
|
||||||
|
<div class="main-logo-txt">
|
||||||
|
{{ .site_info.title }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- menu -->
|
||||||
|
<div class="container p-3">
|
||||||
|
<div class="row pt-lg-3">
|
||||||
|
<div class="col mx-auto post-menu">
|
||||||
|
{{ range $i, $v := .menu.Items }}
|
||||||
|
<i class="{{ $v.Icon }} m-icon"></i>
|
||||||
|
<a class="main-menu-link" href="{{ $v.Url }}"> {{ $v.Name }} </a>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- body -->
|
||||||
|
<div class="container p-3">
|
||||||
|
<div class="row pt-lg-3">
|
||||||
|
<h4 class="tagged-name"># {{ .tagged_post.tag_name }}</h4>
|
||||||
|
<div class="col-12 col-md-8">
|
||||||
|
<div>
|
||||||
|
{{ range $i, $v := .tagged_post.posts }}
|
||||||
|
<div class="row tagged-post-item">
|
||||||
|
<div class="col tagged-post-item-wrap">
|
||||||
|
<span class="d-none d-md-inline tagged-post-item-date">{{ $v.Date }} | </span>
|
||||||
|
<span>
|
||||||
|
<a href="/post/{{ $v.HtmlHash }}">{{ $v.Title }}</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row pt-3 pt-lg-4">
|
||||||
|
<div class="col-12 col-md-8">
|
||||||
|
<div class="tagged-post-pagination">
|
||||||
|
<span class="tagged-post-pagination-item">
|
||||||
|
<a href="/tag/{{ .tagged_post.tag_hash }}?page={{ .page_info.pre_page }}">
|
||||||
|
<
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<span class="tagged-post-pagination-item">
|
||||||
|
{{ .page_info.cur_page }} / {{ .page_info.all_page }}
|
||||||
|
</span>
|
||||||
|
<span class="tagged-post-pagination-item">
|
||||||
|
<a href="/tag/{{ .tagged_post.tag_hash }}?page={{ .page_info.nxt_page }}">
|
||||||
|
>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- tag word cloud -->
|
||||||
|
<div class="tag-statistics" id="tag-statistics">
|
||||||
|
<div class="tag-word-cloud-canvas" id="tag-word-cloud-canvas"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- footer -->
|
||||||
|
<div class="footer">
|
||||||
|
{{ .site_info.copyright }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const tagList = "{{ .tagged_post.tag_list }}";
|
||||||
|
</script>
|
||||||
|
<script src="../assets/js/tag.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
Reference in New Issue
Block a user