diff --git a/Makefile b/Makefile index 872e518..0e29fa3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC?=cc -CFLAGS?=-pedantic -Wall -Wextra +CFLAGS?=-pedantic -Wall -Wextra -s -Os all: $(CC) $(CFLAGS) img.c -o 8img diff --git a/config.h b/config.h index 75a4dec..5a76a51 100644 --- a/config.h +++ b/config.h @@ -1,7 +1,7 @@ #define TITLE "8img gallery" -#define POST_PER_PAGE 10 +#define POST_PER_PAGE 5 /* Absolute path to */ -#define ROOT "8img_dir" +#define ROOT "." #define DB ROOT"/db" -#define CSS ROOT"/styles.css" +#define CSS ROOT"/style.css" diff --git a/img.c b/img.c index 58dc405..c684b8e 100644 --- a/img.c +++ b/img.c @@ -239,13 +239,13 @@ RDB_CLOSE: } struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, struct DB_STR *db, const size_t page, const size_t pages) { - fprintf(fp, "\n\n\n%s\n\n", CSS, TITLE); + fprintf(fp, "\n\n\n%s\n\n\n
", CSS, TITLE); /* Tags */ - fputs("\n

\n [all] ", fp); + fputs("\n [all] ", fp); for (size_t i = 0; i < ut.size; i++) - fprintf(fp, " [%s] ", ut.tags[i], ut.tags[i]); - fputs("


\n
\n", fp); + fprintf(fp, " [%s] ", ut.tags[i], ut.tags[i]); + fputs("\n


\n", fp); /* Images */ size_t images = 0; @@ -264,11 +264,11 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, } } - fprintf(fp, "
%s


\n", p->filename, p->filename, p->filename); + fprintf(fp, "%s
", p->filename, p->filename, p->filename); for (size_t i = 0; i < p->size; i++) - fprintf(fp, " %s", p->tags[i], p->tags[i]); + fprintf(fp, " %s", p->tags[i], p->tags[i]); - fputs("\n

\n", fp); + fputs("\n


\n", fp); p = i; images++; @@ -279,10 +279,10 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, for (size_t i = 0; i <= pages; i++) { if (i == 0) { if (i == page) - fprintf(fp, "(0) ", file); + fprintf(fp, "(0) ", file); else - fprintf(fp, "[0] ", file); + fprintf(fp, "[0] ", file); } else { @@ -290,15 +290,15 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, snprintf(new_path, sizeof(new_path), "%s-%zu.html", file, i); if (i == page) - fprintf(fp, "(%zu) ", new_path, i); + fprintf(fp, "(%zu) ", new_path, i); else - fprintf(fp, "[%zu] ", new_path, i); + fprintf(fp, "[%zu] ", new_path, i); } } - fprintf(fp, "\n"); + fprintf(fp, "\n
\n\n\n"); return p; } diff --git a/style.css b/style.css new file mode 100644 index 0000000..18a1303 --- /dev/null +++ b/style.css @@ -0,0 +1,20 @@ +body { background-color: #1d2021; } + +/* Links */ +a { text-decoration: none; } +#tags { color: 8ec07c;} +#pager { color: #b16286; } +#alltags { color: #83a598; } + +#bar { + width: 100%; + height: 10px; + background-color: #ebdbb2; +} + +img { + height: auto; + width: auto; + max-width: 50%; + max-height: 50%; +}