go-xiaohei / pugo Goto Github PK
View Code? Open in Web Editor NEWa static site generator & deployer
Home Page: http://pugo.io
License: MIT License
a static site generator & deployer
Home Page: http://pugo.io
License: MIT License
不管theme怎么指定,生成的都是default风格的。
post
,page
,media
,theme
to dest
with same url structureIt need getting-start document to show how to install, run and deploy step by step
After refactoring, use toml
as default front-matter format.
But, I must keep compatible to old ini
format, so do following work:
meta.ini
supportPlease fix this issue ...
I saw the admin theme is locked? How to unlock it?
Nee add more error handler to make sure :
Even posts/pages/themes are wrong when parsing, do not stop compiling. just Ignore them.
Add setting to disable post or page functions in meta file,
If post functions are disabled, do not read and compile posts.
I have about 524 markdown files in post/. When I run hugo server
, it notice me below:
INFO|09-20 15:48:02.3506|Build|Source|source
INFO|09-20 15:48:02.4872|Theme|theme/default
INFO|09-20 15:48:02.5082|Assemble|Done
INFO|09-20 15:48:03.5709|Done|1349 Pages|1220.5ms
INFO|09-20 15:48:03.5709|Server|Start|0.0.0.0:9899
INFO|09-20 15:48:03.5709|Watch|Start
2016/09/20 15:48:04 http: Accept error: accept tcp [::]:9899: accept: too many open files; retrying in 5ms
2016/09/20 15:48:04 http: Accept error: accept tcp [::]:9899: accept: too many open files; retrying in 10ms
2016/09/20 15:48:04 http: Accept error: accept tcp [::]:9899: accept: too many open files; retrying in 20ms
2016/09/20 15:48:09 http: Accept error: accept tcp [::]:9899: accept: too many open files; retrying in 40ms
2016/09/20 15:48:09 http: Accept error: accept tcp [::]:9899: accept: too many open files; retrying in 80ms
2016/09/20 15:48:09 http: Accept error: accept tcp [::]:9899: accept: too many open files; retrying in 160ms
做的挺好的
I was trying to deploy my puGo blog to github pages but pugo --dest
is not known command. What might be the problem since all other pugo commands are executing as expected.
In the tidb, default model is always open. It's will listen in address localhost:8888
// Debug is the switch for pprof. If Debug is true, tidb will start with pprof on.
Debug = true
// start pprof handlers
if Debug {
go http.ListenAndServe(PprofAddr, nil)
}
now model.Tree
only put compiled html into tree nodes with proper type. But it can't provide full nodes tree sometimes. So need mark more types to get proper tree nodes with proper type.
dir
type to mark a temp dir node, used for compile file with several levels urlno content page
to describe useful node but not content page, type page-node
. It needs supports in page meta and simple page md file.Tree.Nodes()
,Tree.Dirs()
,Tree.Pages()
,Tree.Posts()
to get nodes with specific type value.里还还有Gogs的名字
In 0.9.0
, PuGo use flags:
--dest
, --source
, --theme
, --nowatch
But 0.9.x
, change to --from
and --to
Must recover to old version for friendly usage
make sure 0.9.0 and 0.8.x template runnable
migrate from
Because of tidb heavily development, maybe it needs to export database and import old data to new schema storage.
add tags.html to show all tags as a list with tag post count number
看 v1
branch 已经更新到 1.0.0,但是没有放出 binary file ,需要自己编译
然后我在树莓派上用 docker 尝试着编译了一下,步骤基本是按照 .travis.yml
来的
容器内 go 的版本是 1.7.5
编译完之后在容器里尝试是可以运行的
bash-4.3# ./pugo_arm version
PuGo version : 1.0.0
Release Date : 2017-03-03 13:16
Golang version : go1.7.5
Assets version : 2017-03-03 11:21
bash-4.3# ./pugo_arm build
=== start build ===
--- reading...
language : en
Authors : 1
Navigators : 3
post files : 1
page files : 1
language files : en,zh-cn
theme files : 9
post tags : 1
--- compiling...
created pages : 8
copied files : 9
=== finish build ===
total in 100.124752ms
bash-4.3# ./pugo_arm asset
convert file post/welcome.md
convert file page/about.md
convert file theme/archive.html
convert file theme/embed/analytics.html
convert file theme/embed/comment.html
convert file theme/embed/footer.html
convert file theme/embed/header.html
convert file theme/embed/meta.html
convert file theme/page.html
convert file theme/post.html
convert file theme/posts.html
convert file theme/static/css/bootstrap.min.css
convert file theme/static/css/prism.css
convert file theme/static/css/style.css
convert file theme/static/favicon.ico
convert file theme/static/js/bootstrap.min.js
convert file theme/static/js/jquery-2.1.4.min.js
convert file theme/static/js/prism.min.js
convert file theme/static/robots.txt
convert file theme/theme.toml
convert file lang/en.toml
convert file lang/i18n.toml
convert file lang/zh-cn.toml
convert file media/golang.png
convert file meta.toml
write assets app/asset/asset.go
write ratio 37.5%
write size 139 KB
bash-4.3# ./pugo_arm init
error: meta.toml is found.
you had created a site here.
bash-4.3# ./test.sh
? github.com/go-xiaohei/pugo [no test files]
? github.com/go-xiaohei/pugo/app/asset [no test files]
? github.com/go-xiaohei/pugo/app/cmd [no test files]
? github.com/go-xiaohei/pugo/app/compile [no test files]
ok github.com/go-xiaohei/pugo/app/helper/gravatar 0.010s coverage: 100.0% of statements
ok github.com/go-xiaohei/pugo/app/helper/i18n 0.020s coverage: 77.8% of statements
ok github.com/go-xiaohei/pugo/app/helper/markdown 0.013s coverage: 100.0% of statements
ok github.com/go-xiaohei/pugo/app/helper/pager 0.013s coverage: 100.0% of statements
? github.com/go-xiaohei/pugo/app/helper/printer [no test files]
ok github.com/go-xiaohei/pugo/app/helper/watcher 8.019s coverage: 92.7% of statements
ok github.com/go-xiaohei/pugo/app/helper/ziper 0.022s coverage: 85.7% of statements
? github.com/go-xiaohei/pugo/app/model [no test files]
ok github.com/go-xiaohei/pugo/app/model/author 0.011s coverage: 100.0% of statements
ok github.com/go-xiaohei/pugo/app/model/base 0.013s coverage: 100.0% of statements
ok github.com/go-xiaohei/pugo/app/model/index 0.033s coverage: 95.8% of statements
ok github.com/go-xiaohei/pugo/app/model/node 0.027s coverage: 40.2% of statements
ok github.com/go-xiaohei/pugo/app/model/page 0.050s coverage: 79.9% of statements
? github.com/go-xiaohei/pugo/app/model/post [no test files]
? github.com/go-xiaohei/pugo/app/model/theme [no test files]
? github.com/go-xiaohei/pugo/app/model/third [no test files]
? github.com/go-xiaohei/pugo/app/vars [no test files]
但到了 Host 上就提示:
$ ./pugo_arm version
-bash: ./pugo_arm: No such file or directory
不知道是不是少安装了什么依赖,因为编译完的文件比 release 里 0.10.0 的 arm 可执行 文件 要小了不少 ( 上面的pugo_arm
是我编译的 ):
$ ls -la | grep "arm"
-rwxr-xr-x 1 root root 9141721 Mar 3 21:15 pugo_arm
-rwxr-xr-x 1 pirate pirate 14595160 Apr 8 2016 pugo_linux_arm
template upgrade:
template
to theme
add zip type for downloading, add download file
F:\pugo>pugo server
INFO[11-03|17:46:59] _Boot.ServerContext.Start
H:/golang/src/github.com/pingcap/tidb/bootstrap.go:122 (0x78c69d)
mustExecute: debug.PrintStack()
H:/golang/src/github.com/pingcap/tidb/bootstrap.go:109 (0x78c554)
initUserTable: ("::1", "root", "", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y
", "Y", "Y", "Y");`)
H:/golang/src/github.com/pingcap/tidb/bootstrap.go:100 (0x78c448)
bootstrap: initUserTable(s)
H:/golang/src/github.com/pingcap/tidb/session.go:472 (0x796c14)
CreateSession: bootstrap(s)
H:/golang/src/github.com/pingcap/tidb/driver.go:153 (0x78d34c)
(_sqlDriver).Open: sess, err := CreateSession(store)
c:/go/src/database/sql/sql.go:710 (0x897308)
(_DB).conn: ci, err := db.driver.Open(db.dsn)
c:/go/src/database/sql/sql.go:491 (0x895ffd)
(_DB).Ping: dc, err := db.conn(cachedOrNewConn)
H:/golang/src/github.com/go-xorm/xorm/session.go:1411 (0x6c6fff)
(_Session).Ping: return session.DB().Ping()
H:/golang/src/github.com/go-xorm/xorm/engine.go:192 (0x68467b)
(_Engine).Ping: return session.Ping()
H:/golang/src/github.com/go-xiaohei/pugo/src/service/bootstrap.go:75 (0x4c9ade)
(_BootstrapService).Init: if err := core.Db.Ping(); err != nil {
H:/golang/src/github.com/go-xiaohei/pugo/src/boot/install.go:31 (0x468369)
(_BootstrapService).Init-fm: if err := service.Call(service.Bootstrap.In
it, opt); err != nil {
H:/golang/src/github.com/go-xiaohei/pugo/src/service/result.go:101 (0x4dd46a)
CallResult: res, err := fn(v)
H:/golang/src/github.com/go-xiaohei/pugo/src/service/result.go:82 (0x4dd1e5)
Call: res, err := CallResult(fn, v)
H:/golang/src/github.com/go-xiaohei/pugo/src/boot/server.go:67 (0x461c2e)
serverListener: if err := service.Call(service.Bootstrap.Init, opt); err
!= nil {
H:/golang/src/github.com/go-xiaohei/pugo/src/boot/server.go:40 (0x46168b)
(_serverContext).Start: sc.ln = serverListener(sc.ctx)
H:/golang/src/github.com/go-xiaohei/pugo/src/core/signal.go:31 (0x491938)
Start: s.Start()
H:/golang/src/github.com/go-xiaohei/pugo/src/boot/server.go:24 (0x468226)
glob.func1: core.Start(sc)
H:/golang/src/github.com/codegangsta/cli/command.go:131 (0x486b6c)
Command.Run: c.Action(context)
H:/golang/src/github.com/codegangsta/cli/app.go:175 (0x48345d)
(_App).Run: return c.Run(context)
H:/golang/src/github.com/codegangsta/cli/app.go:186 (0x48398b)
(*App).RunAndExitOnError: if err := a.Run(os.Args); err != nil {
H:/golang/src/github.com/go-xiaohei/pugo/src/boot/boot.go:48 (0x46064a)
Run: core.App.RunAndExitOnError()
H:/golang/src/github.com/go-xiaohei/pugo/pugo.go:8 (0x40105b)
main: boot.Run()
c:/go/src/runtime/proc.go:111 (0x42eece)
main: main_main()
c:/go/src/runtime/asm_amd64.s:1696 (0x45e9f1)
goexit: BYTE $0x90 // NOP
2015/11/03 17:46:59 bootstrap.go:123: [fatal] Error: key already exist
add new command deploy
:
pugo deploy [subcommand] [--options]
support remote client:
cloud service:
举例 在启动pugo server 时,访问/admin 可以打开一个编辑页面
该页面会列出source/post文件夹中所有的md文件,点击对应的md文件即可编辑保存
同时增加一个新增按钮,点击后即刻生成一个新的md文件供编写文章保存。
编辑器推荐editor.md提供实时预览功能。
这方法已经弃用了。。。
pugo build
DEPRECATED cli.App.RunAndExitOnError. This is an error in the application. Please contact the distributor of this application if this is not you. See https://github.com/urfave/cli/blob/master/CHANGELOG.md#deprecated-cli-app-runandexitonerror
INFO|08-01 00:19:19.8126|Build|Start
INFO|08-01 00:19:19.8127|Build|Source|source
INFO|08-01 00:19:19.8268|Build|Theme|theme/default
INFO|08-01 00:19:19.9417|Build|8 Pages
INFO|08-01 00:19:19.9418|Build|Done|1|129.3ms
DEPRECATED Action signature. Must be `cli.ActionFunc`. This is an error in the application. Please contact the distributor of this application if this is not you. See https://github.com/urfave/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature
model.Tree.Node(url)
model.Tree.Parent()
& model.Tree.Parents()
(load all parents to top)Permalink make many things confusing, drop it
page.JSON
to save json data,page.JSON
with simple operation apiIt's better embedded default theme(s) into pugo. And the path for the project could be only
.
|- lang/
|- page/
|- post/
`- meta.toml
without the top level 'source', and drop empty path 'dest'
documentation of <!--more-->
it'not a real requirement to support multi-language in posts but in pages.
So make pages international , try to finish http://pugo.io in multi-language
因为众所周知的原因,很多Google的外部库,go get失败。
首先感谢开源的博客系统工具,我最近尝试使用您的pugo,部署在vps服务器上没有问题,但当我无论部署在github还是coding上的静态网页,始终无法加载js和css等静态文件,index.html等可正常访问,请您有时间的时候能回复下,谢谢
如标题
because that posts are in order of post datetime, it may break order.
Need document it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.