summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2019-12-31 16:11:36 +1030
committerDaniel Jones <admin@danieljon.es>2019-12-31 16:11:36 +1030
commitddebb616f923bc8abd9e1176b0cfdf7d8cab78d7 (patch)
tree1bef0fff26f2f2f65c884930ac7ac123be363e83
parente561e23c31040d1ad355fcce2e81feaa7daf9cde (diff)
downloadwebsitegenerator-ddebb616f923bc8abd9e1176b0cfdf7d8cab78d7.tar.gz
websitegenerator-ddebb616f923bc8abd9e1176b0cfdf7d8cab78d7.zip
added array of posts to ignore
-rw-r--r--config.h1
-rw-r--r--pages.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/config.h b/config.h
index 6bf0cbf..326e7bb 100644
--- a/config.h
+++ b/config.h
@@ -91,6 +91,7 @@ static const char *posts_info = "<h1>Posts</h1>My posts about programming and t
static const char *posts_content = "content/blog/";
static const char *posts_output_dir = "posts/";
static const int posts_per_page = 10;
+static const int ignore[] = {}; /* ignore these posts */
/* each page to be generated go into this array */
static const struct page pages[] = {
diff --git a/pages.c b/pages.c
index 68cf100..86a30f0 100644
--- a/pages.c
+++ b/pages.c
@@ -484,6 +484,18 @@ postspage(int flags)
{
if (strstr(ent->d_name, ".txt") != NULL)
{
+ int ign = 0;
+ /* check if post should be ignored */
+ for (int i = 0; i < sizeof(ignore)/sizeof(ignore[0]); i++)
+ {
+ if (atoi(ent->d_name) == ignore[i])
+ {
+ printf("ignoring post %d\n", atoi(ent->d_name));
+ ign = 1;
+ }
+ }
+ if (ign)
+ continue;
posts[totalposts] = atoi(ent->d_name); // gross
totalposts++;
}