Posts about nikola (old posts, page 4)

2012-12-27 13:52

New in Nikola: slideshows (work in progress)

This is nowhere near ready for release, but why not show it?

Nikola can now turn this:

.. slides::

   /galleries/london-paris-2012/P1000198.JPG
   /galleries/london-paris-2012/2P1000235.JPG
   /galleries/london-paris-2012/3_P1000298.JPG

Into this (which will not look good in RSS):

Missing:

  • Customization
  • Support for slideshows that are not made of images
  • Styling

This is based on slidejs which seemed neat, but I am not 100% sure it's the way to go (it seems to look bad if the images are not all the same width, for example).

2012-12-26 20:22

Why Use Something Else?

I wrote a static site generator, called Nikola a while ago, and it's starting to get some adoption and contributions.

I think it's a fairly nice piece of code, to be honest, and it pretty much does everything I need. On the other hand, it's fun to code with.

So, if you are using another static site generator, or are researching into it, or just have opinions about it... what's missing? What should it have that it doesn't have now?

No feature too small, no idea too crazy, please share! I promise to make a good effort to implement any that seem like a good idea :-)

2012-12-25 19:34

New in Nikola Master: Interactive Console

Inspired by Django's interactive console, I added one to Nikola, my static site generator so that if you want to play with its internals, you can do it easily. Here's an example session:

$ nikola init pepe
A new site with some sample data has been created at pepe.
See README.txt in that folder for more information.
$ cd pepe
$ nikola console
Scanning posts
.
.
done!
You can now access your configuration as conf and your site engine as SITE
>>> [p.title('en') for p in SITE.timeline]
[u'Listings Demo', u'Nikola: it generates static', u'Welcome to Nikola',
u'A reStructuredText Primer', u'A reStructuredText Reference', u'Sample
Nikola Config File', u'The Nikola Handbook', u'Theming Nikola']

Have fun!

2012-12-20 12:53

Nikola Wordpress Importer Improvements

Thanks to having users trying to actually import data from wordpress, the wordpress importer plugin for Nikola, my static site generator got a couple of new features.

  • It will try to maintain your URLs via redirects

    If your post was in /2012/1/2/a-post/ and now it will be in /posts/a-post.html it will create a redirect from the former to the latter.

  • url_map for comment migration

    It will create a CSV file containing the old,new full URLs so that you can move your disqus threads to the right places.

Also, master works with docutils 0.10 which broke in the last release.

For these reasons, there will be a 5.0.1 release today or tomorrow.

PS: if you want to see a few sites using Nikola, now you can.

2012-12-17 16:20

Nikola is Python 2 1/2 ready

On my free time, lunch hours, and such I have been tweaking Nikola, my static site generator to make it python 3 friendly. Well, I somewhat-accidentally-my-dog-made-me-do-it may have committed a lot of that into master.

So, right now, things may be somewhat broken on python2 and somewhat working a little on python3.

In any case, feel free to try it out, and let me know what to fix.

2012-12-03 14:11

Nikola v5 Released

A new version of Nikola is out! You can get it at the usual place.

This version is not completely backwards compatible, thus the new major version number, but switching to it should be easy-ish. If you are using version 4.0.3:

  1. Remove your dodo.py
  2. Use nikola build instead of doit from now on
  3. use nikola serve instead of doit serve, nikola new_post instead of doit new_post, and so on. Some other doit task are also converted into nikola command you can get the list using nikola help

The integration of doit into Nikola is not done in a very nice way, that's still ongoing work, but it should be Good Enough To Work (TM).

Hope you enjoy this release!

Features

  • Templates now know their name from template_name in their context.
  • Made most of Nikola into Yapsy plugins.
  • Recurse galleries/ and render each folder as a gallery.
  • Breadcrumbs and folder links in image galleries.

Bugfixes

  • Fixed doc installation
  • Put webassets cache in cache/webassets
  • Update to doit 0.17
  • Don't crash on incomplete translations
  • Fixed Issue 160: render_tags didn't call scan_posts()
  • Fixed Issue 161: webassets setting USE_BUNDLES was ignored (fix by schettino72)
  • Fixed Issue 153: index.txt was being ignored in galleries.

2012-10-26 06:40

Coming Soon...

... lots of travel pictures. On this trip I want to create a workflow so it's very easy for me to publish each day's photos at the end of it.

I will be folding that workflow into Nikola's galleries, since I don't expect it to be a big amount of code, and I have several hours of dead time while traveling.

2012-09-11 18:50

Nikola is Pluginificated.

So, the git master of Nikola now has plugins. In fact, not only does it have plugins, but is basically made of plugins.

You see, the code used to mostly be inside a class (called Nikola), and ... it had grown. That class had grown up to around 2000 lines of code. Which is completely ridiculous.

So, using Yapsy I turned the code inside out: almost all the code that was in that monster class was moved into plugins and the class turned into a smart plugin loader.

This has brought several advantages:

  • Now you can extend Nikola for your own purposes. Just create a plugin folder in your site, and put the extra functionality there.
  • Support for whole categories of things is now modular. Want to support a different markup? A different template system? Just write a plugin.
  • Want to add completely new functions to Nikola? Like, say, a way to import data from another blog tool, or something like planet software? Well, just add a "command plugin".

What has changed for the user?

  • You can delete dodo.py from your site.
  • Use nikola build instead of doit
  • Use nikola serve instead of doit serve

Some minor things still need doing in this area (notable, fixing the docs), but the main refactoring is there.

2012-09-03 21:47

Improved Wordpress.com Importer and a Question

So, if you were to try to use nikola_wordpress_importer from master now, it would:

  1. Not crash ;-)
  2. Download attachments
  3. Fix links to attachments so they work on the new site

However, I am now unsure of what exactly is in wordpress.com's export XML file. The posts themselves are in this form:

Muchas gracias Nico por hacer el video este. Groso, quedó muy bueno.

[youtube=http://www.youtube.com/watch?hl=es&v=882qxARXa6c]

Two things jump to me:

  1. That's not HTML
  2. WTF is that youtube thing?

I am having some success processing it as markdown, since that handles the paragraph breaks and some other stuff. Maybe the youtube embedding is done with a markdown extension?

Anyone knows?

2012-09-02 15:22

New Nikola Feature: wordpress.com Importer

I implemented a first drat of a wordpress.com importer for my Nikola static site/blog generator It's a work in progress but it works well enough that it can turn this blog into this blog

What works:

  • Posts
  • Pages
  • Drafts
  • Tags
  • Personal information

What doesn't work:

  • Comments
  • Links across posts/pages are left untouched
  • The output is pretty generic

This needs testing, so feel free to get master and try it. Asuming foo.xml is your data from wordpress.com:

nikola_import_wordpress foo.xml
cd new_site
doit && doit serve

And point your browser to http://localhost:8000 to see the result :-)

Minor tweaking of the generated conf.py is generally needed for improved results.

Contents © 2000-2018 Roberto Alsina