Procházet zdrojové kódy

Add a link to the post in each RSS entry.

default před 3 roky
rodič
revize
e11fc49fd7
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      html.c

+ 4 - 0
html.c

@@ -1136,6 +1136,10 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
             content = xs_replace_i(content, "<", "&lt;");
             content = xs_replace_i(content, ">", "&gt;");
 
+            /* add the post link */
+            xs *l = xs_fmt("<p><a href=\"%s\">%s</a><p>", id, id);
+            content = xs_str_cat(content, l);
+
             if (strlen(title) > 40)
                 title = xs_crop(title, 0, i = 40);