cld-ssg

The static site generator (to be) used for hellocld.com
git clone git://git.hellocld.com/cld-ssg
Log | Files | Refs

commit 8e2161018182ecf9922d03eff173cff9d7bfdcc2
parent b6284a257206e0fe5be9b62977ce9cde8e90c675
Author: Christopher Ray Langford <chris@hellocld.com>
Date:   Mon, 30 Sep 2019 22:53:20 -0400

Bugfixes and removed content

- Fixed a bug with file copying not working right
- Removed unused image/text file
- Updated stylesheet
- Updated logo color

Diffstat:
Mfiles/images/cld-logo.png | 0
Dfiles/images/style.css | 55-------------------------------------------------------
Mfiles/style.css | 3++-
Dfiles/test.txt | 1-
Mmain.c | 13++++++++-----
5 files changed, 10 insertions(+), 62 deletions(-)

diff --git a/files/images/cld-logo.png b/files/images/cld-logo.png Binary files differ. diff --git a/files/images/style.css b/files/images/style.css @@ -1,55 +0,0 @@ -body { - background: #ddd; - font-family: sans-serif; - max-width: 600px; - margin-left: auto; - margin-right: auto; - padding-left:16px; - padding-right: 16px; -} - -header img { - max-width: 96px; - padding: 16px 8px; -} - -footer { - background-color: black; - color: #ddd; - margin: 0; - padding: 1px 8px; -} - -nav ul { - list-style-type: none; - margin: 0; - padding: 0; - background-color: black; - overflow: hidden; -} - -nav li { - float: left; -} - -nav li a { - display: block; - width: 60px; - padding: 8px; - text-decoration: none; - background-color: black; - text-align: center; - color: #ddd; -} - -nav li a:hover { - color: black; - background-color: #ddd; -} -article { - padding: 8px; -} - -article img { - max-width: 100%; -} diff --git a/files/style.css b/files/style.css @@ -50,5 +50,6 @@ article img { footer { padding: 0 8px; - color: #a09e99; + color: #373530; + font-style: italic; } \ No newline at end of file diff --git a/files/test.txt b/files/test.txt @@ -1 +0,0 @@ -test file diff --git a/main.c b/main.c @@ -267,10 +267,14 @@ void errprintf(const char *function, int error) void copy_resources(char *dir) { + printf("DEBUG: Creating directory %s\n", dir); + sprintf(buf, "%s%s", HTMLDIR, dir + strlen(RESOURCEDIR)); + create_directory(buf); char t_dest[MAX_URL_CHARS]; struct stat t_stat; /* find all files in resource directory */ struct dirent **t_files; + printf("Scanning directory %s\n", dir); int t_count = scandir(dir, &t_files, NULL, NULL); while(t_count-- > 0) { if(t_files[t_count]->d_name[0] == '.') @@ -279,11 +283,10 @@ void copy_resources(char *dir) sprintf(buf, "%s%s", dir, t_files[t_count]->d_name); stat(buf, &t_stat); if(S_ISDIR(t_stat.st_mode)) { - sprintf(buf, "%s%s%s", HTMLDIR, dir + strlen(RESOURCEDIR), t_files[t_count]->d_name); - printf("DEBUG: creating directory %s\n", buf); - create_directory(buf); - sprintf(buf, "%s%s/", dir, t_files[t_count]->d_name); - copy_resources(buf); + char t_dir[MAX_URL_CHARS]; + sprintf(t_dir, "%s%s/", dir, t_files[t_count]->d_name); + printf("Directory found: %s\n", t_dir); + copy_resources(t_dir); } if(S_ISREG(t_stat.st_mode)) { sprintf(t_dest, "%s%s", HTMLDIR, buf + strlen(RESOURCEDIR));