diff --git a/docs/config.md b/docs/config.md new file mode 100644 index 0000000..f23bf4c --- /dev/null +++ b/docs/config.md @@ -0,0 +1,15 @@ +# How to configure GoBlog + +Most settings for GoBlog (still) have to be configured using a YAML configuration file. See `example-config.yaml` for the available options. It's recommended to just set the settings you really need. There are defaults for most settings. Some settings can be configured using a web UI (with the path of `/settings`). + +## Sections + +You can add, remove or update sections and the default section using the web UI. + +Sections can have a title, description (with support for markdown) and a path template which gets used when creating a new post without a pre-setted path. The syntax for the path template is gets parsed as a [Go template](https://pkg.go.dev/text/template#pkg-overview). Available variables are: `.Section`, `.Slug`, `.Year`, `.Month`, `.Day` and `.BlogPath`. + +Example for the path template: + +``` +{{printf \"/%v/%v\" .Section .Slug}} +``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 56a7cc1..c891504 100644 --- a/docs/index.md +++ b/docs/index.md @@ -56,5 +56,6 @@ Here's an (incomplete) list of features: - [How to install and run GoBlog](./install.md) - [How to build GoBlog](./build.md) - [How to use GoBlog](./usage.md) +- [How to configure GoBlog](./config.md) - [Administration paths](./admin-paths.md) - [GoBlog's storage system](./storage.md) \ No newline at end of file diff --git a/example-config.yml b/example-config.yml index 05c3dc5..32c4c8f 100644 --- a/example-config.yml +++ b/example-config.yml @@ -181,17 +181,6 @@ blogs: title: My awesome blog # Blog title description: My awesome blog description # Blog description pagination: 10 # Number of posts per page - # Sections - defaultsection: micro # Default section - sections: - posts: # Section code - title: Posts # Section title - pathtemplate: "{{printf \"/%v/%v\" .Section .Slug}}" # Template to generate post paths (available: .Section, .Slug, .Year, .Month, .Day, .BlogPath (useful for blogs on sub-paths)) - micro: - title: Micro - description: "You can also use **Markdown** here." # Section description, can also use Markdown - pathtemplate: "{{printf \"/%v/%02d/%02d/%v\" .Section .Year .Month .Slug}}" - showFull: true # Show full post content instead of just the summary on index pages # Taxonomies taxonomies: - name: tags # Code of taxonomy (used via post parameters)