Skip to content

Instantly share code, notes, and snippets.

@EnigmaCurry
Created March 2, 2011 00:21
Show Gist options
  • Save EnigmaCurry/850201 to your computer and use it in GitHub Desktop.
Save EnigmaCurry/850201 to your computer and use it in GitHub Desktop.
A hack to get Blogofile 0.7.1 based blogs building on 0.7.2 or above

Blogofile 1.0-DEV (soon to be 0.7.2) changed the blog controller so that all of the configuration is done in the controller itself. Users upgrading to 0.7.2 will have a choice to make: upgrade their _controllers directory to use the new controller, or install this hack to get all the defaults back that got lost in translation.

# Run this in your _config.py before you set any blog settings:
execfile("_legacy_blog_settings.py")
#### Blog Settings ####
blog = controllers.blog
## blog_enabled -- Should the blog be enabled?
# (You don't _have_ to use blogofile to build blogs)
blog.enabled = False
## blog_path -- Blog path.
# This is the path of the blog relative to the site_url.
# If your site_url is "http://www.yoursite.com/~ryan"
# and you set blog_path to "/blog" your full blog URL would be
# "http://www.yoursite.com/~ryan/blog"
# Leave blank "" to set to the root of site_url
blog.path = "/blog"
## blog_name -- Your Blog's name.
# This is used repeatedly in default blog templates
blog.name = "Your Blog's Name"
## blog_description -- A short one line description of the blog
# used in the RSS/Atom feeds.
blog.description = "Your Blog's short description"
## blog_timezone -- the timezone that you normally write your blog posts from
blog.timezone = "US/Eastern"
## blog_posts_per_page -- Blog posts per page
blog.posts_per_page = 5
# Automatic Permalink
# (If permalink is not defined in post article, it's generated
# automatically based on the following format:)
# Available string replacements:
# :year, :month, :day -> post's date
# :title -> post's title
# :uuid -> sha hash based on title
# :filename -> article's filename without suffix
blog.auto_permalink.enabled = True
# This is relative to site_url
blog.auto_permalink.path = ":blog_path/:year/:month/:day/:title"
######################################################################
# Intermediate Settings
######################################################################
#### Disqus.com comment integration ####
blog.disqus.enabled = False
blog.disqus.name = "your_disqus_name"
#### Emacs Integration ####
blog.emacs_orgmode_enabled = False
# emacs binary (orgmode must be installed)
blog.emacs_binary = "/usr/bin/emacs" # emacs 22 or 23 is recommended
blog.emacs_preload_elisp = "_emacs/setup.el" # preloaded elisp file
blog.emacs_orgmode_preamble = r"#+OPTIONS: H:3 num:nil toc:nil \n:nil" # added in preamble
#### Blog post syntax highlighting ####
# You can change the style to any builtin Pygments style
# or, make your own: http://pygments.org/docs/styles
filters.syntax_highlight.style = "murphy"
filters.syntax_highlight.css_dir = "/css"
#### Custom blog index ####
# If you want to create your own index page at your blog root
# turn this on. Otherwise blogofile assumes you want the
# first X posts displayed instead
blog.custom_index = False
#### Post excerpts ####
# If you want to generate excerpts of your posts in addition to the
# full post content turn this feature on
blog.post_excerpts.enabled = True
blog.post_excerpts.word_length = 25
#Also, if you don't like the way the post excerpt is generated
#You can define assign a new function to blog.post_excerpts.method
#This method must accept the following arguments: (content, num_words)
#### Blog pagination directory ####
# blogofile places extra pages of your blog in
# a secondary directory like the following:
# http://www.yourblog.com/blog_root/page/4
# You can rename the "page" part here:
blog.pagination_dir = "page"
#### Blog category directory ####
# blogofile places extra pages of your or categories in
# a secondary directory like the following:
# http://www.yourblog.com/blog_root/category/your-topic/4
# You can rename the "category" part here:
blog.category_dir = "category"
#### Post encoding ####
blog.post_encoding = "utf-8"
#### Default post filters ####
# If a post does not specify a filter chain, use the
# following defaults based on the post file extension:
blog.post_default_filters = {
"markdown": "syntax_highlight, markdown",
"textile": "syntax_highlight, textile",
"org": "syntax_highlight, org",
"rst": "syntax_highlight, rst",
"html": "syntax_highlight"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment