Skip to content

Instantly share code, notes, and snippets.

@hryk
Created June 14, 2011 14:07
Show Gist options
  • Select an option

  • Save hryk/1024960 to your computer and use it in GitHub Desktop.

Select an option

Save hryk/1024960 to your computer and use it in GitHub Desktop.
diff --git a/lib/page.rb b/lib/page.rb
index 5c7071f..82e855e 100644
--- a/lib/page.rb
+++ b/lib/page.rb
@@ -4,8 +4,12 @@ require 'config'
require 'lib'
require 'related'
require 'uploaded'
+require 'fileutils'
def page(name,title)
+ unless Dir.exist? topdir(name)
+ FileUtils.mkpath topdir(name)
+ end
attr = SDBM.open("#{topdir(name)}/attr",0644);
searchable = (attr['searchable'] == 'true' ? true : false)
@robotspec = (searchable ? "index,follow" : "noindex,nofollow")
@@ -19,6 +23,7 @@ def page(name,title)
@title = title
@urlroot = URLROOT
@srcroot = SRCROOT
+ @gyazo_root = GYAZOROOT
@related = related_html(@name,@title)
@uploaded = uploaded_html
erb :page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment