Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about nikola (old posts, page 15)

New in Nikola v6 part IV: Awesome Auto Mode

I am plan­ning to do a ma­jor re­lease (ver­sion 6!) of Niko­la my stat­ic blog and site gen­er­a­tor the next week­end. It's a ma­jor ver­sion be­cause there has been a ton of fea­ture work done. So, I will do a quick se­ries high­light­ing some of those im­prove­ments this week.

Today's Topic: Auto Mode

Niko­la has had, since day one, a way to run in "au­to mod­e". That means that it would re­build the site au­to­mat­i­cal­ly when it saw a file change. That was pro­vid­ed by doit the cool soft­ware that han­dles niko­la's task tree.

The prob­lem was that it was slight­ly lim­it­ed, and it did­n't no­tice con­fig­u­ra­tion changes, or when you added new files. It on­ly re­act­ed to changes in things it al­ready knew as de­pen­den­cies.

Well, in v6, Niko­la has a new au­to mode cour­tesy of Python Livereload that fix­es all that.

I think the best way to show it is with a video, so here it is (there are ty­pos and such, just see the big pic­ture ;-):

New in Nikola v6 III: comment alternatives

I am plan­ning to do a ma­jor re­lease (ver­sion 6!) of Niko­la my stat­ic blog and site gen­er­a­tor the next week­end. It's a ma­jor ver­sion be­cause there has been a ton of fea­ture work done. So, I will do a quick se­ries high­light­ing some of those im­prove­ments this week.

Today's Topic: Comments

Niko­la has sup­port­ed 3rd par­ty com­ment ser­vices since day one. Be­cause it start­ed as "some­thing that gen­er­ates my site", it sup­port­ed the com­ment sys­tem I was us­ing (and still am us­ing), Dis­qus.

There is noth­ing wrong with Dis­qus, and it will be the de­fault in v6, but if you want some­thing else... we got you cov­ered.

So Niko­la v6 sup­port­s:

All with just mi­nor changes in your con­fig. Be­cause of how it's done, all themes will sup­port all com­ment sys­tems with at most very mi­nor tweak­s.

If you know of any oth­er com­ment sys­tems worth sup­port­ing, just open an is­sue and I'll get them in.

UPDATE

Thanks to Kw­pol­s­ka and pun­cha­gan now Google+ and Face­book are al­so sup­port­ed for com­ments.

New in Nikola v6 part II: We Love Javascript

I am plan­ning to do a ma­jor re­lease (ver­sion 6!) of Niko­la my stat­ic blog and site gen­er­a­tor the next week­end. It's a ma­jor ver­sion be­cause there has been a ton of fea­ture work done. So, I will do a quick se­ries high­light­ing some of those im­prove­ments this week.

Today's Topic: Javascript

So, Niko­la builds stat­ic pages. Like I of­ten say, that does­n't mean they have to be bor­ing. IN this re­lease, Niko­la's tem­plates are or­ga­nized in such a way that it's easy to cre­ate com­plex javascrip­t-based lay­out­s. Let's see an ex­am­ple.

Read more…

New in Nikola v6 part I: Typography

I am plan­ning to do a ma­jor re­lease (ver­sion 6!) of Niko­la my stat­ic blog and site gen­er­a­tor the next week­end. It's a ma­jor ver­sion be­cause there has been a ton of fea­ture work done. So, I will do a quick se­ries high­light­ing some of those im­prove­ments this week.

Today's Topic: Typography.

Niko­la used to suck at this. It pro­duced sites like most web­sites: ab­so­lute garbage when it came to ty­pog­ra­phy. So, we fixed it.

Here is what a cer­tain sec­tion of A Study in Scar­let looked like when built us­ing Niko­la 5.5.1 (the cur­rent re­lease):

Read more…

The best reStructuredText directive ever. Really.

It all start­ed qui­et­ly with an Is­sue in the Niko­la bug track­er:

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 mi­caw­ber. And it's awe­some and I had nev­er heard of it be­fore. What it does is, it looks at a URL, and if it knows the site where it's point­ed at, it will then gath­er in­for­ma­tion from it. And us­ing that in­for­ma­tion it will cre­ate for you a HTML frag­ment so you can em­bed it in your own HTML page.

And how hard is it to turn that in­to a re­Struc­tured­Text di­rec­tive? 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 Niko­la's github mas­ter you can do this:

Read more…


Contents © 2000-2020 Roberto Alsina