updates on editor
Former-commit-id: 2928727a06a94c0ea87ed821a472ae662df803d1 [formerly 098bc4234803078aba013f6312d179158194fffb] [formerly d2bb681fe62ba87a29b9866e291fb975489cd3fc [formerly 3d25185a557dab1fa529499572c0e6d5bf187ca1]] Former-commit-id: 288ccb95466fbd234d278886800e1d27c54fa8dd [formerly 78c473865b085e97cf435cb230e2afa85559aba0] Former-commit-id: c5dc56f4d6198c9c306c01573e1a1af5f1827c3a
This commit is contained in:
52
caddy/hugo/README.md
Normal file
52
caddy/hugo/README.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# hugo - a caddy plugin
|
||||
|
||||
[](https://caddy.community)
|
||||
|
||||
hugo fills the gap between Hugo and the browser. [Hugo](http://gohugo.io/) is an easy and fast static website generator. This plugin fills the gap between Hugo and the end-user, providing you a web interface to manage the whole website.
|
||||
|
||||
Using this plugin, you won't need to have your own computer to edit posts, neither regenerate your static website, because you can do all of that just through your browser.
|
||||
|
||||
**Requirements:** you need to have the hugo executable in your PATH. You can download it from its [official page](http://gohugo.io).
|
||||
|
||||
### Syntax
|
||||
|
||||
```
|
||||
hugo [directory] [admin] {
|
||||
clean_public [true|false]
|
||||
before_publish command
|
||||
after_publish command
|
||||
flag name [value]
|
||||
# other file manager compatible options
|
||||
}
|
||||
```
|
||||
|
||||
All of the options above are optional.
|
||||
|
||||
* **directory** is the folder where the commands are going to be executed. By default, it is the current working directory. Default: `./`.
|
||||
* **admin** is the path where you will find your administration interface. Default: `/admin`.
|
||||
* **clean_public** sets if the `public` folder should be removed before generating the website again. Default: `true`.
|
||||
* **before_publish** and **after_publish** allow you to set a custom command to be executed before publishing and after publishing a post/page. The placeholder `{path}` can be used and it will be replaced by the file path.
|
||||
* **name** refers to the Hugo available flags. Please use their long form without `--` in the beginning. If no **value** is set, it will be evaluated as `true`.
|
||||
|
||||
In spite of these options, you can also use the [filemanager](https://caddyserver.com/docs/http.filemanager) so you can have more control about what can be acceded, the permissions of each user, and so on.
|
||||
|
||||
This directive should be used with [root](https://caddyserver.com/docs/root), [basicauth](https://caddyserver.com/docs/basicauth) and [errors](https://caddyserver.com/docs/errors) middleware to have the best experience. See the examples to know more.
|
||||
|
||||
### Examples
|
||||
|
||||
If you don't already have an Hugo website, don't worry. This plugin will auto-generate it for you. But that's not everything. It is recommended that you take a look at Hugo [documentation](http://gohugo.io/themes/overview/) to learn more about themes, content types, and so on.
|
||||
|
||||
A simple Caddyfile to use with Hugo static website generator:
|
||||
|
||||
```
|
||||
root public # the folder where Hugo generates the website
|
||||
basicauth /admin user pass # protect the admin area using HTTP basic auth
|
||||
hugo # enable the admin panel
|
||||
```
|
||||
|
||||
### Screenshots
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
Reference in New Issue
Block a user