Giter Site home page Giter Site logo

dannyvankooten / gozer Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 2.0 40 KB

Fast, opinionated and simple static site generator in a single static binary.

License: MIT License

Go 74.26% XSLT 24.09% HTML 1.65%
golang static-site-generator website blog-engine cms content-management-system markdown markdown-to-html site-generator

gozer's Issues

`-h` or `--help` flag output differs from normal `gozer` help output

Hi, when running gozer -h or gozer --help I get:

Usage of ./gozer:
  -c string
    	(default "config.toml")
  -config string
    	(default "config.toml")
  -r string
    	
  -root string

Which seems to be an automatically generated help text. When I run gozer (no arguments) I get a more useful help text:

Gozer - a fast & simple static site generator

Usage: gozer [OPTIONS] <COMMAND>

Commands:
	build	Deletes the output directory if there is one and builds the site
	serve	Builds the site and starts an HTTP server on http://localhost:8080
	new     Creates a new site structure in the given directory

Options:
	-r, --root <ROOT> Directory to use as root of project (default: .)
	-c, --config <CONFIG> Path to configuration file (default: config.toml)

go version: go1.21.4 linux/amd64

Are you accepting contributions? If so, I would be happy to take a stab at implementing this if its something you would like added.

P.S. I saw your reddit post about this project and thought it looked cool! I'm working on setting up my blog using gozer and have enjoyed it so far <3

panic in `copyFile()` after removing `public/`

Hi Danny,

I found that gozer build panics after removing the public/ directory

$ gozer build
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x8402fe]

goroutine 1 [running]:
main.copyFile({0x8f3c44, 0x6}, {0x0, 0x0}, {0x8f28f1, 0x5})
        /home/user/code/gozer/fs.go:48 +0x5e
main.buildSite.copyDirRecursively.func2({0x8f3c44, 0x6}, {0x0, 0x0}, {0x4fa025?, 0x8f3c44?})
        /home/user/code/gozer/fs.go:79 +0x7d
path/filepath.WalkDir({0x8f3c44, 0x6}, 0xc00033fcb8)
        /home/user/go/pkg/mod/golang.org/[email protected]/src/path/filepath/path.go:530 +0x4a
main.copyDirRecursively(...)
        /home/user/code/gozer/fs.go:77
main.buildSite({0x0, 0x0}, {0x8f8fa6, 0xb})
        /home/user/code/gozer/gozer.go:508 +0x829
main.main()
        /home/user/code/gozer/gozer.go:415 +0x3d2

Steps to reproduce:

$ gozer new   # Create new gozer project
$ rm -r public/   # Remove `public/`
$ gozer build   # panics

This seems to be related to the WalkDirFunc callback in filepath.WalkDir(). The docs describe how the err argument in WalkDirFunc can be non-nil in some cases.

I stumbled upon this after accidentally removing my public directory so definitely user error on this one haha! Happy to post a PR with a fix to log the error instead of panicking if that would be alright.

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.