Skip to content

Commit

Permalink
Merge pull request #51 from tastytea/draft-preview
Browse files Browse the repository at this point in the history
Added a variable for additional server flags
  • Loading branch information
masasam committed May 6, 2019
2 parents 9aa7fd4 + 46446fc commit 4001717
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 4001717

Please sign in to comment.