add a proper "return to albums" link in thumbnails page
authorgc <gc>
Tue, 15 Mar 2005 22:31:36 +0000 (22:31 +0000)
committergc <gc>
Tue, 15 Mar 2005 22:31:36 +0000 (22:31 +0000)
booh
themes/simple/skeleton_image.html
themes/simple/skeleton_thumbnails.html

diff --git a/booh b/booh
index f9ff560c3e29f04eaac1927067419f9b483ff4ee..1428824dbd079d0d9aad38654885f9702c93318a 100755 (executable)
--- a/booh
+++ b/booh
@@ -727,6 +727,7 @@ def walk_source_dir
                     html_index.gsub!(/~~caption_iteration~~/, child.attributes['thumbnails-caption'])
                 end
             }
+
         else
             html = html_refresh("thumbnails-#{default_thumbnails}.html")
         end
@@ -739,6 +740,26 @@ def walk_source_dir
         ios = File.open("#{dest_dir}/index.html", "w")
         ios.write(html)
         ios.close
+
+        #- substitute "return to albums" correctly
+        `find #{dest_dir} -maxdepth 1 -name "thumbnails*.html"`.each { |thumbnails|
+            thumbnails.chomp!
+            contents = File.open(thumbnails.chomp).readlines
+            for i in contents
+                if xmldir.elements['dir']
+                    i.sub!(/~~return_to_albums~~/, '<a href="index.html">' + utf8(_('Return to albums')) + '</a>')
+                else
+                    if xmldir.parent.name == 'dir'
+                        i.sub!(/~~return_to_albums~~/, '<a href="../index.html">' + utf8(_('Return to albums')) + '</a>')
+                    else
+                        i.sub!(/~~return_to_albums~~/, '')
+                    end
+                end
+            end
+            ios = File.open(thumbnails, "w")
+            ios.write(contents)
+            ios.close
+        }
     }
 end
 
index 173e5c37e2ec1fb273b8d61c8df4782b3b322104..d75ec95eb8108cbc7c7707e433075c9cbfd18d77 100644 (file)
@@ -4,6 +4,7 @@
 <head>
     <title>~~title~~</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <meta name="author" content="`Simple' theme - Guillaume Cottenceau">
     ~~~head_code~~~
 </head>
 
index 38bb6d80ebb5754e559a8a5ad8f53220b348c896..4dd4f5a7ff43d436dc3fcee1c4d225d57be767d7 100644 (file)
@@ -27,5 +27,7 @@
 ~~iterate1_close~~
 </table>
 
+<p align="center">~~return_to_albums~~</p>
+
 </body>
 </html>