浏览代码

New feature: provides specific content ONLY on the index file

Carlos Fenollosa 5 年之前
父节点
当前提交
c126913cdd
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 1 0
      README.md
  2. 6 3
      bb.sh

+ 1 - 0
README.md

@@ -132,6 +132,7 @@ As a guideline, pull requests should:
 Changelog
 ---------
 
+- 2.9      Added `body_begin_file_index`
 - 2.8      Bugfixes<br/>
            Slavic language support thanks to Tomasz Jadowski<br/>
            Removed the now defunct Twitter JSON API share count<br/>

+ 6 - 3
bb.sh

@@ -17,7 +17,7 @@ global_config=".config"
 # by the 'global_config' file contents
 global_variables() {
     global_software_name="BashBlog"
-    global_software_version="2.8"
+    global_software_version="2.9"
 
     # Blog title
     global_title="My fancy blog"
@@ -95,9 +95,11 @@ global_variables() {
     # extra content to add just after we open the <body> tag
     # and before the actual blog content
     body_begin_file=""
-    # extra content to add just before we cloese <body tag (just before
-    # </body>)
+    # extra content to add just before we close </body>
     body_end_file=""
+    # extra content to ONLY on the index page AFTER `body_begin_file` contents
+    # and before the actual content
+    body_begin_file_index=""
     # CSS files to include on every page, f.ex. css_include=('main.css' 'blog.css')
     # leave empty to use generated
     css_include=()
@@ -433,6 +435,7 @@ create_html_page() {
         echo "</head><body>"
         # stuff to add before the actual body content
         [[ -n $body_begin_file ]] && cat "$body_begin_file"
+        [[ $filename = $index_file* ]] && [[ -n $body_begin_file_index ]] && cat "$body_begin_file_index"
         # body divs
         echo '<div id="divbodyholder">'
         echo '<div class="headerholder"><div class="header">'