فهرست منبع

"Read more..." link for articles which were cut

Alexey Shpakovsky 11 سال پیش
والد
کامیت
cf6bdb027b
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      bb.sh

+ 3 - 1
bb.sh

@@ -175,6 +175,8 @@ global_variables() {
     # Localization and i18n
     # Localization and i18n
     # "Comments?" (used in twitter link after every post)
     # "Comments?" (used in twitter link after every post)
     template_comments="Comments?"
     template_comments="Comments?"
+    # "Read more..." (link under cut article on index page)
+    template_read_more="Read more..."
     # "View more posts" (used on bottom of index page as link to archive)
     # "View more posts" (used on bottom of index page as link to archive)
     template_archive="View more posts"
     template_archive="View more posts"
     # "All posts" (title of archive page)
     # "All posts" (title of archive page)
@@ -657,7 +659,7 @@ rebuild_index() {
     for i in $(ls -t *.html); do # sort by date, newest first
     for i in $(ls -t *.html); do # sort by date, newest first
         is_boilerplate_file "$i" && continue;
         is_boilerplate_file "$i" && continue;
         if [[ "$n" -ge "$number_of_index_articles" ]]; then break; fi
         if [[ "$n" -ge "$number_of_index_articles" ]]; then break; fi
-        get_html_file_content 'entry' 'entry' 'cut' <$i >> "$contentfile"
+        get_html_file_content 'entry' 'entry' 'cut' <$i | sed "s|<.-- text cut -->|<p class=\"readmore\"><a href=\"$i\">$template_read_more</a></p>|" >> "$contentfile"
         echo -n "."
         echo -n "."
         n=$(( $n + 1 ))
         n=$(( $n + 1 ))
     done
     done