Code Monkey home page Code Monkey logo

pugo's People

Contributors

fuxiaohei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pugo's Issues

optimize "copy“ progress

  1. support to copy post,page,media,theme to dest with same url structure
  2. compare file md5
  3. update copy options in meta.toml

Ini Front Matter support

After refactoring, use toml as default front-matter format.

But, I must keep compatible to old ini format, so do following work:

  • meta.ini support
  • language ini support
  • ini front matter for posts and pages

more error-tolerant cases handler

Nee add more error handler to make sure :

Even posts/pages/themes are wrong when parsing, do not stop compiling. just Ignore them.

  1. skip error post or page when reading data

Too many open files

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

Config Tidb's dubu model

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)
}

add more types for model.Tree

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.

  1. add dir type to mark a temp dir node, used for compile file with several levels url
  2. add no content page to describe useful node but not content page, type page-node. It needs supports in page meta and simple page md file.
  3. add Tree.Nodes(),Tree.Dirs(),Tree.Pages(),Tree.Posts() to get nodes with specific type value.

recover 'build' command flags

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

official site update

  • google font is not reachable in China
  • there is no conclusion word to describe pugo in index page, but slogan

请教一下编译的问题

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 enhancement

template upgrade:

  • change template to theme
  • add .toml and .ini file to describe theme

add zip type for downloading, add download file

[fatal] Error :How to fix it ?

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

deploy command, support remote client and cloud service

add new command deploy :

pugo deploy [subcommand] [--options]

support remote client:

  • ftp - username and password required
  • sftp - username and password required. ignore ssh key login
  • git - push, ignore password input

cloud service:

  • AWS
  • Heroku (app engine, not cloud storage)
  • Qiniu

内置服务增加一个md文件编辑功能

举例 在启动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

add json data support to page

  • page.JSON to save json data,
  • add json field in page struct
  • add json setting in page front-matter
  • add simple json api in template function to read page data, or set page.JSON with simple operation api

Embedded theme into pugo

It'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'

发布静态文件到github和coding均无法加载js和css文件

首先感谢开源的博客系统工具,我最近尝试使用您的pugo,部署在vps服务器上没有问题,但当我无论部署在github还是coding上的静态网页,始终无法加载js和css等静态文件,index.html等可正常访问,请您有时间的时候能回复下,谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.