filebrowser/caddy/hugo
Fábio Ferreira 22fbc7d02d Better experience (#166)
* Making directory navigation prettier

* Small improvements

* Rice-box


Former-commit-id: fff23ea4a4aeff16e650571b1e50ac556db55e64 [formerly 1395942367664c8b8cac5181a44089e54002b061] [formerly d9afe630bc365cc227da4f18f76a98fe3f1843d9 [formerly 39a6b7de3c]]
Former-commit-id: 1d53b93648223d539d24512ea62b0d8ef3e07531 [formerly ee5428b9cd7a1cb3105f5dc42d4dce99584faf66]
Former-commit-id: 2a5352afece16ce936f736cc5a2edcdb208f8671
2017-07-28 11:22:44 +01:00
..
assets Use varutils instead 2017-07-28 09:59:31 +01:00
README.md update readmes 2017-07-18 15:58:38 +01:00
hugo.go Use varutils instead 2017-07-28 09:59:31 +01:00
rice-box.go Better experience (#166) 2017-07-28 11:22:44 +01:00
setup.go Use fileutils instead 2017-07-27 21:39:23 +01:00
utils.go Some updates 2017-07-12 15:28:35 +01:00

README.md

hugo - a caddy plugin

community

hugo fills the gap between Hugo and the browser. Hugo 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. It is an implementation of hacdias/filemanager library.

Requirements: you need to have the hugo executable in your PATH. You can download it from its official page.

Get Started

To start using this plugin you just need to go to the download Caddy page and choose http.hugo in the directives section. For further information on how Caddy works refer to its documentation.

The default credentials are admin for both the user and the password. It is highy recommended to change them after logging in for the first time and to use HTTPS. You can create more users and define their own permissions using the web interface.

Syntax

hugo [directory] [admin] {
    database path
}
  • directory is the path, relative or absolute to the directory of your Hugo files. Defaults to ./.
  • admin is the URL path where you will access the admin interface. Defaults to /admin.
  • path is the database path where the settings will be stored. By default, the settings will be stored on .caddy folder.

Database

By default the database will be stored on .caddy directory, in a sub-directory called hugo. Each file name is an hash of the combination of the host and the base URL.

If you don't set a database path, you will receive a warning like this:

[WARNING] A database is going to be created for your File Manager instace at ~/.caddy/hugo/xxx.db. It is highly recommended that you set the 'database' option to 'xxx.db'

Why? If you don't set a database path and you change the host or the base URL, your settings will be reseted. So it is highly recommended to set this option.

When you set a relative path, such as xxxxxxxxxx.db, it will always be relative to .caddy/hugo directory. Although, you may also use an absolute path if you wish to store the database in other place.

Examples

Manage the current working directory's Hugo website at /admin and display the public folder to the user.

root public
hugo {
  database myinstance.db
}

Manage the Hugo website located at /var/www/mysite at /admin and display the public folder to the user.

root /var/www/mysite/public
hugo /var/www/mysite {
  database myinstance.db
}

Manage the Hugo website located at /var/www/mysite at /private and display the public folder to the user.

root /var/www/mysite/public
hugo /var/www/mysite /private {
  database myinstance.db
}

Known Issues

If you are having troubles handling large files you might need to check out the timeouts plugin, which can be used to change the default HTTP Timeouts.