Skip to content

Commit 51ddc75

Browse files
committed
global: gofmt and add badges
1 parent 8dc646b commit 51ddc75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+12239
-10099
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Papillon
2+
3+
[![Build Status](https://travis-ci.org/gogank/papillon.svg?branch=master)](https://travis-ci.org/gogank/papillon)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/gogank/papillon)](https://goreportcard.com/report/github.com/gogank/papillon)
5+
[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/gogank/papillon)
6+
[![](https://img.shields.io/badge/docker-supported-blue.svg)](https://godoc.org/github.com/gogank/papillon)
7+
[![Libraries.io for GitHub](https://img.shields.io/librariesio/github/gogank/papillon.svg)](https://libraries.io/github/gogank/papillon)
8+
[![GitHub stars](https://img.shields.io/github/stars/gogank/papillon.svg?style=social&label=Stars)]()
9+
10+
A distributed static blog publish tool
11+
212
IPFS网络上的静态博客发布系统
313

14+
415
## 准备工作
516
[安装IPFS节点](https://ipfs.io/docs/install/)
617

cmd/generate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var generateCmd = &cobra.Command{
1616
Short: "Genrate a static blog website.",
1717
Long: `Genrate the whole static blog website.`,
1818
Run: func(cmd *cobra.Command, args []string) {
19-
if len(args) != 0{
19+
if len(args) != 0 {
2020
fmt.Println("Errors:unnecessary args in cmd!")
2121
fmt.Println("Example:")
2222
fmt.Println("papi gen")
@@ -32,4 +32,4 @@ var generateCmd = &cobra.Command{
3232
panic(err.Error())
3333
}
3434
},
35-
}
35+
}

cmd/new.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ var newCmd = &cobra.Command{
1616
Short: "New file in a static blog website.",
1717
Long: `New a markdown file in local static blog website.`,
1818
Run: func(cmd *cobra.Command, args []string) {
19-
if len(args) < 1{
19+
if len(args) < 1 {
2020
fmt.Println("Errors:Please specific the markdown file path!")
2121
fmt.Println("Example:")
2222
fmt.Println("papi new mypost")
2323
return
2424
}
25-
handler.NewPost(args[0],"config.toml")
25+
handler.NewPost(args[0], "config.toml")
2626
fmt.Println("Create articles successfully!")
2727
},
28-
}
28+
}

cmd/publish.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var publishCmd = &cobra.Command{
1717
Short: "Publish a static blog website to ipfs.",
1818
Long: `Publish a new static blog website to ipfs`,
1919
Run: func(cmd *cobra.Command, args []string) {
20-
if len(args) != 0{
20+
if len(args) != 0 {
2121
fmt.Println("Errors: unnecessary args in cmd!")
2222
fmt.Println("Example:")
2323
fmt.Println("papi pub")
@@ -27,8 +27,8 @@ var publishCmd = &cobra.Command{
2727
fmt.Println("| _ \\ _ _| |__ | (_)___| |__ (_)_ __ __ _")
2828
fmt.Println("| |_) | | | | '_ \\| | / __| '_ \\| | '_ \\ / _` |")
2929
fmt.Println("| __/| |_| | |_) | | \\__ \\ | | | | | | | (_| |")
30-
fmt.Println("|_| \\__,_|_.__/|_|_|___/_| |_|_|_| |_|\\__, |")
31-
fmt.Println(" |___/")
30+
fmt.Println("|_| \\__,_|_.__/|_|_|___/_| |_|_|_| |_|\\__, |")
31+
fmt.Println(" |___/")
3232
pub := publish.NewPublishImpl()
3333
var flag bool
3434
flag = false
@@ -43,14 +43,14 @@ var publishCmd = &cobra.Command{
4343
}
4444
}
4545
}()
46-
hash,err := pub.PublishCmd()
46+
hash, err := pub.PublishCmd()
4747
flag = true
4848
fmt.Print(">>100%")
4949
fmt.Println()
5050
if err != nil {
5151
fmt.Println("Error: publish failed", err.Error())
5252
return
5353
}
54-
fmt.Println("The url is https://ipfs.io/ipns/"+hash)
54+
fmt.Println("The url is https://ipfs.io/ipns/" + hash)
5555
},
56-
}
56+
}

cmd/root.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ var RootCmd = &cobra.Command{
1111
Long: `A distribution static blog publish system based on ipfs in Go.
1212
Complete documentation is unavailable yes ;`,
1313
Run: func(cmd *cobra.Command, args []string) {
14-
fmt.Println(" ____ _ _ _");
15-
fmt.Println("| _ \\ __ _ _ __ (_) | | ___ _ __")
16-
fmt.Println("| |_) / _` | '_ \\| | | |/ _ \\| '_ \\")
17-
fmt.Println("| __/ (_| | |_) | | | | (_) | | | |")
18-
fmt.Println("|_| \\__,_| .__/|_|_|_|\\___/|_| |_|")
19-
fmt.Println("|_|")
14+
fmt.Println(" ____ _ _ _");
15+
fmt.Println("| _ \\ __ _ _ __ (_) | | ___ _ __")
16+
fmt.Println("| |_) / _` | '_ \\| | | |/ _ \\| '_ \\")
17+
fmt.Println("| __/ (_| | |_) | | | | (_) | | | |")
18+
fmt.Println("|_| \\__,_| .__/|_|_|_|\\___/|_| |_|")
19+
fmt.Println("|_|")
2020
fmt.Println("Welcome to Papillon;")
2121
fmt.Println("------------------------")
2222
cmd.Help()
2323
fmt.Println("------------------------")
2424
fmt.Println("2017 (c) GoGank Team")
2525
},
26-
}
26+
}

0 commit comments

Comments
 (0)