Blog Software done
This commit is contained in:
parent
97401ebcf9
commit
8b688d1428
|
@ -1,3 +1,4 @@
|
||||||
*.swp
|
*.swp
|
||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
|
blogs.html
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -16,20 +16,23 @@ install:
|
||||||
mkdir -p blogs
|
mkdir -p blogs
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
rm -rf blogs/*.html
|
||||||
|
rm -rf ./blogs.html
|
||||||
rm -rf obj
|
rm -rf obj
|
||||||
rm -rf bin
|
rm -rf bin
|
||||||
|
|
||||||
blog: all
|
blog: all
|
||||||
@# Reset all blogs to start build.
|
@# Reset all blogs to start build.
|
||||||
-rm -rf blogs/*.html
|
|
||||||
@# Setup boilerplate html files for blog files
|
@# Setup boilerplate html files for blog files
|
||||||
-@for blog in ./blogs/RawBlogs/*.blog ; do \
|
-@for blog in ./blogs/RawBlogs/*.blog ; do \
|
||||||
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
|
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
|
||||||
cp ./blogs/preamble/start.html ./blogs/$$blog.html; \
|
cp ./blogs/preamble/start.html ./blogs/$$blog.html; \
|
||||||
done
|
done
|
||||||
|
-@cp ./blogs/preamble/start.html ./blogs.html
|
||||||
./bin/GenBlog
|
./bin/GenBlog
|
||||||
@# Append the end of the file once done
|
@# Append the end of the file once done
|
||||||
-@for blog in ./blogs/RawBlogs/*.blog ; do \
|
-@for blog in ./blogs/RawBlogs/*.blog ; do \
|
||||||
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
|
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
|
||||||
cat ./blogs/preamble/end.html >> ./blogs/$$blog.html; \
|
cat ./blogs/preamble/end.html >> ./blogs/$$blog.html; \
|
||||||
done
|
done
|
||||||
|
-@cat ./blogs/preamble/end.html >> ./blogs.html
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<a href="https://github.com/kisslinux/website">View page source</a>
|
<a href="https://github.com/skippy404/skippy404,github.io">View page source</a>
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
@ -32,6 +32,6 @@
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
<span style='color:#e60000'> 🅱️ </span><a href=http://yggpi.co.za><b>HOME</b></a><span style='color:#e60000'> 🅱️</span>
|
<span style='color:#e60000'> 🅱️ </span><a href=/><b>HOME</b></a><span style='color:#e60000'> 🅱️</span>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
}
|
}
|
||||||
</style><pre>
|
</style><pre>
|
||||||
|
|
||||||
<a href=http://yggpi.co.za><b>HOME</b></a> <a href=./setup.html>My Setup</a> <a href=http://blog.yggpi.co.za:8880/>Blog</a> <a href=http://yggpi.co.za/install.sh>Install dotfiles</a> <a href=http://proj.yggpi.co.za:8882/projects>Projects</a> <a href=https://github.com/skippy404>My Github</a>
|
<a href=/><b>HOME</b></a> <a href=./setup.html>My Setup</a> <a href=./blogs.html>Blog</a> <a href=http://yggpi.co.za/install.sh>Install dotfiles</a> <a href=http://proj.yggpi.co.za:8882/projects>Projects</a> <a href=https://github.com/skippy404>My Github</a>
|
||||||
|
|
||||||
<a href=http://git.yggpi.co.za:8883/explore>My Git Server</a> <a href=http://irc.yggpi.co.za:8881/>IRC Webclient (Channel: #club45)</a>
|
<a href=http://git.yggpi.co.za:8883/explore>My Git Server</a> <a href=http://irc.yggpi.co.za:8881/>IRC Webclient (Channel: #club45)</a>
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
}
|
}
|
||||||
</style><pre>
|
</style><pre>
|
||||||
|
|
||||||
<span style='color:#e60000'> 🅱️ </span><a href=http://yggpi.co.za><b>HOME</b></a><span style='color:#e60000'> 🅱️</span>
|
<span style='color:#e60000'> 🅱️ </span><a href=/><b>HOME</b></a><span style='color:#e60000'> 🅱️</span>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
+-------------------------------------------------------+
|
+-------------------------------------------------------+
|
||||||
|
|
|
@ -19,6 +19,7 @@ int main() {
|
||||||
struct dirent *ent;
|
struct dirent *ent;
|
||||||
char buff[256];
|
char buff[256];
|
||||||
char htmlName[256];
|
char htmlName[256];
|
||||||
|
char link[256];
|
||||||
char cat[2];
|
char cat[2];
|
||||||
char *c;
|
char *c;
|
||||||
int i;
|
int i;
|
||||||
|
@ -27,6 +28,7 @@ int main() {
|
||||||
while ((ent = readdir(dir)) != NULL) {
|
while ((ent = readdir(dir)) != NULL) {
|
||||||
if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..")) {
|
if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..")) {
|
||||||
sprintf(htmlName, "./blogs/");
|
sprintf(htmlName, "./blogs/");
|
||||||
|
sprintf(link, "");
|
||||||
|
|
||||||
c = ent->d_name;
|
c = ent->d_name;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -34,15 +36,25 @@ int main() {
|
||||||
cat[0] = c[i];
|
cat[0] = c[i];
|
||||||
cat[1] = '\0';
|
cat[1] = '\0';
|
||||||
strcat(htmlName, cat);
|
strcat(htmlName, cat);
|
||||||
|
strcat(link, cat);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
strcat(htmlName, ".html");
|
strcat(htmlName, ".html");
|
||||||
|
|
||||||
printf("%s\n", htmlName);
|
printf("%s\n", htmlName);
|
||||||
sprintf(buff, "./blogs/RawBlogs/");
|
sprintf(buff, "./blogs/RawBlogs/");
|
||||||
strcat(buff, ent->d_name);
|
strcat(buff, ent->d_name);
|
||||||
printf("opening, %s, %s|\n", buff, htmlName);
|
printf("opening, %s, %s, %s\n", buff, htmlName, link);
|
||||||
chtml = fopen(htmlName, "a+");
|
chtml = fopen(htmlName, "a+");
|
||||||
genBP(buff);
|
genBP(buff);
|
||||||
|
// Add links now
|
||||||
|
chtml = fopen("./blogs.html", "a+");
|
||||||
|
append_html("<center><a href=");
|
||||||
|
append_html(htmlName);
|
||||||
|
append_html(">");
|
||||||
|
append_html(link);
|
||||||
|
append_html("</a></center>\n");
|
||||||
|
fclose(chtml);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue