|
@@ -652,25 +652,24 @@ project folder. There is also a check to detect first the presence of a config
|
|
|
file before attmepting to invoke hugo to give a sensible message.
|
|
file before attmepting to invoke hugo to give a sensible message.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
-(after! org
|
|
|
|
|
- (defun chicken/hugo-goto-draft ()
|
|
|
|
|
- "Opens an ivy-powered search helper to quickly jump on a draft
|
|
|
|
|
|
|
+(defun chicken/hugo-goto-draft ()
|
|
|
|
|
+ "Opens an ivy-powered search helper to quickly jump on a draft
|
|
|
if the current project is the root of a Hugo-powered site."
|
|
if the current project is the root of a Hugo-powered site."
|
|
|
- (interactive)
|
|
|
|
|
- (if (file-exists-p! "config.toml" (projectile-project-root))
|
|
|
|
|
- (ivy-read "Open a draft: " (chicken/list-hugo-drafts)
|
|
|
|
|
- :require-match t
|
|
|
|
|
- :history 'chicken/hugo-goto-history
|
|
|
|
|
- :action (lambda (file)
|
|
|
|
|
- (with-ivy-window
|
|
|
|
|
- (when file
|
|
|
|
|
- (let*
|
|
|
|
|
- ((root (projectile-project-root))
|
|
|
|
|
- (full-file (concat root file)))
|
|
|
|
|
- (find-file full-file)))))
|
|
|
|
|
- :unwind #'counsel-delete-process
|
|
|
|
|
- :caller 'chicken/hugo-goto-draft)
|
|
|
|
|
- (message "The current project doesn't have a config.toml in the root directory."))))
|
|
|
|
|
|
|
+ (interactive)
|
|
|
|
|
+ (if (file-exists-p! "config.toml" (projectile-project-root))
|
|
|
|
|
+ (ivy-read "Open a draft: " (chicken/list-hugo-drafts)
|
|
|
|
|
+ :require-match t
|
|
|
|
|
+ :history 'chicken/hugo-goto-history
|
|
|
|
|
+ :action (lambda (file)
|
|
|
|
|
+ (with-ivy-window
|
|
|
|
|
+ (when file
|
|
|
|
|
+ (let*
|
|
|
|
|
+ ((root (projectile-project-root))
|
|
|
|
|
+ (full-file (concat root file)))
|
|
|
|
|
+ (find-file full-file)))))
|
|
|
|
|
+ :unwind #'counsel-delete-process
|
|
|
|
|
+ :caller 'chicken/hugo-goto-draft)
|
|
|
|
|
+ (message "The current project doesn't have a config.toml in the root directory.")))
|
|
|
#+END_SRC
|
|
#+END_SRC
|
|
|
** PROJ Convert GIF to videos
|
|
** PROJ Convert GIF to videos
|
|
|
I like GIFs, that's a fact. But neither your bandwidth nor your CPU will
|
|
I like GIFs, that's a fact. But neither your bandwidth nor your CPU will
|