My working environment is Linux/Ubuntu and Firefox. I have built a simple frontend editor which allows to open the corresponding md-file in the editor directly from the local HUGO website (http://localhost:1313/):
Step 1: Edit Link
The following partial must be inserted into the templates:
edit.html
{{ if .Site.IsServer }}}<div style="float:right;"><a href="file://{{ .Site.Params.adminPath }}{{ .File.Path }}">edit</a></div>{{ end }}
and in config.toml the absolute path to the content folder is added:
[params]
adminPath = "/absolute_path_to/my_project/content/"
Step 2: Configure Firefox
For security reasons, Firefox prohibits opening a file from an external link. The addon https://addons.mozilla.org/de/firefox/addon/local-filesystem-links/ selectively allow this. You have to add http://localhost/*
in the whitelist.
If necessary you have to set in Firefox:
Settings / Files and Applications -> âsimple text documentâ: Gedit (your prefered editor)
After that an âeditâ link is shown (only locally), which opens the corresponding md-file directly in the editor. For other operating systems and working environments this has to be adjusted accordingly.