Skip to content

Commit

Permalink
Add some more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Nov 22, 2023
1 parent 1213325 commit a6b821b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,41 @@ Gozer expects a certain directory structure in order to build your site correctl

```txt
content/ # Your posts and pages
--- index.md # Will be generated at build/index.html
--- about.md # Will be generated at build/about/index.html
templates/ # Your Go templates
public/ # Any static files
config.xml # Configuration file
```

When running `gozer` in the root directory, your HTML site is built in the `build/` directory.
## Commands

- `gozer` Builds the site into `build/`
- `gozer serve` Builds the site into `build/` and starts an HTTP server on `localhost:8080` serving the `build/` directory.

## Content files

Each file in your `content/` directory should end in `.md` and have front matter specifying the page title:

```md
+++
title = "My page title"
+++

Page content here.
```

The default template for every page is `default.html`. You can override it by setting the `template` variable in your front matter.

```md
+++
title = "My page title"
template = "special-page.html"
+++

Page content here.
```

You can run `gozer serve` to build your site and start an HTTP server serving the `build/` directory locally.

## License

Expand Down
File renamed without changes.
9 changes: 7 additions & 2 deletions example/templates/default.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<!DOCTYPE>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ .Title }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="{{ .SiteUrl }}{{ .Page.URLPath }}">
<link rel="alternate" type="application/rss+xml" href="/feed.xml">
<link rel="sitemap" type="application/xml" href="/sitemap.xml">
</head>
<body>
{{ .Content }}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (p *Page) Dest() string {

d = strings.TrimSuffix(d, ".md")
d = strings.TrimSuffix(d, ".html")
d = strings.TrimSuffix(d, "_index")
d = strings.TrimSuffix(d, "index")

d += "/index.html"
return d
Expand Down

0 comments on commit a6b821b

Please sign in to comment.