Break down the docs path into vars

这个提交包含在:
Sameer Rahmani 2022-07-03 23:27:34 +01:00
父节点 f3288bb30d
当前提交 bc95a3fa1a
共有 2 个文件被更改,包括 22 次插入12 次删除

查看文件

@ -40,6 +40,11 @@
(defvar fg42/build-author-name "Sameer Rahmani")
(defvar fg42/build-author-email "lxsameer@gnu.org")
(defvar fg42/build-docs-root "/docs/site"
"Where to find the docs. It sould be relative to the
project root.")
(defvar fg42/build-docs-actions nil
"Set of actions to run before building the
main docs.")
@ -68,6 +73,11 @@ The build system will consum these details for various purposes."
(concat fg42/build-project-root path))
(defun from-docs (path)
"Return the full path of the given PATH in the docs root."
(concat (from-root fg42/build-docs-root) path))
(defun prod-p ()
"Return non-nil if debug mode is turned off"
(not fg42/build-debug-mode))

查看文件

@ -51,7 +51,7 @@
(defun fg42/build-docs-copy-base (build-dir)
"Copy the base structure of the website to the BUILD-DIR."
(copy-directory (from-root "/docs/site/pages")
(copy-directory (from-docs "/pages")
(expand-file-name "site/pages" build-dir) nil t))
@ -212,7 +212,7 @@ Not pages."
(let ((out (format "%s/site/tags/%s.org" build-dir (or tag "Uncategorized")))
(files (cdr (assoc tag (cdr tags)))))
(copy-template
(from-root "/docs/site/templates/links_template.org")
(from-docs "/templates/links_template.org")
out
(list
(cons :links
@ -251,7 +251,7 @@ Not pages."
(error "The above list of files are missing a category"))
(copy-template
(from-root "/docs/site/templates/links_template.org")
(from-docs "/templates/links_template.org")
out
(list
(cons :links
@ -282,7 +282,7 @@ Not pages."
fg42/build-docs-actions)
;; Copy the assets
(copy-directory (from-root "/docs/site/assets")
(copy-directory (from-docs "/assets")
(expand-file-name "assets" stage1-dir) nil t)
;; We will use the org-agenda to extract all the tags
@ -301,25 +301,25 @@ Not pages."
(setf org-html-link-home "")
(setf org-html-scripts "")
(copy-template (from-root "/docs/site/config.org")
(copy-template (from-docs "/config.org")
(expand-file-name "config.org" build-dir)
'())
(message "Creating the main index file")
(copy-template (from-root "/docs/site/templates/index.org")
(copy-template (from-docs "/templates/index.org")
(expand-file-name "site/index.org" build-dir)
`((:links . ,(latest-org-list base-url))
(:base-url . ,base-url)))
(message "Creating categories")
(copy-template (from-root "/docs/site/templates/categories.org")
(copy-template (from-docs "/templates/categories.org")
(expand-file-name "site/categories/index.org" build-dir)
`((:links . ,(category-org-list))))
(create-category-pages build-dir)
(message "Creating tags")
(copy-template (from-root "/docs/site/templates/tags.org")
(copy-template (from-docs "/templates/tags.org")
(expand-file-name "site/tags/index.org" build-dir)
`((:links . ,(tags-org-list))))
@ -349,10 +349,10 @@ Not pages."
:with-toc nil
:base-url ,base-url
:html-link-home "/"
:html-template ,(from-root "/docs/site/templates/blog.html")
:html-page-preamble-template ,(from-root "/docs/site/templates/page-preamble.html")
:html-post-preabmle-template ,(from-root "/docs/site/templates/post-preamble.html")
:html-tags-template ,(from-root "/docs/site/templates/tags.html")
:html-template ,(from-docs "/templates/blog.html")
:html-page-preamble-template ,(from-docs "/templates/page-preamble.html")
:html-post-preabmle-template ,(from-docs "/templates/post-preamble.html")
:html-tags-template ,(from-docs "/templates/tags.html")
:publishing-function org-html-publish-to-templated-html
:auto-sitemap t
:htmlized-source nil