Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7a17872
refactor: move and rename DirExist to cli and new copyFile helper
mstcl Sep 14, 2025
0dba0f7
refactor: remove DirExists altogether
mstcl Sep 14, 2025
ad170e5
refactor: copyFile to use stream
mstcl Sep 14, 2025
91c103a
feat: func to copy static files to output dir
mstcl Sep 14, 2025
126bef1
feat: implement copy static group
mstcl Sep 14, 2025
37e87de
feat: move css in head to static file
mstcl Sep 14, 2025
00e1ef5
feat: vertical style for wide screens
mstcl Sep 14, 2025
c853462
fix: use path.Join in template instead of string manipulation
mstcl Sep 14, 2025
9cdae5c
fix: include static css
mstcl Sep 14, 2025
b73e86e
lint: log statements and format
mstcl Sep 14, 2025
d5bfa9d
fix: move to Justfile
mstcl Sep 14, 2025
6cc8e7f
refactor: rename cli.Parse to cli.Handler
mstcl Sep 14, 2025
e4a8406
fix: build should not use file
mstcl Sep 14, 2025
96e5211
fix: split cli to use helper + more
mstcl Sep 14, 2025
c4e4706
refactor: sanitize functions
mstcl Sep 14, 2025
dc54b11
refactor: rename listing -> listentry and split helper into more files
mstcl Sep 14, 2025
449168e
refactor: rename idea of files to nodes
mstcl Sep 14, 2025
d22238f
refactor: rename state fields to be more clear
mstcl Sep 14, 2025
092abaf
refactor: rename entry -> node
mstcl Sep 14, 2025
6932cf2
refactor: nodepath, nodegroup, assetpath types
mstcl Sep 14, 2025
c4b5ff1
refactor: rename state fields further
mstcl Sep 14, 2025
2023870
refactor: listentry to nodepathlinks
mstcl Sep 14, 2025
af485b5
refactor: abstract more nodepath operations
mstcl Sep 14, 2025
5da95e4
fix: drop hidden files logic
mstcl Sep 15, 2025
4dca647
feat: no vertical line on tags page
mstcl Sep 15, 2025
fec546a
refactor: links building logic
mstcl Sep 27, 2025
536f2fe
chore: bump version to 3
mstcl Sep 27, 2025
f9d609e
chore: update code to reflect version
mstcl Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export CGO_ENABLED := "0"

# build locally
build: tidy
go build -gcflags "-l" -ldflags "-w -s" .

# run golangci-lint
lint:
golangci-lint run

# run go mod tidy
tidy:
go mod tidy

# install to user path
install: tidy build
go install -gcflags "-l" -ldflags "-w -s" .

# run go test
test:
go test ./...
17 changes: 0 additions & 17 deletions Makefile

This file was deleted.

25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ there are a few differences:
- Wikilinks are supported thanks to abhinav's
[extension](https://github.com/abhinav/goldmark-wikilink).
- No CSS framework.
- Comes as a small standalone binary (~9M). No need for a runtime.
- Comes as a small standalone binary (~9M).
No need for a runtime.
- Some visual tweaks (personal preference).
- The atom feed contains only dated entries.
- Flatter file structure (no "rooting" every page). Let webservers handle the
routing and beautifying.
- Flatter file structure (no "rooting" every page).
Let webservers handle the routing and beautifying.

## Installation

```bash
$ go install github.com/mstcl/pher/v2@v2.3.2
$ go install github.com/mstcl/pher/v3@v3.0.0
```

## Usage
Expand Down Expand Up @@ -66,8 +67,8 @@ footer:

## Frontmatter

pher reads in frontmatter in YAML format. Available fields and default values
are:
pher reads in frontmatter in YAML format.
Available fields and default values are:

```yaml
---
Expand All @@ -82,6 +83,7 @@ toc: false # Render a table of contents for this entry
showHeader: true # Show the header (title, description, tags, date)
layout: "list" # Available values: "grid", "list", "log". Only effective for index.md files.
---

```

## To do
Expand Down Expand Up @@ -112,9 +114,9 @@ layout: "list" # Available values: "grid", "list", "log". Only effective for ind

### Editing templates

pher embeds the templates in `web/templates` with go:embed. This means pher can
run as a standalone binary. Unfortunately, to modify the templates, we have to
recompile.
pher embeds the templates in `web/templates` with go:embed.
This means pher can run as a standalone binary.
Unfortunately, to modify the templates, we have to recompile.

### Removing html extension

Expand All @@ -130,8 +132,9 @@ location / {
}
```

Additionally, setting `keepExtension: false` will strip ".html" from href
links. This might be necessary if you use weird browsers that break redirects.
Additionally, setting `keepExtension:
false` will strip ".html" from href links.
This might be necessary if you use weird browsers that break redirects.

## Credits

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/mstcl/pher/v2
module github.com/mstcl/pher/v3

go 1.22.2

Expand Down
7 changes: 7 additions & 0 deletions internal/assetpath/assetpath.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package assetpath

type AssetPath string

func (ap AssetPath) String() string {
return string(ap)
}
57 changes: 0 additions & 57 deletions internal/checks/checks.go

This file was deleted.

Loading