Another attempt to make this work on emacs 25.x and older

string-trim-right got an optional 2nd argument only in emacs-26:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-26&id=c189986b241cbe79b0e027fa08bba710ac645bb3
master
Kaushal Modi 8 years ago
parent ad9a7eb262
commit d35f53a54a
  1. 5
      ox-hugo.el

@ -75,7 +75,6 @@
(require 'ox-blackfriday)
(require 'ffap) ;For `ffap-url-regexp'
(require 'ob-core) ;For `org-babel-parse-header-arguments'
(require 'subr-x) ;For `string-trim-right'
(defvar ffap-url-regexp) ;Silence byte-compiler
@ -1862,7 +1861,9 @@ INFO is a plist used as a communication channel."
(org-hugo--get-pub-dir info)))
(bundle-name (and bundle-dir ;`bundle-dir'="/foo/bar/" -> `bundle-name'="bar"
(file-name-base
(string-trim-right bundle-dir "/"))))
(if (string-match (concat "\\(?:/\\)\\'") bundle-dir)
(replace-match "" nil nil bundle-dir)
bundle-dir))))
(static-dir (file-truename
(concat
(file-name-as-directory (plist-get info :hugo-base-dir))

Loading…
Cancel
Save