@ -51,13 +51,14 @@
@@ -51,13 +51,14 @@
( defun fg42/build-docs-copy-base ( build-dir )
" Copy the base structure of the website to the BUILD-DIR. "
( copy-directory ( from-docs " /pages " )
( expand-file-name " site/pages " build-dir ) nil t ) )
( copy-directory ( from-docs fg42/build-docs-pages-dir )
( expand-file-name ( format " site/%s " fg42/build-docs-pages-dir )
build-dir )
nil t ) )
( 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 )
;; Build the org files for each cube
( message " Processing the docs for all the cubes " )
@ -162,22 +163,25 @@ Not pages."
@@ -162,22 +163,25 @@ Not pages."
( seq-reduce
;; all-cats is in (cats . cat->files) form
( lambda ( all-cats file )
( let ( ( is-page? ( string= ( get-file-global-props file " PAGE " ) " true " ) )
( cat ( get-file-global-props file " CATEGORY " ) )
( cat-list ( car all-cats ) )
( cat->file ( cdr all-cats ) ) )
( if ( not is-page? )
( cons
;; Category list
( if ( member cat cat-list ) cat-list ( sort ( cons cat cat-list ) 'string< ) )
;; cat->file
( cons ( cons cat
;; Current value of the the given cat (all the files
;; under that category)
( append ( list file ) ( cdr ( assoc cat cat->file ) ) ) )
cat->file ) )
all-cats ) ) )
( if ( not ( member ( file-relative-name file org-directory )
fg42/build-docs-ignore-category-check ) )
( let ( ( is-page? ( string= ( get-file-global-props file " PAGE " ) " true " ) )
( cat ( get-file-global-props file " CATEGORY " ) )
( cat-list ( car all-cats ) )
( cat->file ( cdr all-cats ) ) )
( if ( not is-page? )
( cons
;; Category list
( if ( member cat cat-list ) cat-list ( sort ( cons cat cat-list ) 'string< ) )
;; cat->file
( cons ( cons cat
;; Current value of the the given cat (all the files
;; under that category)
( append ( list file ) ( cdr ( assoc cat cat->file ) ) ) )
cat->file ) )
all-cats ) )
all-cats ) )
( all-org-files )
' ( ) ) )
@ -244,10 +248,11 @@ Not pages."
@@ -244,10 +248,11 @@ Not pages."
( when ( null tag )
( message " [Error]: The following files are missig a category: %s "
( mapconcat
( lambda ( x ) ( format " %s \n " x ) )
( lambda ( x ) ( format " %s " x ) )
( sort
( mapcar #' pair-file-with-date files )
( lambda ( x y ) ( > ( car x ) ( car y ) ) ) ) ) )
( lambda ( x y ) ( > ( car x ) ( car y ) ) ) )
" \n " ) )
( error " The above list of files are missing a category " ) )
( copy-template
@ -276,6 +281,8 @@ Not pages."
@@ -276,6 +281,8 @@ Not pages."
( stage1-dir ( expand-file-name " site " build-dir ) )
( final-dir ( expand-file-name " site-build " build-dir ) ) )
( fg42/build-docs-copy-base build-dir )
;; Apply all the actions
( mapcar ( lambda ( f )
( funcall f build-dir base-url ) )