mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-26 03:21:49 +08:00
实现单页文章功能
This commit is contained in:
31
controllers/BlogController.go
Normal file
31
controllers/BlogController.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package controllers
|
||||
|
||||
|
||||
type BlogController struct{
|
||||
BaseController
|
||||
}
|
||||
|
||||
|
||||
func (c *BlogController) Index() {
|
||||
c.Prepare()
|
||||
|
||||
}
|
||||
|
||||
func (c *BlogController) List() {
|
||||
c.Prepare()
|
||||
}
|
||||
|
||||
//管理后台
|
||||
func (c *BlogController) ManageList() {
|
||||
c.Prepare()
|
||||
}
|
||||
|
||||
//文章设置
|
||||
func (c *BlogController) ManageSetting() {
|
||||
c.Prepare()
|
||||
}
|
||||
|
||||
//文章创建或编辑
|
||||
func (c *BlogController) ManageEdit() {
|
||||
c.Prepare()
|
||||
}
|
||||
@@ -172,11 +172,20 @@ func (c *DocumentController) Read() {
|
||||
docInfo += ";更新于 "
|
||||
docInfo += doc.ModifyTime.Local().Format("2006-01-02 15:04")
|
||||
if strings.TrimSpace(doc.Release) != "" {
|
||||
doc.Release += "<div class=\"wiki-bottom\">文档更新时间: " + doc.ModifyTime.Local().Format("2006-01-02 15:04") + "</div>";
|
||||
doc.Release += "<div class=\"wiki-bottom\">文档更新时间: " + doc.ModifyTime.Local().Format("2006-01-02 15:04") +" 作者:";
|
||||
if docCreator != nil {
|
||||
if docCreator.RealName != "" {
|
||||
doc.Release += docCreator.RealName
|
||||
}else{
|
||||
doc.Release += docCreator.Account
|
||||
}
|
||||
}
|
||||
doc.Release += "</div>"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if c.IsAjax() {
|
||||
var data struct {
|
||||
DocTitle string `json:"doc_title"`
|
||||
|
||||
Reference in New Issue
Block a user