forked from FG42/FG42
Break down the docs path into vars
This commit is contained in:
parent
f3288bb30d
commit
bc95a3fa1a
|
@ -40,6 +40,11 @@
|
||||||
(defvar fg42/build-author-name "Sameer Rahmani")
|
(defvar fg42/build-author-name "Sameer Rahmani")
|
||||||
(defvar fg42/build-author-email "lxsameer@gnu.org")
|
(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
|
(defvar fg42/build-docs-actions nil
|
||||||
"Set of actions to run before building the
|
"Set of actions to run before building the
|
||||||
main docs.")
|
main docs.")
|
||||||
|
@ -68,6 +73,11 @@ The build system will consum these details for various purposes."
|
||||||
(concat fg42/build-project-root path))
|
(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 ()
|
(defun prod-p ()
|
||||||
"Return non-nil if debug mode is turned off"
|
"Return non-nil if debug mode is turned off"
|
||||||
(not fg42/build-debug-mode))
|
(not fg42/build-debug-mode))
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
(defun fg42/build-docs-copy-base (build-dir)
|
(defun fg42/build-docs-copy-base (build-dir)
|
||||||
"Copy the base structure of the website to the 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))
|
(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")))
|
(let ((out (format "%s/site/tags/%s.org" build-dir (or tag "Uncategorized")))
|
||||||
(files (cdr (assoc tag (cdr tags)))))
|
(files (cdr (assoc tag (cdr tags)))))
|
||||||
(copy-template
|
(copy-template
|
||||||
(from-root "/docs/site/templates/links_template.org")
|
(from-docs "/templates/links_template.org")
|
||||||
out
|
out
|
||||||
(list
|
(list
|
||||||
(cons :links
|
(cons :links
|
||||||
|
@ -251,7 +251,7 @@ Not pages."
|
||||||
(error "The above list of files are missing a category"))
|
(error "The above list of files are missing a category"))
|
||||||
|
|
||||||
(copy-template
|
(copy-template
|
||||||
(from-root "/docs/site/templates/links_template.org")
|
(from-docs "/templates/links_template.org")
|
||||||
out
|
out
|
||||||
(list
|
(list
|
||||||
(cons :links
|
(cons :links
|
||||||
|
@ -282,7 +282,7 @@ Not pages."
|
||||||
fg42/build-docs-actions)
|
fg42/build-docs-actions)
|
||||||
|
|
||||||
;; Copy the assets
|
;; Copy the assets
|
||||||
(copy-directory (from-root "/docs/site/assets")
|
(copy-directory (from-docs "/assets")
|
||||||
(expand-file-name "assets" stage1-dir) nil t)
|
(expand-file-name "assets" stage1-dir) nil t)
|
||||||
|
|
||||||
;; We will use the org-agenda to extract all the tags
|
;; 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-link-home "")
|
||||||
(setf org-html-scripts "")
|
(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)
|
(expand-file-name "config.org" build-dir)
|
||||||
'())
|
'())
|
||||||
|
|
||||||
(message "Creating the main index file")
|
(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)
|
(expand-file-name "site/index.org" build-dir)
|
||||||
`((:links . ,(latest-org-list base-url))
|
`((:links . ,(latest-org-list base-url))
|
||||||
(:base-url . ,base-url)))
|
(:base-url . ,base-url)))
|
||||||
|
|
||||||
(message "Creating categories")
|
(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)
|
(expand-file-name "site/categories/index.org" build-dir)
|
||||||
`((:links . ,(category-org-list))))
|
`((:links . ,(category-org-list))))
|
||||||
|
|
||||||
(create-category-pages build-dir)
|
(create-category-pages build-dir)
|
||||||
|
|
||||||
(message "Creating tags")
|
(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)
|
(expand-file-name "site/tags/index.org" build-dir)
|
||||||
`((:links . ,(tags-org-list))))
|
`((:links . ,(tags-org-list))))
|
||||||
|
|
||||||
|
@ -349,10 +349,10 @@ Not pages."
|
||||||
:with-toc nil
|
:with-toc nil
|
||||||
:base-url ,base-url
|
:base-url ,base-url
|
||||||
:html-link-home "/"
|
:html-link-home "/"
|
||||||
:html-template ,(from-root "/docs/site/templates/blog.html")
|
:html-template ,(from-docs "/templates/blog.html")
|
||||||
:html-page-preamble-template ,(from-root "/docs/site/templates/page-preamble.html")
|
:html-page-preamble-template ,(from-docs "/templates/page-preamble.html")
|
||||||
:html-post-preabmle-template ,(from-root "/docs/site/templates/post-preamble.html")
|
:html-post-preabmle-template ,(from-docs "/templates/post-preamble.html")
|
||||||
:html-tags-template ,(from-root "/docs/site/templates/tags.html")
|
:html-tags-template ,(from-docs "/templates/tags.html")
|
||||||
:publishing-function org-html-publish-to-templated-html
|
:publishing-function org-html-publish-to-templated-html
|
||||||
:auto-sitemap t
|
:auto-sitemap t
|
||||||
:htmlized-source nil
|
:htmlized-source nil
|
||||||
|
|
Loading…
Reference in New Issue