Пример #1
0
def run():

    blog = bf.config.controllers.blog

    #Parse the posts
    blog.posts = post.parse_posts("_posts")
    blog.pages = post.parse_posts("_pages")
    blog.dir = bf.util.path_join(bf.writer.output_dir, blog.path)
    blog.comments = comments.get_comments()

    # Find all the categories and archives before we write any pages
    blog.archived_posts = {} ## "/archive/Year/Month" -> [post, post, ... ]
    blog.archive_links = []  ## [("/archive/2009/12", name, num_in_archive1), ...] (sorted in reverse by date)
    blog.categorized_posts = {} ## "Category Name" -> [post, post, ... ]
    blog.all_categories = [] ## [("Category 1",num_in_category_1), ...] (sorted alphabetically)
    categories.sort_into_categories()

    blog.logger = logging.getLogger(config['name'])
    
    thexnews_legacy.run()
    chronological.run()
    permapage.run()
    page.run()
    categories.run()
    feed.run()
    shortlinks.run()
Пример #2
0
def do_build(args):
    #load config
    config_file = os.path.join(args.src_dir,"_config.py")
    try:
        config.init(config_file)
    except config.ConfigNotFoundException:
        print >>sys.stderr, ("No configuration found: %s" % config_file)
        parser.exit(1, "Want to make a new site? Try `blogofile init`\n")

    logger.info("Running user's pre_build() function..")
    writer = Writer(output_dir="_site")
    if config.blog_enabled == True:
        config.pre_build()
        posts = post.parse_posts("_posts")
        if args.include_drafts:
            drafts = post.parse_posts("_drafts", config)
            for p in drafts:
                p.draft = True
        else:
            drafts = None
        writer.write_blog(posts, drafts)
    else:
        #Build the site without a blog
        writer.write_site()
    logger.info("Running user's post_build() function..")
    config.post_build()
Пример #3
0
def run():
    blog = bf.config.controllers.blog

    #Parse the posts
    blog.posts = post.parse_posts("_posts")

    blog.shows = [x for x in blog.posts if post.Category('Shows') in x.categories]
    blog.posts_minus_shows = [x for x in blog.posts if post.Category('Shows') not in x.categories]

    blog.dir = bf.util.path_join(bf.writer.output_dir, blog.path)

    # Find all the categories and archives before we write any pages
    blog.archived_posts = {} ## "/archive/Year/Month" -> [post, post, ... ]
    blog.archive_links = []  ## [("/archive/2009/12", name, num_in_archive1), ...] (sorted in reverse by date)
    blog.categorized_posts = {} ## "Category Name" -> [post, post, ... ]
    blog.all_categories = [] ## [("Category 1",num_in_category_1), ...] (sorted alphabetically)
    archives.sort_into_archives()
    categories.sort_into_categories()

    blog.logger = logging.getLogger(config['name'])

    permapage.run()
    chronological.run()
    homepage.run()
    archives.run()
    categories.run()
    feed.run()
Пример #4
0
def run():
    blog = bf.config.controllers.blog

    #Parse the posts
    blog.posts = post.parse_posts("_posts")
    blog.iter_posts = iter_posts
    blog.iter_posts_published = iter_posts_published
    blog.dir = bf.util.path_join(bf.writer.output_dir, blog.path)

    # Find all the categories and archives before we write any pages
    blog.archived_posts = {}  ## "/archive/Year/Month" -> [post, post, ... ]
    blog.archive_links = [
    ]  ## [("/archive/2009/12", name, num_in_archive1), ...] (sorted in reverse by date)
    blog.categorized_posts = {}  ## "Category Name" -> [post, post, ... ]
    blog.all_categories = [
    ]  ## [("Category 1",num_in_category_1), ...] (sorted alphabetically)
    archives.sort_into_archives()
    categories.sort_into_categories()

    blog.logger = logging.getLogger("blogofile.controllers." + meta['name'])
    permapage.run()
    chronological.run()
    archives.run()
    categories.run()
    feed.run()
Пример #5
0
 def __load_bf_cache(self):
     #Template cache object, used to transfer state to/from each template:
     self.bf = cache.bf
     self.bf.config = self.config
     self.bf.writer = self
     self.bf.util = util
     self.bf.logger = logger
     self.bf.filter = filter
     if self.config.blog_enabled == True:
         self.bf.posts = post.parse_posts("_posts")
         self.bf.blog_dir = util.path_join(self.output_dir,self.config.blog_path)
Пример #6
0
def run():
    blog = bf.config.controllers.blog

    #Parse the posts
    blog.posts = post.parse_posts("_posts")
    blog.dir = bf.util.path_join(bf.writer.output_dir, blog.path)

    blog.logger = logging.getLogger(config['name'])

    permapage.run()
    chronological.run()
    feed.run()
Пример #7
0
def run():
    blog = bf.config.controllers.blog

    #Parse the posts
    blog.posts = post.parse_posts("_posts")
    blog.dir = bf.util.path_join(bf.writer.output_dir, blog.path)

    blog.categorized_posts = {} ## "Category Name" -> [post, post, ... ]
    blog.all_categories = [] ## [("Category 1",num_in_category_1), ...] (sorted alphabetically)
    categories.sort_into_categories()

    blog.logger = logging.getLogger(config['name'])
    
    permapage.run()
    chronological.run()
    categories.run()
    feed.run()
    error.run()