1 Star 0 Fork 13

黑鸭子 / Meink

forked from HanJinyan / Meink 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Meink.go 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
HanJinyan 提交于 2020-04-20 23:23 . update
package main
import (
"Meink/app"
"os"
"github.com/urfave/cli/v2"
)
/*
函数(功能)入口,也是命令入口 ---> Meink run ,Meink init ....
*/
func main() {
app := &cli.App{
Name: app.AppName,
Usage: app.AppUsage,
Version: app.AppVersion,
Authors: []*cli.Author{
{Name: app.AppAuthor, Email: app.AppAuthorEmail},
},
Commands: []*cli.Command{
{
Name: "run",
Usage: "运行博客",
Action: func(c *cli.Context) error {
app.ParseGlobalConfigForWrap(true)
app.Build()
app.DynamicMonitoringFile()
app.Serve()
return nil
},
},
{
Name: "init",
Usage: "清空public文件夹(用于调试)",
Action: func(c *cli.Context) error {
app.ParseGlobalConfigForWrap(false)
app.CleanPublic()
return nil
},
},
{
Name: "release",
Usage: "发布版打包到release文件夹",
Action: func(c *cli.Context) error {
app.ParseGlobalConfigForWrap(false)
app.Release()
return nil
},
},
{
Name: "new",
Usage: "创建一篇新文章 --> 创建文章用 new article_name 创建页面用 new page_name page ",
Action: func(c *cli.Context) error {
app.ParseGlobalConfigForWrap(false)
app.NewArticle(c)
app.Sync()
app.Serve()
return nil
},
},
{
Name: "sync",
Usage: "同步文章到服务器",
Action: func(c *cli.Context) error {
app.ParseGlobalConfigForWrap(false)
app.Sync()
app.Serve()
return nil
},
},
},
}
app.Run(os.Args)
}
Go
1
https://gitee.com/Lhx11187/Meink.git
git@gitee.com:Lhx11187/Meink.git
Lhx11187
Meink
Meink
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891