Skip to content

Commit

Permalink
Feat: Enable excluding files from site-map.
Browse files Browse the repository at this point in the history
  • Loading branch information
teesloane committed Jul 17, 2020
1 parent 8dced1d commit bfaefc4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion clojure/src/firn/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@
output
(assoc output (processed-file :path-web) processed-file))
new-site-map-item (merge
;; remove metadata that would just pollute site-map links.
(dissoc (processed-file :meta) :logbook :links :keywords :toc)
{:path (str "/" (processed-file :path-web))})]

;; add to sitemap when file is not private.
(when-not is-private
(swap! site-map conj new-site-map-item)
(when-not (= #p (-> processed-file :meta :keywords :firn-sitemap? ) false)
(swap! site-map conj new-site-map-item)) ;; add to site map unless user has specified not to.
(swap! site-links concat (-> processed-file :meta :links))
(swap! site-logs concat (-> processed-file :meta :logbook))
(swap! site-tags concat (-> processed-file :meta :tags)))
Expand Down
2 changes: 1 addition & 1 deletion clojure/src/firn/file.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[sci.core :as sci]))

;; #+ORG_KEYWORDS that we want to evaluate into real clojure values.
(def keywords-to-eval [:firn-toc :firn-properties? :firn-order :firn-fold])
(def keywords-to-eval [:firn-toc :firn-properties? :firn-order :firn-fold :firn-sitemap?])

;; -- Getters

Expand Down
1 change: 1 addition & 0 deletions docs/configuration.org
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ The following in-buffer settings are processed by Firn and/or made available to
| ~#+FIRN_TOC~ | map | Settings for any rendered table of contents |
| ~#+FIRN_ORDER~ | integer | Enables sorting files in the site-map |
| ~#+FIRN_PRIVATE~ | boolean | Whether or not to read the file in question |
| #+FIRN_SITEMAP? | boolean | Whether to include the file in the site-map. |
| ~#+FIRN_UNDER~ | string | Category for which the documents falls under |

0 comments on commit bfaefc4

Please sign in to comment.