changeset 1004:bab5200701ad

tag: simplify tag page processing The code used to handle both tags and categories, but since category support got removed there was a layer of indirection that wasn't needed. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Fri, 01 Feb 2019 21:16:37 -0500
parents 53238409d23e
children 245ce483da3f
files tag.c
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/tag.c	Fri Feb 01 16:26:29 2019 -0500
+++ b/tag.c	Fri Feb 01 21:16:37 2019 -0500
@@ -61,13 +61,14 @@
 	vars_set_int(vars, "nextpage", page - 1);
 }
 
-int __tagcat(struct req *req, struct str *tag, int page, char *tmpl,
-	     bool istag)
+int blahg_tag(struct req *req, int page)
 {
 	const unsigned int posts_per_page = req->opts.index_stories;
 	struct post *posts[posts_per_page];
+	struct str *tag;
 	int nposts;
 
+	tag = nvl_lookup_str(req->scgi->request.query, "tag");
 	if (IS_ERR(tag))
 		return R404(req, NULL);
 
@@ -88,17 +89,11 @@
 
 	str_putref(tag);
 
-	req->scgi->response.body = render_page(req, tmpl);
+	req->scgi->response.body = render_page(req, "{tagindex}");
 
 	return 0;
 }
 
-int blahg_tag(struct req *req, int page)
-{
-	return __tagcat(req, nvl_lookup_str(req->scgi->request.query, "tag"),
-			page, "{tagindex}", true);
-}
-
 /*
  * This is the simplest way to handle categories without needing to
  * supporting them anymore.  We simply map the category to a tag based on