Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about nikola (old posts, page 8)

New in Nikola: slideshows (work in progress)

This is nowhere near ready for re­lease, but why not show it?

Niko­la can now turn this:

.. slides::

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

In­to this (which will not look good in RSS):

Miss­ing:

  • Cus­­tomiza­­­tion

  • Sup­­port for slideshows that are not made of im­ages

  • Styling

This is based on slide­js which seemed neat, but I am not 100% sure it's the way to go (it seems to look bad if the im­ages are not all the same width, for ex­am­ple).

Why Use Something Else?

I wrote a stat­ic site gen­er­a­tor, called Niko­la a while ago, and it's start­ing to get some adop­tion and con­tri­bu­tion­s.

I think it's a fair­ly nice piece of code, to be hon­est, and it pret­ty much does ev­ery­thing I need. On the oth­er hand, it's fun to code with.

So, if you are us­ing an­oth­er stat­ic site gen­er­a­tor, or are re­search­ing in­to it, or just have opin­ions about it... what's miss­ing? What should it have that it does­n't have now?

No fea­ture too smal­l, no idea too crazy, please share! I prom­ise to make a good ef­fort to im­ple­ment any that seem like a good idea :-)

New in Nikola Master: Interactive Console

In­spired by Djan­go's in­ter­ac­tive con­sole, I added one to Niko­la, my stat­ic site gen­er­a­tor so that if you want to play with its in­ter­nal­s, you can do it eas­i­ly. Here's an ex­am­ple ses­sion:

$ 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!

Nikola Wordpress Importer Improvements

Thanks to hav­ing users try­ing to ac­tu­al­ly im­port da­ta from word­press, the word­press im­porter plug­in for Niko­la, my stat­ic site gen­er­a­tor got a cou­ple of new fea­tures.

  • It will try to main­­tain your URLs via redi­rects

    If your post was in /2012/1/2/a-­­post/ and now it will be in /post­s/a-­­post.html it will cre­ate a re­di­rect from the for­mer to the lat­ter.

  • url_map for com­­ment mi­­gra­­tion

    It will cre­ate a CSV file con­­tain­ing the old,new full URLs so that you can move your dis­­qus threads to the right places.

Al­so, mas­ter works with do­cu­tils 0.10 which broke in the last re­lease.

For these rea­son­s, there will be a 5.0.1 re­lease to­day or to­mor­row.

PS: if you want to see a few sites us­ing Niko­la, now you can.

Nikola is Python 2 1/2 ready

On my free time, lunch hours, and such I have been tweak­ing Niko­la, my stat­ic site gen­er­a­tor to make it python 3 friend­ly. Well, I some­what-ac­ci­den­tal­ly-my-­dog-­made-me-­do-it may have com­mit­ted a lot of that in­to mas­ter.

So, right now, things may be some­what bro­ken on python2 and some­what work­ing a lit­tle on python3.

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


Contents © 2000-2024 Roberto Alsina