2013-09-07 18:35

Nikola 6.0.0 released

Finally! This took a while because there was a lot of work done, but release 6.0.0 of Nikola my static site and blog generator is out.

Details, files, etc at github

I have tried, for this release, to do things better, be more careful and document as much as possible, as well as tried to hit most things that were hard to fix in a single backwards incompatible break.

Some of the new features are described in a series of blog posts: 1 2 3 4 5

Also: brand new modern themes site: http://themes.getnikola.com and new domain http://getnikola.com among many other tweaks.

Have fun!

2013-09-06 13:38

Magic Mystery Forum Revisited

A long time ago I wrote a hackish minimalistic forum software, which used Disqus as a backend. Just to see if it still worked after 2.5 years, I took a look... and it sort of did.

So, since I know much more about websites now than I did back then, I cleaned it up a little and deployed it at http://forum.ralsina.me

Mostly, what I have learned in those 2.5 years is that bootstrap and JQuery are cool, and here is the before/after image so you can see why.

And yes, it's still 32 lines of code. I removed a comment because Disqus works better now and the rest is all template changes, done using http://jetstrap.com

/galleries/random/before-after.thumbnail.png

2013-08-31 14:46

New in Nikola v6 part V: LESS is more

I am planning to do a major release (version 6!) of Nikola my static blog and site generator the next weekend. It's a major version because there has been a ton of feature work done. So, I will do a quick series highlighting some of those improvements this week.

Today's Topic: LESS

Unless you are happy with your site looking like straight bootstrap (and you really should not) CSS goes a long way towards making your pages look just the way you want them to.

The bad part is that, if you have done any CSS you will know CSS is a really, really crappy "language". That's why a whole philum of tools has been created that take a more powerful syntax and output CSS.

Nikola now has support for one of these, called LESS (although adding support for others like SASS should be very easy).

So, how does it work?

  1. In your theme, put LESS files in the less/ folder.
  2. Create less/targets and put there the files that should be compiled using lessc, one per line.
  3. There is no step 3

Nikola will automatically build output/assets/css/foo.css out of theme/foo/less/foo.less and will even support the usual theme inheritance, so if there ever is a LESS-based theme out there, you can just tweaks the files you want.

I personally am not writing that hypothetical LESS-based theme, but I am more than ready to help whoever wants to do one.

2013-08-30 18:59

New in Nikola v6 part IV: Awesome Auto Mode

I am planning to do a major release (version 6!) of Nikola my static blog and site generator the next weekend. It's a major version because there has been a ton of feature work done. So, I will do a quick series highlighting some of those improvements this week.

Today's Topic: Auto Mode

Nikola has had, since day one, a way to run in "auto mode". That means that it would rebuild the site automatically when it saw a file change. That was provided by doit the cool software that handles nikola's task tree.

The problem was that it was slightly limited, and it didn't notice configuration changes, or when you added new files. It only reacted to changes in things it already knew as dependencies.

Well, in v6, Nikola has a new auto mode courtesy of Python Livereload that fixes all that.

I think the best way to show it is with a video, so here it is (there are typos and such, just see the big picture ;-):

2013-08-29 11:48

New in Nikola v6 III: comment alternatives

I am planning to do a major release (version 6!) of Nikola my static blog and site generator the next weekend. It's a major version because there has been a ton of feature work done. So, I will do a quick series highlighting some of those improvements this week.

Today's Topic: Comments

Nikola has supported 3rd party comment services since day one. Because it started as "something that generates my site", it supported the comment system I was using (and still am using), Disqus.

There is nothing wrong with Disqus, and it will be the default in v6, but if you want something else... we got you covered.

So Nikola v6 supports:

All with just minor changes in your config. Because of how it's done, all themes will support all comment systems with at most very minor tweaks.

If you know of any other comment systems worth supporting, just open an issue and I'll get them in.

UPDATE
Thanks to Kwpolska and punchagan now Google+ and Facebook are also supported for comments.

2013-08-28 20:09

New in Nikola v6 part II: We Love Javascript

I am planning to do a major release (version 6!) of Nikola my static blog and site generator the next weekend. It's a major version because there has been a ton of feature work done. So, I will do a quick series highlighting some of those improvements this week.

Today's Topic: Javascript

So, Nikola builds static pages. Like I often say, that doesn't mean they have to be boring. IN this release, Nikola's templates are organized in such a way that it's easy to create complex javascript-based layouts. Let's see an example.

Read more…

2013-08-27 19:09

New in Nikola v6 part I: Typography

I am planning to do a major release (version 6!) of Nikola my static blog and site generator the next weekend. It's a major version because there has been a ton of feature work done. So, I will do a quick series highlighting some of those improvements this week.

Today's Topic: Typography.

Nikola used to suck at this. It produced sites like most websites: absolute garbage when it came to typography. So, we fixed it.

Here is what a certain section of A Study in Scarlet looked like when built using Nikola 5.5.1 (the current release):

Read more…

2013-08-23 17:10

The best reStructuredText directive ever. Really.

It all started quietly with an Issue in the Nikola bug tracker:

gustavodiazjaimes opened this issue 3 hours ago
oembed by micawber - feature sugestion

instead of using specific code for embed object (Youtube, Vimeo, Soundcloud) use a generic solution like https://github.com/coleifer/micawber

So, I looked at micawber. And it's awesome and I had never heard of it before. What it does is, it looks at a URL, and if it knows the site where it's pointed at, it will then gather information from it. And using that information it will create for you a HTML fragment so you can embed it in your own HTML page.

And how hard is it to turn that into a reStructuredText directive? NOT HARD AT ALL.

import micawber

class Media(Directive):
    """ Restructured text extension for inserting any sort of media using micawber."""
    has_content = False
    required_arguments = 1

    def run(self):
        providers = micawber.bootstrap_basic()
        return [nodes.raw('', micawber.parse_text(self.arguments[0], providers), format='html')]

So now, in Nikola's github master you can do this:

Read more…

2013-08-20 21:29

My Solution For Bootstrap's Freaking Fixed Navigation Bar Hiding Things

This is a well known problem with bootstrap:

If you use a fixed navigation bar at the top, whenever you follow a link to somewhere inside the page, the actual link target is going to be hidden below that freaking navigation bar.

There are a ton of solutions, which have two tons of minor issues. There seems to be no way to solve this using CSS and JS without causing other problems.

There are a bunch of JS solutions around. Here's mine:

<script type="text/javascript">
 $(window).on('hashchange', function(){
     if (location.hash) {
         $('body').animate({scrollTop: $(location.hash).offset().top - $('#navbar').outerHeight(true)*1.2 }, 1);
     }
 });
 $(document).ready(function(){$(window).trigger('hashchange')});
 </script>

It works well, is short and has decent browser coverage. It only fails in the corner case of clicking on the same internal link twice (which, who cares).

2013-08-16 17:03

Am I a Dickhead? You be the judge.

For some reason today I got into a little spat with Zed Shaw which ended with me blocked after a barrage of verbal abuse.

So, he says I am a dickhead. Is it so? Here's the exchange in an image, and here it is on twitter:

/galleries/random/zed-being-zed.png

It seems to me it's mostly a case of someone being quick to dish abuse but slow to accept disagreement. But hey, maybe I am a dickhead for saying that. That conversation had a few other branches, but those were disagreements about the topic (in which, I have to say, Zed is completely clueless, and wrong, although IANAL) Finding them all may be too much effort but here's one

Contents © 2000-2019 Roberto Alsina