-
Notifications
You must be signed in to change notification settings - Fork 26
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
ftp publishing? #65
Comments
Hi @c-alpha ! |
Thanks for you swift response, and conformation. Will I see the shell script's output anywhere in Emacs? |
Ah, that clarifies. Thanks! I'll have to resort to some log file then. What would you think about feeding the shell script output to a new buffer (for instance Many thanks again! |
I think it's best to do it as your own customization. Lines 1135 to 1152 in baead14
|
I ended up with this: (defconst easy-hugo--github-deploy-buffer "*hugo-github-deploy*")
(defun easy-hugo-github-deploy (&optional show-output)
"Execute `easy-hugo-github-deploy-script' script locate at `easy-hugo-basedir'.
When the optional SHOW-OUTPUT argument is non-nil, the output
from `easy-hugo-github-deploy-script' will be shown in a buffer.
When SHOW-OUTPUT is nil, the buffer will only be shown when
`easy-hugo-github-deploy-script' fails, that is, when it returns
a non-zero exit status."
(interactive "P")
(easy-hugo-with-env
(let ((deployscript (file-truename (expand-file-name
easy-hugo-github-deploy-script
easy-hugo-basedir))))
(unless (executable-find deployscript)
(error "%s do not execute" deployscript))
(let ((progress-buffer (get-buffer-create
easy-hugo--github-deploy-buffer))
ret
deploy-success)
(when show-output
(switch-to-buffer progress-buffer)
(erase-buffer)
(insert (format "Deploying from \"%s\"\n" easy-hugo-basedir)))
(setq ret (call-process
deployscript nil easy-hugo--github-deploy-buffer t)
deploy-success (zerop ret))
(when (and show-output deploy-success)
(insert "Blog deployed"))
(unless deploy-success
(switch-to-buffer easy-hugo--github-deploy-buffer)
(error "%s command does not end normally" deployscript)))
(when (and (not show-output)
(get-buffer easy-hugo--github-deploy-buffer))
(kill-buffer easy-hugo--github-deploy-buffer))
(message "Blog deployed")
(when easy-hugo-url
(browse-url easy-hugo-url))))) If you wanted to use this scheme across all the deploy functions, you would have to collect any prefix argument to the publish commands (i.e. |
First of all: many thanks for making
easy-hugo
! Just what I needed.I have a question on how publishing works. The documentation is extremely terse, to be frank.
My site is on a shared web hosting, and I need to upload it via ftp. Thus, after generating the pages with Hugo, I would need a shell script to be called, which does the ftp upload.
From what I understood, I should probably be using
easy-hugo-github-deploy
and craft my owndeploy.sh
for this scenario?The text was updated successfully, but these errors were encountered: