Commit f0e0594

Eric Bower  ·  2023-09-01 11:19:08 -0400 EDT
parent 8f24577
doc: update readme
2 files changed,  +26, -21
+6, -1
......@@ -1,6 +1,11 @@
11 # pgit
22
3-A static site generator for git
3+A static site generator for git.
4+
5+This golang binary will generate a commit log, files, and references based
6+on a git repository and the provided revisions.
7+
8+It will only generate a commit log and files for the provided revisions.
49
510 # usage
611
+20, -20
......@@ -123,13 +123,13 @@ type TreeItem struct {
123123 Name string
124124 Path string
125125 URL template.URL
126- CommitID string
126+ CommitID string
127127 CommitURL template.URL
128128 Summary string
129129 When string
130- Author *git.Signature
130+ Author *git.Signature
131131 Entry *git.TreeEntry
132- Crumbs []*Breadcrumb
132+ Crumbs []*Breadcrumb
133133 }
134134
135135 type DiffRender struct {
......@@ -193,7 +193,7 @@ type LogPageData struct {
193193 type FilePageData struct {
194194 *PageData
195195 Contents template.HTML
196- Item *TreeItem
196+ Item *TreeItem
197197 }
198198
199199 type CommitPageData struct {
......@@ -421,7 +421,7 @@ func (c *Config) writeHTMLTreeFile(pageData *PageData, treeItem *TreeItem) strin
421421 Data: &FilePageData{
422422 PageData: pageData,
423423 Contents: template.HTML(contents),
424- Item: treeItem,
424+ Item: treeItem,
425425 },
426426 Subdir: getFileURL(pageData.RevData, d),
427427 })
......@@ -684,8 +684,8 @@ func (c *Config) writeRepo() *BranchOutput {
684684 }
685685
686686 type TreeRoot struct {
687- Path string
688- Items []*TreeItem
687+ Path string
688+ Items []*TreeItem
689689 Crumbs []*Breadcrumb
690690 }
691691
......@@ -698,8 +698,8 @@ type TreeWalker struct {
698698 }
699699
700700 type Breadcrumb struct {
701- Text string
702- URL template.URL
701+ Text string
702+ URL template.URL
703703 IsLast bool
704704 }
705705
......@@ -716,8 +716,8 @@ func (tw *TreeWalker) calcBreadcrumbs(curpath string) []*Breadcrumb {
716716 )
717717
718718 crumbs := make([]*Breadcrumb, len(parts)+1)
719- crumbs[0] = &Breadcrumb {
720- URL: rootURL,
719+ crumbs[0] = &Breadcrumb{
720+ URL: rootURL,
721721 Text: tw.PageData.Repo.RepoName,
722722 }
723723
......@@ -725,9 +725,9 @@ func (tw *TreeWalker) calcBreadcrumbs(curpath string) []*Breadcrumb {
725725 for idx, d := range parts {
726726 crumbs[idx+1] = &Breadcrumb{
727727 Text: d,
728- URL: template.URL(filepath.Join(getFileBaseDir(tw.PageData.RevData), cur, d, "index.html")),
728+ URL: template.URL(filepath.Join(getFileBaseDir(tw.PageData.RevData), cur, d, "index.html")),
729729 }
730- if idx == len(parts) - 1 {
730+ if idx == len(parts)-1 {
731731 crumbs[idx+1].IsLast = true
732732 }
733733 cur = filepath.Join(cur, d)
......@@ -740,11 +740,11 @@ func (tw *TreeWalker) NewTreeItem(entry *git.TreeEntry, curpath string, crumbs [
740740 typ := entry.Type()
741741 fname := filepath.Join(curpath, entry.Name())
742742 item := &TreeItem{
743- Size: toPretty(entry.Size()),
744- Name: entry.Name(),
745- Path: fname,
746- Entry: entry,
747- URL: template.URL(getFileURL(tw.PageData.RevData, fname)),
743+ Size: toPretty(entry.Size()),
744+ Name: entry.Name(),
745+ Path: fname,
746+ Entry: entry,
747+ URL: template.URL(getFileURL(tw.PageData.RevData, fname)),
748748 Crumbs: crumbs,
749749 }
750750
......@@ -834,8 +834,8 @@ func (tw *TreeWalker) walk(tree *git.Tree, curpath string) {
834834 }
835835
836836 tw.tree <- &TreeRoot{
837- Path: fpath,
838- Items: treeEntries,
837+ Path: fpath,
838+ Items: treeEntries,
839839 Crumbs: crumbs,
840840 }
841841