diff options
| author | c-alpha <c-alpha@noreply.codeberg.org> | 2025-03-23 19:31:59 +0100 |
|---|---|---|
| committer | c-alpha <c-alpha@noreply.codeberg.org> | 2025-03-24 15:41:42 +0100 |
| commit | 22b543c0cb9c74ede7e762a16d44173c08c906ab (patch) | |
| tree | fffac26c15cf226a674eaa098b41e37b6f788b14 /hugoista.el | |
| parent | 1769fde5fb9c3a7cccea56c2f730861483d3571c (diff) | |
Fix Issue #3externals/hugoista
Diffstat (limited to 'hugoista.el')
| -rw-r--r-- | hugoista.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/hugoista.el b/hugoista.el index 800bd6a..45f9550 100644 --- a/hugoista.el +++ b/hugoista.el @@ -4,7 +4,7 @@ ;; Author: Alexander Adolf <alexander.adolf@condition-alpha.com>, Thanos Apollo <public@thanosapollo.org> ;; Maintainer: Alexander Adolf <alexander.adolf@condition-alpha.com> -;; Version: 0.2.0 +;; Version: 0.2.1 ;; Package-Requires: ((emacs "24.3") seq) ;; Homepage: https://codeberg.org/c-alpha/hugoista @@ -257,14 +257,18 @@ CONTENT-GROUPS is a grouped list in the format produced by (defun hugoista--hugo-site-dir-p (dir) "Test whether DIR is a Hugo site directory." - (> (length (directory-files dir nil - (rx bos - (or "hugo" "config") - "." - (or "toml" (seq "y" (opt "a") "ml")) - eos) - t)) - 0)) + (let* ((cfgrx (rx bos + (or "hugo" "config") + "." + (or "toml" (seq "y" (opt "a") "ml")) + eos)) + (cfgsubdir (expand-file-name "config" dir)) + (rootcfgs (length (directory-files dir nil cfgrx t))) + (subdircfgs (if (file-directory-p cfgsubdir) + (length (directory-files-recursively cfgsubdir cfgrx + nil nil t)) + 0))) + (> (+ rootcfgs subdircfgs) 0))) ;;;; Interactive Functions |
