Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a variable for additional server flags #51

Merged
merged 1 commit into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ The browser opens automatically and you can preview the blog on your laptop or d
Even if you run the easy-hugo-preview command many times, only one hugo process will run so do not mind it.
Since the process of hugo running in the laptop or desktop disappears in 300 seconds, you do not have to worry about killing hugo process.

(setq easy-hugo-server-flags "-D")

Set `easy-hugo-server-flags` to `-D` in order to preview drafts.

M-x easy-hugo-publish

You can publish your blog to the server and the browser opens automatically.
Expand Down
9 changes: 7 additions & 2 deletions easy-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
:group 'easy-hugo
:type 'string)

(defcustom easy-hugo-server-flags ""
"Additional flags to pass to hugo server."
:group 'easy-hugo
:type 'string)

(defcustom easy-hugo-preview-url "http://localhost:1313/"
"Preview url of easy-hugo."
:group 'easy-hugo
Expand Down Expand Up @@ -887,9 +892,9 @@ POST-FILE needs to have and extension '.md' or '.org' or '.ad' or '.rst' or '.mm
(if (<= 0.25 (easy-hugo--version))
(setq easy-hugo--server-process
(start-process "hugo-server"
easy-hugo--preview-buffer easy-hugo-bin "server" "--navigateToChanged"))
easy-hugo--preview-buffer easy-hugo-bin "server" "--navigateToChanged" easy-hugo-server-flags))
(setq easy-hugo--server-process
(start-process "hugo-server" easy-hugo--preview-buffer easy-hugo-bin "server")))
(start-process "hugo-server" easy-hugo--preview-buffer easy-hugo-bin "server" easy-hugo-server-flags)))
(while easy-hugo--preview-loop
(if (equal (easy-hugo--preview-status easy-hugo-preview-url) "200")
(progn
Expand Down