diff --git a/index.js b/index.js index 090dd6c..64c9f66 100644 --- a/index.js +++ b/index.js @@ -287,7 +287,7 @@ async function getCategories(db) { return cats2 } -async function getTagCloud(db, limit) { +async function getTagCloud(db, limit, offset=0) { const tags = db.prepare(` SELECT count(t.id) as c, t.name FROM article__tag a_t @@ -296,7 +296,8 @@ async function getTagCloud(db, limit) { GROUP BY t.id ORDER BY c DESC LIMIT @limit - `).all({ limit }) + OFFSET @offset + `).all({ limit, offset }) return tags } @@ -444,5 +445,8 @@ module.exports = { getArticleCounts, getArticlesByYearMonth, getArticlesByCategory, - countArticlesByCategory + countArticlesByCategory, + getArticlesByTag, + countArticlesByTag, + countTags }