神刀安全网

ECL News: New website look

New website look

Tagged asnews, content

Written by jackdaniel on 2016-04-22

I’ve imported the old archives and genearated ECL website with help of the coleslaw and the sclp . Now we have a properRSS feed and posting news is less annoying then before.

For posterity, here is the ugly hack I’ve used to import archives from JSON:

(defparameter *archives-template*   ";;;;; title: ~A tags: date: ~A author: ~A format: md ;;;;;  ~A")  (setf *json-posts*   (with-open-file (f #P"/home/jack/linki/repo/ecl-website/static/files/misc/news-ecl-backup-2015-08-25.json"                      :direction :input                      :external-format '(:line-termination :cr :character-encoding :utf-8))     (cl-json:decode-json f)))  (mapcar (let ((cnt 0))           #'(lambda (post)               (with-open-file (f (format nil "/tmp/archives/archive-~A.post" (incf cnt))                                  :direction :output                                  :if-exists :supersede                                  :external-format (make-external-format :line-termination :unix))                 (format f *archives-template*                         (cdr (assoc :title post))                         ;; (cdr (assoc :labels post))                         (substitute #/- #//                                     (subseq (cdr (assoc :url post)) 40 47))                         (let ((author (cdr (assoc :author post))))                           (if (string-equal author "dkochmanski")                               "jackdaniel" author))                         (remove #/Return (cdr (assoc :text post)))))))         (cdar *json-posts*))

You may find a guide how to use the Sample Common Lisp Project template for your own project here . The clnet theme is inspired by the css in most of the common-lisp.net projects.

Best regards, Daniel

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » ECL News: New website look

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址