only index tags of published posts
* tekuti/tags.scm (reindex-tags): Only index published posts.
This commit is contained in:
parent
1ec5fb27eb
commit
ea420f3680
1 changed files with 3 additions and 2 deletions
|
@ -30,6 +30,7 @@
|
||||||
#:use-module (tekuti config)
|
#:use-module (tekuti config)
|
||||||
#:use-module (tekuti post)
|
#:use-module (tekuti post)
|
||||||
#:use-module (tekuti git)
|
#:use-module (tekuti git)
|
||||||
|
#:use-module ((srfi srfi-1) #:select (filter))
|
||||||
#:export (tag-link reindex-tags))
|
#:export (tag-link reindex-tags))
|
||||||
|
|
||||||
(define (tag-link tagname)
|
(define (tag-link tagname)
|
||||||
|
@ -43,10 +44,10 @@
|
||||||
(lambda (post)
|
(lambda (post)
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (cat)
|
(lambda (cat)
|
||||||
(hash-push! hash cat (assq-ref post 'key)))
|
(hash-push! hash cat (post-key post)))
|
||||||
(post-tags post)))
|
(post-tags post)))
|
||||||
posts)
|
posts)
|
||||||
hash))
|
hash))
|
||||||
|
|
||||||
(define (reindex-tags old-index index)
|
(define (reindex-tags old-index index)
|
||||||
(compute-tags (assq-ref index 'posts)))
|
(compute-tags (filter post-published? (assq-ref index 'posts))))
|
||||||
|
|
Loading…
Reference in a new issue