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

Fix the cube index list link and cube order

ep8
Sameer Rahmani 8 months ago
parent
commit
32bb579ac8
  1. 2
      Makefile
  2. 60
      core/fg42/build/docs.el

2
Makefile

@ -51,7 +51,7 @@ docs: @@ -51,7 +51,7 @@ docs:
./build.el docs
serve: build
npx http-server ./build
npx http-server ./build/site-build/
.PHONY: deploy-docs
deploy-docs: docs

60
core/fg42/build/docs.el

@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
(copy-directory (from-root "/docs/site/pages") build-dir nil t))
(defun fg42/build-prepare-docs (build-dir)
(defun fg42/build-prepare-docs (build-dir host)
"Prepare the documents and the website in the given BUILD-DIR."
(fg42/build-docs-copy-base build-dir)
@ -77,10 +77,10 @@ @@ -77,10 +77,10 @@
(cons :links (mapconcat (lambda (c)
(format "- [[%s][%s]]\n"
;; href
(format "%s/cubes/%s.org" build-dir c)
(format "%s/cubes/%s.html" host c)
;; title
(plist-get (symbol-plist c) :title)))
fg42/available-cubes)))))
(sort fg42/available-cubes 'string<))))))
(defun all-org-files ()
@ -137,7 +137,7 @@ Not pages." @@ -137,7 +137,7 @@ Not pages."
(->epoch (get-file-global-props file "DATE"))
(get-file-global-props file "TITLE")
(replace-regexp-in-string "\\.org" ".html"
(file-name-nondirectory file)))
(file-name-nondirectory file)))
result)
result)))
files
@ -247,11 +247,11 @@ Not pages." @@ -247,11 +247,11 @@ Not pages."
(files (cdr (assoc tag (cdr tags)))))
(when (null tag)
(message "[Error]: The following files are missig a category: %s"
(mapconcat
(lambda (x) (format " %s\n" x))
(sort
(mapcar #'pair-file-with-date files)
(lambda (x y) (> (car x) (car y))))))
(mapconcat
(lambda (x) (format " %s\n" x))
(sort
(mapcar #'pair-file-with-date files)
(lambda (x y) (> (car x) (car y))))))
(error "The above list of files are missing a category"))
(copy-template
@ -276,33 +276,33 @@ Not pages." @@ -276,33 +276,33 @@ Not pages."
(defun fg42/build-docs (build-dir)
"Build the documents and the website in the given BUILD-DIR."
;; Create org files for the cubes
(fg42/build-prepare-docs build-dir)
(let ((base-url (if (prod-p) "https://fg42.org" "http://localhost:3003"))
(stage1-dir (expand-file-name "site" build-dir))
(final-dir (expand-file-name "site-build" build-dir)))
;; We will use the org-agenda to extract all the tags
;; Create org files for the cubes
(fg42/build-prepare-docs build-dir base-url)
;;; Set the dir containing org the org-files
(setq org-directory (expand-file-name "site" build-dir))
;; We will use the org-agenda to extract all the tags
;;; Discover all the org files
(setq org-agenda-files (all-org-files))
;;; Set the dir containing org the org-files
(setq org-directory (expand-file-name "site" build-dir))
(setf user-full-name author-name)
(setf user-mail-address author-email)
;;; Discover all the org files
(setq org-agenda-files (all-org-files))
;; Disable default header links (top, next)
(setf org-html-home/up-format "")
(setf org-html-link-up "")
(setf org-html-link-home "")
(setf org-html-scripts "")
(setf user-full-name author-name)
(setf user-mail-address author-email)
(copy-template (from-root "/docs/site/config.org")
(expand-file-name "config.org" build-dir)
'())
;; Disable default header links (top, next)
(setf org-html-home/up-format "")
(setf org-html-link-up "")
(setf org-html-link-home "")
(setf org-html-scripts "")
(let ((base-url (if (prod-p) "https://fg42.org" "http://localhost:3003"))
(stage1-dir (expand-file-name "site" build-dir))
(final-dir (expand-file-name "site-build" build-dir)))
(copy-template (from-root "/docs/site/config.org")
(expand-file-name "config.org" build-dir)
'())
(message "Creating the main index file")
(copy-template (from-root "/docs/site/templates/index.org")
@ -390,7 +390,7 @@ Not pages." @@ -390,7 +390,7 @@ Not pages."
(org-publish-project "build" t nil)
(message "Build complete.")
))
))
(provide 'fg42/build/docs)
;;; docs.el ends here

Loading…
Cancel
Save