IMPORTANT NOTICE: Devheroes public code hosting will shut down at 1st of March 2023. Due to some difficulties, we have to shut down the instance. Since codeberg.org is pretty mature and welcoming, We highly recommend you to move your code there. Please be advised that on 1st of March, your data will be removed. Thanks for your time with us, and may the source be with you.

Browse Source

Break down the docs path into vars

ep8
Sameer Rahmani 7 months ago
parent
commit
bc95a3fa1a
  1. 10
      core/fg42/build/core.el
  2. 24
      core/fg42/build/docs.el

10
core/fg42/build/core.el

@ -40,6 +40,11 @@ @@ -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." @@ -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))

24
core/fg42/build/docs.el

@ -51,7 +51,7 @@ @@ -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." @@ -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." @@ -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." @@ -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." @@ -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." @@ -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

Loading…
Cancel
Save