https://github.com/tkdeng/staticweb
Compile HTML and MD template files together into a static html website.
https://github.com/tkdeng/staticweb
html static-site-generator template
Last synced: about 1 year ago
JSON representation
Compile HTML and MD template files together into a static html website.
- Host: GitHub
- URL: https://github.com/tkdeng/staticweb
- Owner: tkdeng
- License: mit
- Created: 2024-12-14T02:14:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-06T18:02:14.000Z (over 1 year ago)
- Last Synced: 2025-02-06T19:22:03.454Z (over 1 year ago)
- Topics: html, static-site-generator, template
- Language: Go
- Homepage:
- Size: 22.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Static Web
Compile HTML and MD template files together into a static html website.
## Installation
```shell
# install the go module
go get github.com/tkdeng/staticweb
# or install the binary
git clone https://github.com/tkdeng/staticweb.git &&\
cd staticweb &&\
make install &&\
cd ../ && rm -r staticweb
# install into /usr/bin
make install
# install locally (with dependencies)
make local
# build without dependency installation
make build
# install dependencies
make deps
# uninstall htmlc
make clean
```
## Golang Usage
```go
import (
"github.com/tkdeng/staticweb"
)
func main(){
// compile directory
err := staticweb.Compile("./src", "./dist")
// compile specific page/directory
err := staticweb.Compile("./src", "./dist", "/about")
// compile and watch for file changes
fileWatcher := staticweb.Live("./src", "./dist", func(err error){
// handle errors
fmt.Println(err)
})
}
```
## Binary Usage
```shell
staticweb ./src --out="./dist"
# optional: run live server
staticweb ./src 3000
staticweb ./src --live # default port: 3000
```