Blog Software done
This commit is contained in:
parent
97401ebcf9
commit
8b688d1428
|
@ -1,3 +1,4 @@
|
|||
*.swp
|
||||
bin/
|
||||
obj/
|
||||
blogs.html
|
||||
|
|
5
Makefile
5
Makefile
|
@ -16,20 +16,23 @@ install:
|
|||
mkdir -p blogs
|
||||
|
||||
clean:
|
||||
rm -rf blogs/*.html
|
||||
rm -rf ./blogs.html
|
||||
rm -rf obj
|
||||
rm -rf bin
|
||||
|
||||
blog: all
|
||||
@# Reset all blogs to start build.
|
||||
-rm -rf blogs/*.html
|
||||
@# Setup boilerplate html files for blog files
|
||||
-@for blog in ./blogs/RawBlogs/*.blog ; do \
|
||||
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
|
||||
cp ./blogs/preamble/start.html ./blogs/$$blog.html; \
|
||||
done
|
||||
-@cp ./blogs/preamble/start.html ./blogs.html
|
||||
./bin/GenBlog
|
||||
@# Append the end of the file once done
|
||||
-@for blog in ./blogs/RawBlogs/*.blog ; do \
|
||||
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
|
||||
cat ./blogs/preamble/end.html >> ./blogs/$$blog.html; \
|
||||
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>
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
|
||||
<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>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
}
|
||||
</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>
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
}
|
||||
</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>
|
||||
+-------------------------------------------------------+
|
||||
|
|
|
@ -19,6 +19,7 @@ int main() {
|
|||
struct dirent *ent;
|
||||
char buff[256];
|
||||
char htmlName[256];
|
||||
char link[256];
|
||||
char cat[2];
|
||||
char *c;
|
||||
int i;
|
||||
|
@ -27,6 +28,7 @@ int main() {
|
|||
while ((ent = readdir(dir)) != NULL) {
|
||||
if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..")) {
|
||||
sprintf(htmlName, "./blogs/");
|
||||
sprintf(link, "");
|
||||
|
||||
c = ent->d_name;
|
||||
i = 0;
|
||||
|
@ -34,15 +36,25 @@ int main() {
|
|||
cat[0] = c[i];
|
||||
cat[1] = '\0';
|
||||
strcat(htmlName, cat);
|
||||
strcat(link, cat);
|
||||
i++;
|
||||
}
|
||||
strcat(htmlName, ".html");
|
||||
|
||||
printf("%s\n", htmlName);
|
||||
sprintf(buff, "./blogs/RawBlogs/");
|
||||
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+");
|
||||
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