diff --git a/data.c b/data.c index bbd0e0c..7197320 100644 --- a/data.c +++ b/data.c @@ -156,6 +156,14 @@ int srv_open(const char *basedir, int auto_upgrade) /* read (and drop) emojis.json, possibly creating it */ xs_free(emojis()); + /* if style.css does not exist, create it */ + xs *css_fn = xs_fmt("%s/style.css", srv_basedir); + + if (mtime(css_fn) == 0) { + srv_log(xs_fmt("Writing style.css")); + write_default_css(); + } + return ret; } diff --git a/snac.h b/snac.h index 8f02f0a..65bfb84 100644 --- a/snac.h +++ b/snac.h @@ -347,6 +347,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, char **body, int *b_size, char **ctype); xs_str *timeline_to_rss(snac *user, const xs_list *timeline, char *title, char *link, char *desc); +int write_default_css(void); int snac_init(const char *_basedir); int adduser(const char *uid); int resetpwd(snac *snac); diff --git a/utils.c b/utils.c index d5c2ee4..09a201b 100644 --- a/utils.c +++ b/utils.c @@ -107,6 +107,22 @@ static const char *greeting_html = "
This site is powered by snac.
\n" "