From 82a69835cacbebea7f5c1b4c1625f1551c8e2d91 Mon Sep 17 00:00:00 2001 From: Dave Cooper Date: Sat, 13 Oct 2018 15:17:05 -0400 Subject: [PATCH 1/4] Added ability to generate .html file in content/ from corresponding lisp file containing lhtml and markdown. --- .gitignore | 2 ++ cl-site.asd | 5 ++-- content/about.html | 50 ------------------------------------- content/about.lisp | 60 +++++++++++++++++++++++++++++++++++++++++++++ package.lisp | 2 ++ process.lisp | 61 +++++++++++++++++++++++++++++++++++++++++++--- 6 files changed, 125 insertions(+), 55 deletions(-) delete mode 100644 content/about.html create mode 100644 content/about.lisp diff --git a/.gitignore b/.gitignore index aa116bc..85b10cd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ auto-save-list # Output files output/ system-index.txt +content/newsbox.html +content/about.html \ No newline at end of file diff --git a/cl-site.asd b/cl-site.asd index 515eeb5..0ce0969 100644 --- a/cl-site.asd +++ b/cl-site.asd @@ -4,12 +4,12 @@ (asdf:defsystem cl-site :name "cl-site" :version "0.0.1" - :maintainer "C. Yang" + :maintainer "common-lisp.net volunteers" :author "C. Yang" :licence "TBD" :description "Static site generator for CLnet, written in CL" - :depends-on (:cl-mustache :plump :markdown.cl :closer-mop) + :depends-on (:cl-mustache :plump :cl-markdown :closer-mop :cl-who) :components ((:module source :pathname "" @@ -19,6 +19,7 @@ (:file "helpers") (:file "process") (:file "main"))) + (:module package :pathname "" :components ((:file "package")))) diff --git a/content/about.html b/content/about.html deleted file mode 100644 index d9c2bed..0000000 --- a/content/about.html +++ /dev/null @@ -1,50 +0,0 @@ -

 About Common-Lisp.net

- -

Common-Lisp.net provides hosting for projects and user groups -related to the programming language Common Lisp. -

- -

The site is run under the governance of the Common Lisp Foundation and -maintained mostly by a committee of volunteers. Please consider donating.

- -

Its source is hosted -on gitlab.common-lisp.net. -

- -

If you want to request a project, read -this document.

- -

If you have questions, suggestions or comments about this site or -you simply wish to reach the current maintainers, email -this mailinglist.

- -

The documentation, procedures, feature requests etc are located in -our Trac instance: clo's -Trac.

- -

Maintainance

- -

Since many years Common-Lisp.net has been run -by a number of volunteers.

- -

Currently active maintainers

- - - -

Previous maintainers

- - - diff --git a/content/about.lisp b/content/about.lisp new file mode 100644 index 0000000..448f2bd --- /dev/null +++ b/content/about.lisp @@ -0,0 +1,60 @@ +(in-package :cl-site) + + +(add-content + "about.html" + (with-cl-who-string (:indent t) + (:h1 ((:i :class "far fa-question-circle")) " About Common-Lisp.net") + + (wmd " + +Common-Lisp.net provides hosting for projects and user groups related to the programming language Common Lisp. + + +The site is run under the governance of the [Common Lisp +Foundation](http://www.cl-foundation.org) and maintained mostly by a +committee of volunteers. [Please consider donating](/contribute). + + +Its source is hosted on +[gitlab.common-lisp.net](https://gitlab.common-lisp.net/clo/cl-site). + + +If you want to request a project, read [this +document](/project-intro). + + +If you have questions, suggestions or comments about this site or you +simply wish to reach the current maintainers, email [this mailing +list](http://mailman.common-lisp.net/cgi-bin/mailman/listinfo/clo-devel). + +The documentation, procedures, feature requests etc are located in our +Trac instance: [clo's Trac](http://trac.common-lisp.net/clo).") + + (:h2 "Maintainance") + + (wmd " + +Since many years [Common-Lisp.net](/) has been run by a number of +volunteers.") + + (:h3 "Currently active maintainers") + + (wmd " + +* Mark Evenson +* Erik Huelsmann +* Mariano Montone") + + (:h3 "Previous maintainers") + + (wmd " + +* Erik Enge +* Drew Crampsie +* Hans Hübner +* Cheryl Yang +* Mario S. Mommer"))) + + + diff --git a/package.lisp b/package.lisp index 217b038..500be32 100644 --- a/package.lisp +++ b/package.lisp @@ -4,3 +4,5 @@ #:make-site)) +(defpackage #:cl-site-content + (:use :cl)) diff --git a/process.lisp b/process.lisp index 9679971..ba27cf7 100644 --- a/process.lisp +++ b/process.lisp @@ -52,13 +52,41 @@ output-stream))))) (defun process-pages () - (format t "Processing pages..~%") + (format t "Processing pages...~%") + + ;; + ;; Go through all the pages in *page-context* and look for + ;; corresponding .lisp file. If it exists, it's assumed this is + ;; using `add-content' (defined below) to generate an HTML string and + ;; add it to the :content field of its entry in *page-context*. So + ;; we compile/load this lisp file then write the content out to the + ;; html file. Yes, this is turning into a goddamn Rube Goldberg + ;; setup and at some point we will need to clean up and simplify + ;; this whole process... But trying to get to where we can at least + ;; experiment with using LHTML and markdown to author and maintain + ;; page content. + ;; + (dolist (page *page-context*) + (let* ((html-file (first page)) + (lisp-file (probe-file (make-pathname :defaults *pages-dir* + :name (pathname-name html-file) + :type "lisp")))) + (when lisp-file + (format t "Compile/loading ~a and creating fresh ~a...~%" (file-namestring lisp-file) html-file) + (let ((fasl (compile-file lisp-file))) + (load fasl) (delete-file fasl)) + (let ((content (page-content html-file))) + (with-open-file (out (merge-pathnames html-file *pages-dir*) :if-exists :supersede + :if-does-not-exist :create :direction :output) + (write-string content out)))))) + + (generate-news) (let ((template-path (pathname (merge-pathnames *LAYOUT-DIR* *DEFAULT-PAGE-TEMPLATE*)))) (ensure-directories-exist *OUTPUT-DIR*) (loop for page in *PAGES* do - (format t "Generating ~A~%" (cdr (assoc :content page))) + (format t "Rendering ~A~%" (cdr (assoc :content page))) (render-page page template-path)) (format t "Done.~%"))) @@ -68,7 +96,8 @@ (defun generate-news () (let ((html - (markdown:parse-file (merge-pathnames "news.md" *PAGES-DIR*)))) + (with-output-to-string (ss) + (cl-markdown:markdown (merge-pathnames "news.md" *PAGES-DIR*) :stream ss)))) (with-open-file (f (merge-pathnames "news.html" *PAGES-DIR*) :direction :output :if-does-not-exist :create @@ -144,3 +173,29 @@ ;; else (next-node))))))) (plump:serialize news nil)))) + + +(defmacro with-cl-who-string ((&rest args) &body body) + + "Form. Sets up body to be evaluated with cl-who:with-html-output and return the resulting string instead +of writing to a stream." + + (let ((ss (gensym))) + `(with-output-to-string (,ss) + (cl-who:with-html-output (,ss nil ,@args) ,@body)))) + + +(defmacro wmd (string) + "Form suitable for inclusion in cl-who LHTML context. Returns an + `str` form after passing it through cl-markdown's markdown processor. +" + `(cl-who:str + (with-output-to-string (ss) + (cl-markdown:markdown ,string :stream ss)))) + +(defun add-content (page-name content-string) + (pushnew (cons :content content-string) + (first (rest (assoc page-name *page-context* :test #'string-equal))))) + +(defun page-content (page-name) + (rest (assoc :content (page-context page-name)))) -- GitLab From 432f0639477f2ae0042726b3bbe7d395b52ffdd8 Mon Sep 17 00:00:00 2001 From: Dave Cooper Date: Sat, 13 Oct 2018 16:00:54 -0400 Subject: [PATCH 2/4] fixed typo in defun process-pages. --- process.lisp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/process.lisp b/process.lisp index 37f5566..c0794d3 100644 --- a/process.lisp +++ b/process.lisp @@ -37,7 +37,7 @@ (mustache:render template-path (append page-context *GLOBAL-CONTEXT*) output-stream))))) -(defun process-pages () +(defun process-pages (pages) (format t "Processing pages...~%") ;; @@ -75,7 +75,6 @@ (render-page page template-path)) (format t "Done.~%"))) - ;; Process news (defparameter +edit-news-link+ "https://gitlab.common-lisp.net/clo/cl-site/edit/master/content/news.md") -- GitLab From 5cbd0ab64459b02eb5a9d214ceefa7b1773dfc12 Mon Sep 17 00:00:00 2001 From: Dave Cooper Date: Sat, 13 Oct 2018 22:12:26 -0400 Subject: [PATCH 3/4] Support for content/*.lisp files in addition to content/*.html. --- README.md | 4 ++ cl-site.asd | 2 +- content/about.lisp | 5 ++- globals.lisp | 20 +++++++-- main.lisp | 10 +++++ package.lisp | 5 +-- process.lisp | 101 ++++++++++++++++++++++++++------------------- 7 files changed, 95 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index fa091d7..c123cf4 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ Load with this command: (ql:quickload :cl-site) +To clean any old output/ directory: + + (cl-site:make-clean) + To generate the site: (cl-site::make-site) diff --git a/cl-site.asd b/cl-site.asd index a7b67e5..1bf48f2 100644 --- a/cl-site.asd +++ b/cl-site.asd @@ -8,7 +8,7 @@ :author "C. Yang & Common-Lisp.Net maintainers" :licence "TBD" :description "Static site generator for common-lisp.net, written in CL" - :depends-on (:cl-mustache :plump :cl-markdown :closer-mop :cl-who :cl-yaml) + :depends-on (:cl-mustache :plump :markdown.cl :closer-mop :cl-who :cl-yaml) :components ((:module source :pathname "" :serial t diff --git a/content/about.lisp b/content/about.lisp index 448f2bd..665a1b9 100644 --- a/content/about.lisp +++ b/content/about.lisp @@ -1,8 +1,9 @@ -(in-package :cl-site) +(in-package :cl-site-content) (add-content - "about.html" + :title "Common-Lisp.net | About" + :html-string (with-cl-who-string (:indent t) (:h1 ((:i :class "far fa-question-circle")) " About Common-Lisp.net") diff --git a/globals.lisp b/globals.lisp index 4ceb08d..a4bf6d7 100644 --- a/globals.lisp +++ b/globals.lisp @@ -24,15 +24,27 @@ (defparameter *PRIVATE-KEYS* '(:slug :content)) -(defparameter *PAGES* +(defun populate-pages () (mapcar (lambda (p) (list (cons :content (file-namestring p)) (cons :title (file-namestring p)))) - (directory (make-pathname :defaults *PAGES-DIR* - :name :wild - :type "html"))) + ;; + ;; At this point there could be duplicate, i.e. a .html and a .lisp file. + ;; + (append + (directory (make-pathname :defaults *PAGES-DIR* :name :wild :type "html")) + (directory (make-pathname :defaults *PAGES-DIR* :name :wild :type "lisp"))))) + + +(defparameter *PAGES* (populate-pages) "Each page is an alist containing info to be sent to the template via the context.") ;; Initialize global context (will be appended to all individual page contexts) ;; Used to store things like stylesheets, etc... (defparameter *GLOBAL-CONTEXT* ()) + +(defparameter *computed-page-content* nil + "Used as dynamically bound variable in preprocess-lisp-pages, to + capture output when compile/loading any lispy html content files + wrapped with calls to add-content. Global value should always be + nil.") diff --git a/main.lisp b/main.lisp index 8fea090..e009f59 100644 --- a/main.lisp +++ b/main.lisp @@ -6,3 +6,13 @@ (format t "Generating site in ~A.~%" *output-dir*) (process-static) (process-pages *pages*))) + + +(defun make-clean (&optional (output-dir *output-dir*)) + (when (probe-file output-dir) + (uiop:delete-directory-tree + output-dir + :validate #'(lambda(dir) + (string-equal (first (last (pathname-directory dir))) + "output")))) + (ensure-directories-exist output-dir)) diff --git a/package.lisp b/package.lisp index 500be32..4d91aec 100644 --- a/package.lisp +++ b/package.lisp @@ -1,8 +1,7 @@ (defpackage #:cl-site (:use :cl) - (:export - #:make-site)) + (:export #:make-site #:make-clean #:add-content #:wmd :with-cl-who-string)) (defpackage #:cl-site-content - (:use :cl)) + (:use :cl :cl-site :cl-who)) diff --git a/process.lisp b/process.lisp index 24e4a31..8c6077e 100644 --- a/process.lisp +++ b/process.lisp @@ -41,7 +41,7 @@ (header content) (split-content-from-header page-path) (let* ((header-text (format nil "~{~A~%~}" header)) - (content-text (format nil "~{~A~%~}" content)) + (content-text (format nil "~{~A~%~}" (remove nil content))) (parsed-header (yaml:parse header-text)) (page-context (when parsed-header @@ -54,52 +54,62 @@ (mustache:render template-path (append (acons :page-content content-text page-context) *GLOBAL-CONTEXT*) output-stream)))))) -(defun process-pages (pages) - (format t "Processing pages...~%") - ;; - ;; Go through all the pages in *page-context* and look for - ;; corresponding .lisp file. If it exists, it's assumed this is - ;; using `add-content' (defined below) to generate an HTML string and - ;; add it to the :content field of its entry in *page-context*. So - ;; we compile/load this lisp file then write the content out to the - ;; html file. Yes, this is turning into a goddamn Rube Goldberg - ;; setup and at some point we will need to clean up and simplify - ;; this whole process... But trying to get to where we can at least - ;; experiment with using LHTML and markdown to author and maintain - ;; page content. - ;; - (dolist (page *page-context*) - (let* ((html-file (first page)) - (lisp-file (probe-file (make-pathname :defaults *pages-dir* - :name (pathname-name html-file) - :type "lisp")))) - (when lisp-file - (format t "Compile/loading ~a and creating fresh ~a...~%" (file-namestring lisp-file) html-file) - (let ((fasl (compile-file lisp-file))) - (load fasl) (delete-file fasl)) - (let ((content (page-content html-file))) - (with-open-file (out (merge-pathnames html-file *pages-dir*) :if-exists :supersede - :if-does-not-exist :create :direction :output) - (write-string content out)))))) + + +(defun process-pages (pages) + + (format t "Processing pages...~%") + + (preprocess-lisp-pages pages) + (generate-news) + (let ((template-path (pathname (merge-pathnames *LAYOUT-DIR* *DEFAULT-PAGE-TEMPLATE*)))) (ensure-directories-exist *OUTPUT-DIR*) - (loop for page in pages - do - (format t "Rendering ~A~%" (cdr (assoc :content page))) - (render-page page template-path)) + (setq pages (populate-pages)) + (dolist (page pages) + (let ((page-pathname (merge-pathnames (page-content page) *pages-dir*))) + (when (string-equal (pathname-type page-pathname) "html") + (format t "Rendering ~A~%" (cdr (assoc :content page))) + (render-page page template-path) + (when (probe-file (make-pathname :defaults page-pathname :type "lisp")) + (format t "Deleting temporary generated ~a~%" (file-namestring page-pathname)) + (delete-file page-pathname) + )))) (format t "Done.~%"))) + +(defun preprocess-lisp-pages (pages) + (dolist (page pages) + (let* ((lisp-file (page-content page))) + (when (string-equal (pathname-type lisp-file) "lisp") + (let ((html-file (make-pathname :defaults lisp-file :type "html"))) + (format t "Compile/loading ~a and creating fresh ~a...~%" + (file-namestring lisp-file) html-file) + (let ((fasl (compile-file (merge-pathnames lisp-file *pages-dir*))) + *computed-page-content*) + (load fasl) (delete-file fasl) + (with-open-file (out (merge-pathnames html-file *pages-dir*) :if-exists :supersede + :if-does-not-exist :create :direction :output) + (format out "title: ~a~%---~%" (getf *computed-page-content* :title)) + (write-string (getf *computed-page-content* :html-string) out)))))))) + ;; Process news (defparameter +edit-news-link+ "https://gitlab.common-lisp.net/clo/cl-site/edit/master/content/news.md") + +;; +;; FLAG -- If news.html is converted to news.lisp (a la about.lisp) +;; then the following only will have to deal with generating the +;; newsbox. The news.lisp would have to include the hardcoded HTML +;; which is injected below as well. +;; (defun generate-news () (let ((html - (with-output-to-string (ss) - (cl-markdown:markdown (merge-pathnames "news.md" *PAGES-DIR*) :stream ss)))) + (markdown:parse-file (merge-pathnames "news.md" *PAGES-DIR*)))) (with-open-file (f (merge-pathnames "news.html" *PAGES-DIR*) :direction :output :if-does-not-exist :create @@ -191,13 +201,20 @@ of writing to a stream." "Form suitable for inclusion in cl-who LHTML context. Returns an `str` form after passing it through cl-markdown's markdown processor. " - `(cl-who:str - (with-output-to-string (ss) - (cl-markdown:markdown ,string :stream ss)))) + ;; + ;; FLAG -- should we be checking for loaded markdown package at compile-time instead? + ;; + `(cl-who:str (cond ((find-package :markdown.cl) + (funcall (read-from-string "markdown.cl:parse") ,string)) + ((find-package :cl-markdown) + (with-output-to-string (ss) + (funcall (read-from-string "cl-markdown:markdown") ,string :stream ss)))))) + +(defun page-content (page) (rest (assoc :content page))) + + +(defun add-content (&key title html-string) + (setq *computed-page-content* (list :title title :html-string html-string))) + -(defun add-content (page-name content-string) - (pushnew (cons :content content-string) - (first (rest (assoc page-name *page-context* :test #'string-equal))))) -(defun page-content (page-name) - (rest (assoc :content (page-context page-name)))) -- GitLab From 7bf046e0b2e9c8d560b79040b953013ce8502f9b Mon Sep 17 00:00:00 2001 From: Dave Cooper Date: Sun, 14 Oct 2018 15:39:37 -0400 Subject: [PATCH 4/4] Address discussion points from @ehuelsmann for !48. --- README.md | 2 +- content/about.lisp | 2 +- content/news.html | 817 ++++++++++++++++++++++++++++++++++++++++++++- globals.lisp | 15 - helpers.lisp | 69 +++- main.lisp | 2 +- process.lisp | 46 +-- 7 files changed, 896 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index c123cf4..5ca9d53 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Load with this command: To clean any old output/ directory: - (cl-site:make-clean) + (cl-site:make-clean) To generate the site: diff --git a/content/about.lisp b/content/about.lisp index 665a1b9..69a7e5f 100644 --- a/content/about.lisp +++ b/content/about.lisp @@ -2,7 +2,7 @@ (add-content - :title "Common-Lisp.net | About" + :headers-plist (list :|title| "Common-Lisp.net | About") :html-string (with-cl-who-string (:indent t) (:h1 ((:i :class "far fa-question-circle")) " About Common-Lisp.net") diff --git a/content/news.html b/content/news.html index 917fdfb..074e5a3 100644 --- a/content/news.html +++ b/content/news.html @@ -1,2 +1,815 @@ -
 Edit this page

Latest Common-Lisp.net news

2018-10-12 Intent to remove unused projects

As per the announcement, the site admins plan to remove the following list of projects which have been determined to neither have a project page nor a code repository. Please contact the site admins before October 26, 2018 to cancel project cleanup in case your project is wrongfully listed.

  • arxana
  • asdf-install
  • asdf-packaging
  • boston-lisp
  • chemboy
  • cl-amqp
  • cl-buchberger
  • cl-cactus-kev
  • cl-captcha
  • cl-clickatell
  • cl-gdbm
  • cl-gtk2
  • clint
  • cl-lazy-list
  • cl-lexer
  • cl-match
  • cl-ode
  • clotnet
  • cl-peg
  • cl-player
  • cl-rundown
  • cltl3
  • cl-yacc-ebnf
  • decl
  • defmud
  • docutrack
  • innen
  • israel-lisp
  • jess-parse
  • lisp-interface-library
  • mk-defsystem
  • movies
  • objective-cl
  • phorplay
  • same
  • sqlisp
  • tioga
  • trivial-features
  • trivial-shell
  • ucs-sort
  • umpa-lumpa
  • xml-psychiatrist

2018-10-12

Today I found some time to enable GitLab's 'reply by e-mail' functionality.

When you receive a notification e-mail from our GitLab instance, you can now send a reply to that notification. If the notification was from an issue being updated, then your reply will update the issue with a follow-up commont.

2018-10-10

A new version of Common-Lisp.net has been launched!

Among other things, the new site features:

  • A site generator implemented in Common Lisp.
  • A gitlab pipeline for automatic deployment.
  • A new responsive design based on Bootstrap and new content.

2018-10-06

As per the announcement in August, the list of users with O/S level access has been cleaned up: those accounts which haven't been accessed since 2013 (and for which the owner didn't object to removal), have been removed. Home directories will be destructed to comply with GDPR regulations.

If you once had an account and you need your access restored, please contact our admins.

2018-02-17

The Darcs (a distributed version control system before Git) repositories listed in our darcsweb instance have been converted to our GitLab instance. All use of Darcs on our site has been marked deprecated for a long time and we're happy to have found a way forward, keeping the repository content available to more modern VCSes.

2017-07-15

Our server was upgraded to Stretch as part of the regular life cycle management. See our announcement.

2015-05-25

Today the system has been declared "CVS clean"! All remnants of CVS have been removed.

2015-05-23

On Friday, the system had performance problems due to slow I/O. Checking the S.M.A.R.T. parameters of the disks didn't show anything unusual. Today, the disk system reports running in degraded mode, so we ordered the failing disk to be replaced, causing only minor downtime. The disk array has been rebuilt and it's smooth sailing from here again!

2015-05-22

GitLab upgraded to GitLab 7.11.1.

2015-05-15

Proposed approach for Darcs repository migration sent out.

2015-05-12

The final batch of CVS projects has been migrated. None of the projects opted to move to Subversion, so all of them were migrated to Git+GitLab:

  • gamelib
  • ganelon
  • geometry
  • ginseng
  • glouton
  • gsharp
  • gtk-cffi
  • html-template
  • hyperdoc
  • hyperspec-lookup
  • ieeefp-tests
  • imago
  • iso8601-date
  • jnil
  • lambda-gtk
  • lgtk
  • lispfaq
  • lispy
  • lmud
  • log4cl
  • mcclim
  • meta-cvs
  • misc-extensions
  • morphologie
  • movitz
  • nio
  • noctool
  • pal
  • pg
  • phemlock
  • plain-odbc
  • rfc2388
  • rfc2822
  • rjain-utils
  • rucksack
  • sapaclisp
  • sb-simd
  • snmp1
  • spray
  • stamp
  • s-xml
  • s-xml-rpc
  • trivial-freeimage
  • unetwork
  • zip
  • zlib

Now that the CVS repositories have been migrated, we'll move to clean up the cvs services from the underlying box and preparations will start to migrate the Darcs repositories on the system. For progress on the Darcs repository migration, watch the clo-devel mailing list.

2015-05-03

The next batch of CVS projects has been migrated. None of the projects opted to move to Subversion, so all of them were migrated to Git+GitLab:

  • cl-magick
  • cl-menusystem
  • cl-mp3-parse
  • closure
  • clouchdb
  • cl-plus-ssl
  • cl-ppcre
  • cl-prevalence
  • cl-rope
  • cl-sbml
  • cl-screen
  • cl-selenium
  • cl-semantic
  • cl-smogames
  • cl-smtp
  • cl-snmp
  • cl-soap
  • cl-store
  • cl-syslog
  • cl-telnetd
  • cl-utilities
  • cl-wav-synth
  • cl-who
  • cl-x86-asm
  • cl-xmms
  • cl-xmpp
  • corman-sdl
  • cparse
  • crypticl
  • cxml
  • defdoc
  • defeditor
  • definer
  • defplayer
  • defwm
  • eclipse
  • elephant
  • fetter
  • flexichain
  • fomus

2015-04-27

GitLab project fixes issues reported by common-lisp.net admin: loading of commit data.

2015-04-26

The next batch of CVS projects has been migrated. None of the projects opted to move to Subversion, so all of them were migrated to Git+GitLab:

  • cinline
  • cl-blog
  • cl-carbon
  • cl-cli-parser
  • cl-cracklib
  • cl-dbf
  • cldoc
  • cl-enumeration
  • cl-fltk
  • cl-godb
  • cl-gsl
  • climacs
  • clim-desktop
  • cl-interpol
  • cl-ipc
  • cl-jpeg
  • cl-libtai

2015-04-22

GitLab has been upgraded to 7.10.0; one of the tickets we filed with the GitLab project, has been resolved now.

2015-04-19

Migration of CVS repositories to Git+GitLab has started. The first batch (10 projects) was converted:

  • anaphora
  • aspiwork-pdm
  • bayescl
  • beep
  • beirc
  • bese
  • cello
  • cells
  • cells-gtk
  • cells-ode

In total there are 120 CVS repositories to convert. Project members receive an announcement mail in advance. CVS repositories which are left behind after conversion to another VC will be skipped and projects which are in such a situation are kindly requested to notify the admins of such situation - or even better: clean it up before the admins run into it. Now is your chance! :-)

2015-04-17

GitLab upgraded to 7.9.4

2015-04-11

The first projects with CVS repositories have received e-mails about the planned migration according to the proposed procedure. We're going in batches, using aphabetical order, so you may not have received e-mail for your projects yet. Don't dispair, it'll come!

The announcement e-mail requires action if you want to migrate to Subversion instead of to Git. If you want to migrate to Git+GitLab, there's no need to respond. It's the default.

If you want to declare that your project wants to migrate to Subversion without awaiting your announcement e-mail, please file a ticket in the site's Trac instance.

2015-04-08

Due to a variety of reasons, the history of the mailing lists of common-lisp.net had spread over a number of sources:

  • the older system's mailman list manager's history (mbox format)
  • the intermediately used mlmmj list manager's history (spool directory, individual mails)
  • the new system's mailman list manager's history (mbox format)

With only the archives from the last bullet hosted in viewable form, valuable Common Lisp history and coding advice collected over the years has been unavailable for at least 9 months.

Now, this long-overdue task has finally been completed. The mailing list history can be browsed and indexed again from the online archive

2015-03-27

Today we enabled project imports from GitHub. Should you want to import your project (which should import both the repository and the issues) into gitlab, please check out gitlab documentation for the github import workflow.

As part of the effort to enable GitHub imports, we had to do a minor GitLab upgrade. The current hosted GitLab version is now 7.9.1.

Another part of enabling GitHub imports was to allow users to log in on our site using their GitHub credentials. Please note that this will only work for those who already have a valid (i.e. pre-existing and confirmed) GitLab account. If you want to use this option (which is also available for Google accounts), please check the GitLab omniauth for existing users documentation.

2015-03-24

GitLab upgraded to 7.9.0. GitLab released its newest version (7.9.0) on the Sunday after the Friday we went live with our self-hosted GitLab (7.8.4 -- then latest). The release contains a large number of fixes and enhancements.

2015-03-20

Our self-hosted git repository management environment gitlab.common-lisp.net is now live! During the deployment, the system was seeded with 390 users, 434 groups and 210 repositories.

The deployment itself took little over an hour, while we were able to resolve the issues we identified after completion well within the migration timeframe of 4 hours. During this time, most services were fully available. Only SSH has been impacted shortly.

If you experience any issues, please report to the site admins.

We hope you enjoy the new user experience!

2015-03-16

Today the date has been announced for the final migration of all git repositories to GitLab: Friday March 20th!

2015-03-08

While testing the seeding scripts for the new GitLab site, a number of e-mails to live users have unintentionally been sent instead of held.

The content of the messages suggests one may be able to log in on the system. When trying so, the system denies access. This is a side effect of the testing setup. In the final migration run, you will receive an account confirmation mail. A mail not distributed in the test-run. Once the account is confirmed, the system will allow changing passwords and logging in.

We're sorry for any inconvenience caused.

2015-02-19

The site admins have announced a change in policies for the mailing lists to be in effect as of March 15th, 2015. Please read the original announcement e-mail for details.

In summary, there are two changes being implemented:

  1. Subject prefix '[ ]' won't be added anymore.
  2. Moderation requests won't be held indefinitely anymore, defaulting to a hold period of 90 days (expiring the unmoderated e-mail when unhandled).

The former addresses problems with delivery of DKIM signed mail being sent through mailing lists. Changing the message headers and body may invalidate any prior DKIM signatures, leading to mailing list e-mail looking suspect to large mail receiving providers like Google and Yahoo!.

The later addresses the fact that the moderation queue is growing indefinitely, with most lists set to never expire moderation requests.

2015-02-10

The site admins identified a list of mailing lists for which contact with the list owner has been lost list for your favorite list or your name.

2015-02-08

Due to a failed system upgrade, the system experienced extended downtime on Sunday. Our apologies for any inconvenience.

The maintenance was completed successfully around 18.00 UTC and is a step towards easier maintainance for the system and support the development of new and simplified configuration.

2015-02-06

Erik Huelsmann -one of the common-lisp.net maintainers- has submitted a proposal for the nearby future of the site. Read the details in his mail to the clo-devel mailing list in the archive. Feedback is very much appreciated.

2015-02-01

The (www.)common-lisp.net domain has started using the https protocol for all its URLs. In the weeks to come, the various sub-domains will be switched too. This change has been made in response to user requests. Should you have a request too, please let us know on the [mailing list](http://mailman.common-lisp.net/cgi-bin/mailman/listinfo /clo-devel)!

2015-01-30

The mail system's criteria for accepting mail have been tightened and mail forwarding now uses SRS when the sender domain specifies an SPF policy. The changes address these issues:

  • too many spam mails entering the moderation queues
  • improved reputation of the common-lisp.net domain at Google

Google considers common-lisp.net a Bulk Sender, which means we must abide by a number of requirements to make sure mail gets accepted.

Some of the stricter criteria to accept mail on common-lisp.net are:

Mail failing SPF validation is no longer accepted.

Due to the SRS rewriting, these mails would leave common-lisp.net as legitimate mail. By rejecting these mails, we honor the policy stated by the sender domain.
-Note: We're currently not rejecting soft-failing mails.

Mail failing DKIM validation is no longer accepted

Forwarding mail which fails DKIM validation reflects poorly on common-lisp.net's reputation as a mail host. By rejecting mail failing DKIM validation, we honor the policy stated by the sender domain.

A series of requirements on the host submitting mail

By enforcing a number of requirements on the DNS configuration and protocol conformity of the hosts submitting mail to common-lisp.net, we enforce the same requirements that Google and other mail hosters enforce on us, common-lisp.net can't be used as a hub by spammers to increase legitemacy of the mail flow. Nor can accidental forwarding of spam mail hurt common-lisp.net's reputation with the large mail hosters.

2014-09-22

Hello everybody. The site moved to a shiny new server a few moments ago. Everything should work, and if it doesn't, please let us know.

You can also help us by donating.

\ No newline at end of file +
 Edit this page

Latest Common-Lisp.net news

+

2018-10-12 Intent to remove unused projects

+ +

+As per the announcement, +the site admins plan to remove the following list of projects which have been determined to neither +have a project page nor a code repository. Please contact the site admins before October 26, 2018 to +cancel project cleanup in case your project is wrongfully listed. +

+ +
    +
  • +arxana +
  • +
  • +asdf-install +
  • +
  • +asdf-packaging +
  • +
  • +boston-lisp +
  • +
  • +chemboy +
  • +
  • +cl-amqp +
  • +
  • +cl-buchberger +
  • +
  • +cl-cactus-kev +
  • +
  • +cl-captcha +
  • +
  • +cl-clickatell +
  • +
  • +cl-gdbm +
  • +
  • +cl-gtk2 +
  • +
  • +clint +
  • +
  • +cl-lazy-list +
  • +
  • +cl-lexer +
  • +
  • +cl-match +
  • +
  • +cl-ode +
  • +
  • +clotnet +
  • +
  • +cl-peg +
  • +
  • +cl-player +
  • +
  • +cl-rundown +
  • +
  • +cltl3 +
  • +
  • +cl-yacc-ebnf +
  • +
  • +decl +
  • +
  • +defmud +
  • +
  • +docutrack +
  • +
  • +innen +
  • +
  • +israel-lisp +
  • +
  • +jess-parse +
  • +
  • +lisp-interface-library +
  • +
  • +mk-defsystem +
  • +
  • +movies +
  • +
  • +objective-cl +
  • +
  • +phorplay +
  • +
  • +same +
  • +
  • +sqlisp +
  • +
  • +tioga +
  • +
  • +trivial-features +
  • +
  • +trivial-shell +
  • +
  • +ucs-sort +
  • +
  • +umpa-lumpa +
  • +
  • +xml-psychiatrist +
  • +
+ + +

2018-10-12

+ +

+Today I found some time to enable GitLab's 'reply by e-mail' functionality. +

+

+When you receive a notification e-mail from our GitLab instance, you can now send a reply to that notification. If the notification was from an issue being updated, then your reply will update the issue with a follow-up commont. +

+ +

2018-10-10

+ +

+A new version of Common-Lisp.net has been launched! +

+

+Among other things, the new site features: +

+ +
    +
  • +A site generator implemented in Common Lisp. +
  • +
  • +A gitlab pipeline for automatic deployment. +
  • +
  • +A new responsive design based on Bootstrap and new content. +
  • +
+ + +

2018-10-06

+ +

+As per the announcement in August, +the list of users with O/S level access has been cleaned up: those accounts which haven't been accessed since +2013 (and for which the owner didn't object to removal), have been removed. Home directories will be destructed +to comply with GDPR regulations. +

+

+If you once had an account and you need your access restored, please contact our admins. +

+ +

2018-02-17

+ +

+The Darcs (a distributed version control system before Git) repositories listed in our darcsweb instance +have been converted to our GitLab instance. All use of Darcs on our site +has been marked deprecated for a long time and we're happy to have found a way forward, keeping the +repository content available to more modern VCSes. +

+ +

2017-07-15

+ +

+Our server was upgraded to Stretch as part of the regular life cycle management. See our announcement. +

+ +

2015-05-25

+ +

+Today the system has been declared "CVS clean"! All remnants of CVS have been removed. +

+ +

2015-05-23

+ +

+On Friday, the system had performance problems due to slow I/O. Checking the S.M.A.R.T. parameters of the disks didn't show anything unusual. Today, the disk system reports running in degraded mode, so we ordered the failing disk to be replaced, causing only minor downtime. The disk array has been rebuilt and it's smooth sailing from here again! +

+ +

2015-05-22

+ +

+GitLab upgraded to GitLab 7.11.1. +

+ +

2015-05-15

+ +

+Proposed approach for Darcs repository migration sent out. +

+ +

2015-05-12

+ +

+The final batch of CVS projects has been migrated. None of the projects opted to move to Subversion, so all of them were migrated to Git+GitLab: +

+ +
    +
  • +gamelib +
  • +
  • +ganelon +
  • +
  • +geometry +
  • +
  • +ginseng +
  • +
  • +glouton +
  • +
  • +gsharp +
  • +
  • +gtk-cffi +
  • +
  • +html-template +
  • +
  • +hyperdoc +
  • +
  • +hyperspec-lookup +
  • +
  • +ieeefp-tests +
  • +
  • +imago +
  • +
  • +iso8601-date +
  • +
  • +jnil +
  • +
  • +lambda-gtk +
  • +
  • +lgtk +
  • +
  • +lispfaq +
  • +
  • +lispy +
  • +
  • +lmud +
  • +
  • +log4cl +
  • +
  • +mcclim +
  • +
  • +meta-cvs +
  • +
  • +misc-extensions +
  • +
  • +morphologie +
  • +
  • +movitz +
  • +
  • +nio +
  • +
  • +noctool +
  • +
  • +pal +
  • +
  • +pg +
  • +
  • +phemlock +
  • +
  • +plain-odbc +
  • +
  • +rfc2388 +
  • +
  • +rfc2822 +
  • +
  • +rjain-utils +
  • +
  • +rucksack +
  • +
  • +sapaclisp +
  • +
  • +sb-simd +
  • +
  • +snmp1 +
  • +
  • +spray +
  • +
  • +stamp +
  • +
  • +s-xml +
  • +
  • +s-xml-rpc +
  • +
  • +trivial-freeimage +
  • +
  • +unetwork +
  • +
  • +zip +
  • +
  • +zlib +
  • +
+ +

+Now that the CVS repositories have been migrated, we'll move to clean up the cvs services from the underlying box and preparations will start to migrate the Darcs repositories on the system. For progress on the Darcs repository migration, watch the clo-devel mailing list. +

+ +

2015-05-03

+ +

+The next batch of CVS projects has been migrated. None of the projects opted to move to Subversion, so all of them were migrated to Git+GitLab: +

+ +
    +
  • +cl-magick +
  • +
  • +cl-menusystem +
  • +
  • +cl-mp3-parse +
  • +
  • +closure +
  • +
  • +clouchdb +
  • +
  • +cl-plus-ssl +
  • +
  • +cl-ppcre +
  • +
  • +cl-prevalence +
  • +
  • +cl-rope +
  • +
  • +cl-sbml +
  • +
  • +cl-screen +
  • +
  • +cl-selenium +
  • +
  • +cl-semantic +
  • +
  • +cl-smogames +
  • +
  • +cl-smtp +
  • +
  • +cl-snmp +
  • +
  • +cl-soap +
  • +
  • +cl-store +
  • +
  • +cl-syslog +
  • +
  • +cl-telnetd +
  • +
  • +cl-utilities +
  • +
  • +cl-wav-synth +
  • +
  • +cl-who +
  • +
  • +cl-x86-asm +
  • +
  • +cl-xmms +
  • +
  • +cl-xmpp +
  • +
  • +corman-sdl +
  • +
  • +cparse +
  • +
  • +crypticl +
  • +
  • +cxml +
  • +
  • +defdoc +
  • +
  • +defeditor +
  • +
  • +definer +
  • +
  • +defplayer +
  • +
  • +defwm +
  • +
  • +eclipse +
  • +
  • +elephant +
  • +
  • +fetter +
  • +
  • +flexichain +
  • +
  • +fomus +
  • +
+ + +

2015-04-27

+ +

+GitLab project fixes issues reported by common-lisp.net admin: loading of commit data. +

+ +

2015-04-26

+ +

+The next batch of CVS projects has been migrated. None of the projects opted to move to Subversion, so all of them were migrated to Git+GitLab: +

+ +
    +
  • +cinline +
  • +
  • +cl-blog +
  • +
  • +cl-carbon +
  • +
  • +cl-cli-parser +
  • +
  • +cl-cracklib +
  • +
  • +cl-dbf +
  • +
  • +cldoc +
  • +
  • +cl-enumeration +
  • +
  • +cl-fltk +
  • +
  • +cl-godb +
  • +
  • +cl-gsl +
  • +
  • +climacs +
  • +
  • +clim-desktop +
  • +
  • +cl-interpol +
  • +
  • +cl-ipc +
  • +
  • +cl-jpeg +
  • +
  • +cl-libtai +
  • +
+ + +

2015-04-22

+ +

+GitLab has been upgraded to 7.10.0; one of the tickets we filed with the GitLab project, has been resolved now. +

+ +

2015-04-19

+ +

+Migration of CVS repositories to Git+GitLab has started. The first batch (10 projects) was converted: +

+ +
    +
  • +anaphora +
  • +
  • +aspiwork-pdm +
  • +
  • +bayescl +
  • +
  • +beep +
  • +
  • +beirc +
  • +
  • +bese +
  • +
  • +cello +
  • +
  • +cells +
  • +
  • +cells-gtk +
  • +
  • +cells-ode +
  • +
+ +

+In total there are 120 CVS repositories to convert. Project members receive an announcement mail in advance. CVS repositories which are left behind after conversion to another VC will be skipped and projects which are in such a situation are kindly requested to notify the admins of such situation - or even better: clean it up before the admins run into it. Now is your chance! :-) +

+ +

2015-04-17

+ +

+GitLab upgraded to 7.9.4 +

+ +

2015-04-11

+ +

+The first projects with CVS repositories have received e-mails about the planned migration according to the proposed procedure. We're going in batches, using aphabetical order, so you may not have received e-mail for your projects yet. Don't dispair, it'll come! +

+

+The announcement e-mail requires action if you want to migrate to Subversion instead of to Git. If you want to migrate to Git+GitLab, there's no need to respond. It's the default. +

+

+If you want to declare that your project wants to migrate to Subversion without awaiting your announcement e-mail, please file a ticket in the site's Trac instance. +

+ +

2015-04-08

+ +

+Due to a variety of reasons, the history of the mailing lists of common-lisp.net had spread over a number of sources: +

+ +
    +
  • +the older system's mailman list manager's history (mbox format) +
  • +
  • +the intermediately used mlmmj list manager's history (spool directory, individual mails) +
  • +
  • +the new system's mailman list manager's history (mbox format) +
  • +
+ +

+With only the archives from the last bullet hosted in viewable form, valuable Common Lisp history and coding advice collected over the years has been unavailable for at least 9 months. +

+

+Now, this long-overdue task has finally been completed. The mailing list history can be browsed and indexed again from the online archive +

+ +

2015-03-27

+ +

+Today we enabled project imports from GitHub. Should you want to import your project (which should import both the repository and the issues) into gitlab, please check out gitlab documentation for the github import workflow. +

+

+As part of the effort to enable GitHub imports, we had to do a minor GitLab upgrade. The current hosted GitLab version is now 7.9.1. +

+

+Another part of enabling GitHub imports was to allow users to log in on our site using their GitHub credentials. Please note that this will only work for those who already have a valid (i.e. pre-existing and confirmed) GitLab account. If you want to use this option (which is also available for Google accounts), please check the GitLab omniauth for existing users documentation. +

+ +

2015-03-24

+ +

+GitLab upgraded to 7.9.0. GitLab released its newest version (7.9.0) on the Sunday after the Friday we went live with our self-hosted GitLab (7.8.4 -- then latest). The release contains a large number of fixes and enhancements. +

+ +

2015-03-20

+ +

+Our self-hosted git repository management environment gitlab.common-lisp.net is now live! During the deployment, the system was seeded with 390 users, 434 groups and 210 repositories. +

+

+The deployment itself took little over an hour, while we were able to resolve the issues we identified after completion well within the migration timeframe of 4 hours. During this time, most services were fully available. Only SSH has been impacted shortly. +

+

+If you experience any issues, please report to the site admins. +

+

+We hope you enjoy the new user experience! +

+ +

2015-03-16

+ +

+Today the date has been announced for the final migration of all git repositories to GitLab: Friday March 20th! +

+ +

2015-03-08

+ +

+While testing the seeding scripts for the new GitLab site, a number of e-mails to live users have unintentionally been sent instead of held. +

+

+The content of the messages suggests one may be able to log in on the system. When trying so, the system denies access. This is a side effect of the testing setup. In the final migration run, you will receive an account confirmation mail. A mail not distributed in the test-run. Once the account is confirmed, the system will allow changing passwords and logging in. +

+

+We're sorry for any inconvenience caused. +

+ +

2015-02-19

+ +

+The site admins have announced a change in policies for the mailing lists to be in effect as of March 15th, 2015. Please read the original announcement e-mail for details. +

+

+In summary, there are two changes being implemented: +

+ +
    +
  1. +Subject prefix '[<mailing-list>]' won't be added anymore. +
  2. +
  3. +Moderation requests won't be held indefinitely anymore, defaulting to a hold period of 90 days (expiring the unmoderated e-mail when unhandled). +
  4. +
+ +

+The former addresses problems with delivery of DKIM signed mail being sent through mailing lists. Changing the message headers and body may invalidate any prior DKIM signatures, leading to mailing list e-mail looking suspect to large mail receiving providers like Google and Yahoo!. +

+

+The later addresses the fact that the moderation queue is growing indefinitely, with most lists set to never expire moderation requests. +

+ +

2015-02-10

+ +

+The site admins identified a list of mailing lists for which contact with the list owner has been lost list for your favorite list or your name. +

+ +

2015-02-08

+ +

+Due to a failed system upgrade, the system experienced extended downtime on Sunday. Our apologies for any inconvenience. +

+

+The maintenance was completed successfully around 18.00 UTC and is a step towards easier maintainance for the system and support the development of new and simplified configuration. +

+ +

2015-02-06

+ +

+Erik Huelsmann -one of the common-lisp.net maintainers- has submitted a proposal for the nearby future of the site. Read the details in his mail to the clo-devel mailing list in the archive. Feedback is very much appreciated. +

+ +

2015-02-01

+ +

+The (www.)common-lisp.net domain has started using the https protocol for all its URLs. In the weeks to come, the various sub-domains will be switched too. This change has been made in response to user requests. Should you have a request too, please let us know on the [mailing list](http://mailman.common-lisp.net/cgi-bin/mailman/listinfo + /clo-devel)! +

+ +

2015-01-30

+ +

+The mail system's criteria for accepting mail have been tightened and mail forwarding now uses SRS when the sender domain specifies an SPF policy. The changes address these issues: +

+ +
    +
  • +too many spam mails entering the moderation queues +
  • +
  • +improved reputation of the common-lisp.net domain at Google +
  • +
+ +

+Google considers common-lisp.net a Bulk Sender, which means we must abide by a number of requirements to make sure mail gets accepted. +

+

+Some of the stricter criteria to accept mail on common-lisp.net are: +

+

+Mail failing SPF validation is no longer accepted. +

+

+Due to the SRS rewriting, these mails would leave common-lisp.net as legitimate mail. By rejecting these mails, we honor the policy stated by the sender domain.
+Note: We're currently not rejecting soft-failing mails. +

+

+Mail failing DKIM validation is no longer accepted +

+

+Forwarding mail which fails DKIM validation reflects poorly on common-lisp.net's reputation as a mail host. By rejecting mail failing DKIM validation, we honor the policy stated by the sender domain. +

+

+A series of requirements on the host submitting mail +

+

+By enforcing a number of requirements on the DNS configuration and protocol conformity of the hosts submitting mail to common-lisp.net, we enforce the same requirements that Google and other mail hosters enforce on us, common-lisp.net can't be used as a hub by spammers to increase legitemacy of the mail flow. Nor can accidental forwarding of spam mail hurt common-lisp.net's reputation with the large mail hosters. +

+ +

2014-09-22

+ +

+Hello everybody. The site moved to a shiny new server a few moments ago. Everything should work, and if it doesn't, please let us know. +

+

+You can also help us by donating. +

\ No newline at end of file diff --git a/globals.lisp b/globals.lisp index a4bf6d7..fca026c 100644 --- a/globals.lisp +++ b/globals.lisp @@ -24,21 +24,6 @@ (defparameter *PRIVATE-KEYS* '(:slug :content)) -(defun populate-pages () - (mapcar (lambda (p) - (list (cons :content (file-namestring p)) - (cons :title (file-namestring p)))) - ;; - ;; At this point there could be duplicate, i.e. a .html and a .lisp file. - ;; - (append - (directory (make-pathname :defaults *PAGES-DIR* :name :wild :type "html")) - (directory (make-pathname :defaults *PAGES-DIR* :name :wild :type "lisp"))))) - - -(defparameter *PAGES* (populate-pages) - "Each page is an alist containing info to be sent to the template via the context.") - ;; Initialize global context (will be appended to all individual page contexts) ;; Used to store things like stylesheets, etc... (defparameter *GLOBAL-CONTEXT* ()) diff --git a/helpers.lisp b/helpers.lisp index 5f520cd..9894c74 100644 --- a/helpers.lisp +++ b/helpers.lisp @@ -14,4 +14,71 @@ (with-open-file (stream filepath) (let ((data (make-string (file-length stream)))) (read-sequence data stream) - data))) \ No newline at end of file + data))) + + +(defun populate-pages () + "Each page is an alist containing info to be sent to the template via the context." + (mapcar (lambda (p) + (list (cons :content (file-namestring p)) + (cons :title (file-namestring p)))) + ;; + ;; At this point there could be duplicate, i.e. a .html and a .lisp file. + ;; + (append + (directory (make-pathname :defaults *PAGES-DIR* :name :wild :type "html")) + (directory (make-pathname :defaults *PAGES-DIR* :name :wild :type "lisp"))))) + + +(defun page-content (page) (rest (assoc :content page))) + + +(defun add-content (&key headers-plist html-string) + (setq *computed-page-content* (list :headers headers-plist :html-string html-string))) + +;; +;; FLAG -- the following are from Gendl - remove if/when we start :depending +;; on :gendl or :gwl +;; +(defun plist-keys (plist) + "List of keyword symbols. Returns the keys from a plist. + +:arguments (plist \"Plist\")" + (when plist + (cons (first plist) + (plist-keys (rest (rest plist)))))) + +(defun plist-values (plist) + "List of Lisp objects. Returns the values from a plist. + +:arguments (plist \"Plist\")" + (when plist + (cons (second plist) + (plist-values (rest (rest plist)))))) + +(defmacro with-cl-who-string ((&rest args) &body body) + + "Form. Sets up body to be evaluated with cl-who:with-html-output and return the resulting string instead +of writing to a stream." + + (let ((ss (gensym))) + `(with-output-to-string (,ss) + (cl-who:with-html-output (,ss nil ,@args) ,@body)))) + + +(defmacro wmd (string) + "Form suitable for inclusion in cl-who LHTML context. Returns an + `str` form after passing it through cl-markdown's markdown processor. +" + ;; + ;; FLAG -- should we be checking for loaded markdown package at compile-time instead? + ;; + `(cl-who:str (cond ((find-package :markdown.cl) + (funcall (read-from-string "markdown.cl:parse") ,string)) + ((find-package :cl-markdown) + (with-output-to-string (ss) + (funcall (read-from-string "cl-markdown:markdown") ,string :stream ss)))))) + +;; +;; End of Gendl utilities. +;; diff --git a/main.lisp b/main.lisp index e009f59..666cb48 100644 --- a/main.lisp +++ b/main.lisp @@ -5,7 +5,7 @@ (let ((*output-dir* (or output-dir *output-dir*))) (format t "Generating site in ~A.~%" *output-dir*) (process-static) - (process-pages *pages*))) + (process-pages (populate-pages)))) (defun make-clean (&optional (output-dir *output-dir*)) diff --git a/process.lisp b/process.lisp index fd3135a..cae5f16 100644 --- a/process.lisp +++ b/process.lisp @@ -49,7 +49,7 @@ (header content) (split-content-from-header page-path) (let* ((header-text (format nil "~{~A~%~}" header)) - (content-text (format nil "~{~A~%~}" (remove nil content))) + (content-text (format nil "~{~A~%~}" content)) (parsed-header (yaml:parse header-text)) (page-context (when parsed-header @@ -65,8 +65,6 @@ - - (defun process-pages (pages) (format t "Processing pages...~%") @@ -77,7 +75,7 @@ (let ((template-path (pathname (merge-pathnames *LAYOUT-DIR* *DEFAULT-PAGE-TEMPLATE*)))) (ensure-directories-exist *OUTPUT-DIR*) - (setq pages (populate-pages)) + (setq pages (populate-pages)) ;; to pick up any newly generated .html files. (dolist (page pages) (let ((page-pathname (merge-pathnames (page-content page) *pages-dir*))) (when (string-equal (pathname-type page-pathname) "html") @@ -95,14 +93,16 @@ (let* ((lisp-file (page-content page))) (when (string-equal (pathname-type lisp-file) "lisp") (let ((html-file (make-pathname :defaults lisp-file :type "html"))) - (format t "Compile/loading ~a and creating fresh ~a...~%" + (format t "Loading ~a and creating fresh ~a...~%" (file-namestring lisp-file) html-file) - (let ((fasl (compile-file (merge-pathnames lisp-file *pages-dir*))) - *computed-page-content*) - (load fasl) (delete-file fasl) + (let (*computed-page-content*) + (load (merge-pathnames lisp-file *pages-dir*)) (with-open-file (out (merge-pathnames html-file *pages-dir*) :if-exists :supersede :if-does-not-exist :create :direction :output) - (format out "title: ~a~%---~%" (getf *computed-page-content* :title)) + (let ((headers (getf *computed-page-content* :headers))) + (mapc #'(lambda(key value) (format out "~a: ~a~%" key value)) + (plist-keys headers)(plist-values headers))) + (format out "---~%") (write-string (getf *computed-page-content* :html-string) out)))))))) ;; Process news @@ -118,7 +118,7 @@ ;; (defun generate-news () (let ((html - (markdown:parse-file (merge-pathnames "news.md" *PAGES-DIR*)))) + (markdown.cl:parse-file (merge-pathnames "news.md" *PAGES-DIR*)))) (with-open-file (f (merge-pathnames "news.html" *PAGES-DIR*) :direction :output :if-does-not-exist :create @@ -196,34 +196,8 @@ (plump:serialize news nil)))) -(defmacro with-cl-who-string ((&rest args) &body body) - - "Form. Sets up body to be evaluated with cl-who:with-html-output and return the resulting string instead -of writing to a stream." - - (let ((ss (gensym))) - `(with-output-to-string (,ss) - (cl-who:with-html-output (,ss nil ,@args) ,@body)))) - - -(defmacro wmd (string) - "Form suitable for inclusion in cl-who LHTML context. Returns an - `str` form after passing it through cl-markdown's markdown processor. -" - ;; - ;; FLAG -- should we be checking for loaded markdown package at compile-time instead? - ;; - `(cl-who:str (cond ((find-package :markdown.cl) - (funcall (read-from-string "markdown.cl:parse") ,string)) - ((find-package :cl-markdown) - (with-output-to-string (ss) - (funcall (read-from-string "cl-markdown:markdown") ,string :stream ss)))))) - -(defun page-content (page) (rest (assoc :content page))) -(defun add-content (&key title html-string) - (setq *computed-page-content* (list :title title :html-string html-string))) -- GitLab