Introduction
Introduction Statistics Contact Development Disclaimer Help
adding a way to choose the number of rss items - cl-yag - Common Lisp Yet Anoth…
git clone git://bitreich.org/cl-yag/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws…
Log
Files
Refs
Tags
README
LICENSE
---
commit 76baf068a53ee155aa4850c0beac0ecfeb51b59d
parent 5224dea43a91267d621f6ed78fcea25ed5c67243
Author: solene rapenne <[email protected]>
Date: Wed, 8 Jun 2016 12:25:02 +0200
adding a way to choose the number of rss items
Diffstat:
M README.md | 10 ++++++++++
M data/articles.lisp | 1 +
M generator.lisp | 4 +++-
3 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/README.md b/README.md
@@ -23,6 +23,16 @@ Here are the files and folder of cl-yag :
# Usage
+## Configuration
+
+In data/articles.lisp there is a ***config*** variable with the following fiel…
+
++ **:webmaster** : The name of the default author, this is the name used when …
++ **:title** : The title of the webpage
++ **:description** : This text is used in the *description* field of the Atom …
++ **:url** : This is the full url of the blog with the final slash. If the url…
++ **:rss-item-number** : This is the number of RSS items you want to published…
+
## How to add an article
Edit data/articles.lisp and add a new line inside the *articles* variable like…
diff --git a/data/articles.lisp b/data/articles.lisp
@@ -10,6 +10,7 @@
:title "Your blog title here"
:description "Yet another website on the net"
:url "https://my.website/~~user/" ;; the trailing slash is mandatory, rss l…
+ :rss-item-number 10 ;; we want 10 items in our RSS feed
))
;; describes articles (ordered on the website as they are displayed here, the …
diff --git a/generator.lisp b/generator.lisp
@@ -131,7 +131,9 @@
;; xml generation of the items for the rss
(defun generate-rss-item()
(strip-quotes
- (loop for article in *articles* collect
+ (loop for article in *articles*
+ for i from 1 to (if (> (length *articles*) (getf *config* :rss-item-n…
+ collect
(prepare "template/rss-item.tpl"
(template "%%Title%%" (getf article :title))
(template "%%Description%%" (load-file (format nil "data/~d.…
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.