New blogofile init Functionality and a Warning

99 views
Skip to first unread message

Doug Latornell

unread,
Jun 8, 2012, 11:02:03 AM6/8/12
to blogofil...@googlegroups.com
I have just landed a bunch of new code in the blogofile plugins branch
and the blogofile_blog master branch on github. Most of the code is
unit tests for the blogofile.main module, but the big functional
change is that the blogofile init command works differently now. It's
new syntax is:

blogofile init SRC_DIR [plugin]

Without a plugin, a bare site is created - just a _config.py file with
a few comments in it in the specified SRC_DIR. The user is free to
take things from there to create any kind of blogofile static site
they wish.

Of more interest to most users, I think, is initialization from a
plugin. This replaces initialization from the zip files in the
site_init directory. That's where the changes to blogofile_blog come
in. That plugin now contains (in addition to the _controllers,
_filters, and _templates/blog files that were already there) the
static and site template files from the
blogofile/site_init/simple_blog_html5/ directory. So,

blogofile init my_blog blog

will create an example blogofile site with a blog as its central
feature, and users can customize from there.

When 0.8 is released I intend to include blogofile_blog as a
dependency in blogofile, so both are installed automatically. For now
you need to clone both repos and do python setup.py develop (or your
favourite pip or easy_install version of that incantation) on both.

I haven't deleted blogofile/site_init yet, but it will go away before
the 0.8 release. If nothing else, the jinja2 template based site
that's in there should perhaps be turned into a plugin.

As for the warning - I'm seeing some weirdness when I build my
douglatornell.ca site with the latest blogofile_blog plugin installed.
The sidebar template from the plugin overrides the one from my site
source for some, but not all of the generated pages. I'm not sure if
this is a bug in blogofile, the plugin, or my site.

I'm giving this warning because I don't want to be the guy who breaks
your blog. On the other hand, I figure that if I put this code out now
there are potentially more eyes and brains on it to find that and the
other inevitable bugs. And it is 0.8.DEV, right?!

So, there it is, my first big step toward getting 0.8 released. I look
forward to feedback from those brave enough to test it :-)

Doug

George Schneeloch

unread,
Jul 24, 2012, 11:43:20 AM7/24/12
to blogofil...@googlegroups.com, d...@douglatornell.ca
First time blogofile user here! Did you ever figure out a reason for the template overriding weirdness? I think I'm seeing it too (I'm using latest in github). I'm willing to look into the source myself but I wanted to find out if the problem was figured out already

Thanks,
-George

Doug Latornell

unread,
Jul 24, 2012, 12:57:31 PM7/24/12
to blogofil...@googlegroups.com, d...@douglatornell.ca
On Tuesday, July 24, 2012 8:43:20 AM UTC-7, George Schneeloch wrote:
First time blogofile user here!

Welcome!
 
Did you ever figure out a reason for the template overriding weirdness? I think I'm seeing it too (I'm using latest in github). I'm willing to look into the source myself but I wanted to find out if the problem was figured out already

Apologies for not having updated this thread. I think that Ravi has identified the root of the problem in the https://groups.google.com/d/topic/blogofile-discuss/mUWTkXUvjGo/discussion thread. He has forks with code that is working for him; changes appear to be required in both blogofile and blogofile_blog. I haven't had a chance to merge those changes in, in part because I'm working on refactoring the default config handling, and the template order issue also touches that.

The issue is now being tracked via https://github.com/EnigmaCurry/blogofile_blog/issues/13 and https://github.com/EnigmaCurry/blogofile/issues/126

Jeremy Fein

unread,
Jan 15, 2013, 12:31:47 PM1/15/13
to blogofil...@googlegroups.com
Just getting started with blogofile and I really like it! Great job. 

I am wondering though why after running "blogofile init SRC_DIR blog" that the _controllers folder and _filters folders from blogofile_blog (https://github.com/EnigmaCurry/blogofile_blog/tree/master/blogofile_blog/site_src/_controllers and https://github.com/EnigmaCurry/blogofile_blog/tree/master/blogofile_blog/site_src/_filters) don't get copied into SRC_DIR? Are we not meant to change the functionality of the blog plugin's controllers and filters?

Thanks!


On Friday, June 8, 2012 11:02:03 AM UTC-4, Doug Latornell wrote:

Doug Latornell

unread,
Jan 15, 2013, 6:30:19 PM1/15/13
to blogofil...@googlegroups.com
On Tue, Jan 15, 2013 at 12:31 PM, Jeremy Fein <jeremy...@gmail.com> wrote:
Just getting started with blogofile and I really like it! Great job. 

Welcome to the blogofile community! Glad you like the software. 

I am wondering though why after running "blogofile init SRC_DIR blog" that the _controllers folder and _filters folders from blogofile_blog (https://github.com/EnigmaCurry/blogofile_blog/tree/master/blogofile_blog/site_src/_controllers and https://github.com/EnigmaCurry/blogofile_blog/tree/master/blogofile_blog/site_src/_filters) don't get copied into SRC_DIR? Are we not meant to change the functionality of the blog plugin's controllers and filters?

Yeah, that's generally the idea, though you can certainly add your own filters and/or controllers, and the ones in the site_src/ directory are good for reference. You can see an example of that in https://github.com/EnigmaCurry/blogofile.com (the source for the blogofile.com web site) where there are custom controllers for a photo gallery, and for rendering the docs (before they were moved to readthedocs.org).

I use a custom syntax_highlight.py filter on my site to handle highlighting of source code in posts written in reStructuredText because the default syntax_highlight.py filter is tuned for Markdown.

You have to register your custom controllers and view appropriately. The details of that are easier to discuss for a concrete example, rather than in the abstract. What are you trying to do? 

--
You received this message because you are subscribed to the Google Groups "blogofile-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/blogofile-discuss/-/OetqnI-pyTUJ.

To post to this group, send email to blogofil...@googlegroups.com.
To unsubscribe from this group, send email to blogofile-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/blogofile-discuss?hl=en.

Jeremy Fein

unread,
Jan 17, 2013, 11:56:41 AM1/17/13
to blogofil...@googlegroups.com
Thanks for the response. After playing around more I realize most of the things I want to do can be done by using templates in a clever way or by doing a custom controller, which seems doable. 

However I don't see how I can change basic functionality of the blog itself without access to the blogofile_blog controllers. One small example is that I don't want a "page" generated to chronologically list all of the posts - just a main blog page with a link to the archive. This is entirely doable from a UI perspective (just remove the "next page" button), but I don't see how I can stop blogofile_blog from generating the /blog/page/1, /blog/page/2, ..., for all posts chronologically. With access to the controller this would be an easy change.

Maybe I'm missing something?

Thanks
Reply all
Reply to author
Forward
0 new messages