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

Move the docs deps to docs.el

ep8
Sameer Rahmani 7 months ago
parent
commit
46932dcacd
  1. 7
      build.el
  2. 53
      core/fg42/build/docs.el

7
build.el

@ -71,13 +71,6 @@ PARAMS: @@ -71,13 +71,6 @@ PARAMS:
(command-> command args
((string= command "docs")
(do-command
(require 'fpkg)
(fpkg/use dash)
(fpkg/use mustache)
(fpkg/use ht)
(fpkg/use htmlize)
(require 'fg42/build/docs)
(fg42/build-docs build-dir)))

53
core/fg42/build/docs.el

@ -25,7 +25,15 @@ @@ -25,7 +25,15 @@
;; way. Cubes are composable and a composition of cubes creates an editor.
;;
;;; Code:
(require 'fpkg)
(fpkg/use dash)
(fpkg/use mustache)
(fpkg/use ht)
(fpkg/use htmlize)
(fpkg/use ox-rss)
(require 'ox-html)
(require 'ox-rss)
(require 'cubes/all)
(require 'fg42/build/core)
@ -166,6 +174,26 @@ Not pages." @@ -166,6 +174,26 @@ Not pages."
"\n")))
(defun latest-org-list-rss (base-url)
"Return a list of headlines (using BASE-URL) for the RSS."
(let ((posts (get-all-sorted-posts)))
(mapconcat
(lambda (post)
(format "* %s\n:PROPERTIES:\n:RSS_PERMALINK:%s%s/%s?%s\n:END:"
;; Title
(nth 1 post)
base-url
fg42/build-docs-pages-dir
;; Path
(nth 2 post)
;; Hash
(car post)
;; Title
(nth 1 post)))
posts
"\n")))
(defun get-all-categories ()
"Return all the categories of the org files."
(seq-reduce
@ -338,6 +366,12 @@ Not pages." @@ -338,6 +366,12 @@ Not pages."
(expand-file-name "site/tags/index.org" build-dir)
`((:links . ,(tags-org-list))))
(message "Creating the rss feed")
(copy-template (from-docs "/templates/rss.org")
(expand-file-name "site/rss.org" build-dir)
`((:base-url . ,base-url)
(:posts . ,(latest-org-list-rss base-url))))
(create-tag-pages build-dir)
(setq org-html-preamble #'preamble-fn)
@ -377,19 +411,32 @@ Not pages." @@ -377,19 +411,32 @@ Not pages."
:sitemap-filename "sitemap.inc"
:sitemap-sort-files anti-chronologically
:html-format-headline-function headline-format
:exclude "rss.org"
:makeindex nil)
("rss"
:base-directory ,stage1-dir
:base-extension "org"
:html-link-home ,base-url
:html-link-use-abs-url t
:rss-extension "xml"
:publishing-directory ,final-dir
:publishing-function (org-rss-publish-to-rss)
:section-numbers nil
:exclude ".*" ;; To exclude all files...
:include ("rss.org") ;; ... except index.org.
:table-of-contents nil)
("statics"
:base-directory ,stage1-dir
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|svg"
:publishing-directory ,final-dir
:recursive t
:publishing-function org-publish-attachment)
("build" :components ("website" "statics"))))
("build" :components ("website" "statics" "rss"))))
(org-publish-project "build" t nil)
(message "Build complete.")
))
(message "Build complete.")))
(provide 'fg42/build/docs)
;;; docs.el ends here

Loading…
Cancel
Save