Skip to main content

Ralsina.Me — Roberto Alsina's website

Creating a Theme for Nikola From Scratch (almost)

There is some doc­u­men­ta­tion about cre­at­ing themes for Niko­la, but maybe a tu­to­ri­al is al­so a use­ful way to ex­plain it. So, here it is. I'll ex­plain how to cre­ate a theme (al­most) from scratch. Al­ter­na­tive­ly, you can take an ex­ist­ing theme and mod­i­fy on­ly parts of it via in­her­i­tance, but that's for an­oth­er doc­u­men­t.

I will try to cre­ate a theme that looks like Vini­cius Mas­suchet­to's Monospace Theme.

Read more…

Nikola Feature-by-request: tag cloud!

I asked for fea­ture re­quests for Niko­la my stat­ic site gen­er­a­tor. I got some. One was from long-­time us­er Kay Hayen, so I just could­n't say no.

He asked for tag cloud­s. Look:

Any­thing in here will be re­placed on browsers that sup­port the can­vas el­e­ment

Cute, is­n't it? And it's re­al, ac­tu­al tag da­ta from this very site. With links!

How it's done:

Niko­la gen­er­ates a JSON file that has the cloud da­ta (tag name, size, link), and that's pro­cessed by JQuery and tag­Can­vas and ... well, it work­s.

You have to add jquery.tagcanvas.min.js somewhere and embed a whole pile of raw HTML (see here for details) but hey, it works.

Hope you are hap­py, Kay, you made me code javascript, dude ;-)

It's prob­a­bly rather "easy" to make it use any of these in­stead of tag­Can­vas if any­one is so in­clined.

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 :-)


Contents © 2000-2020 Roberto Alsina