Skip to main content

Ralsina.Me — Roberto Alsina's website

2012

So, this is 2013. Could have fooled me if you claimed it was 2012. I did a res­o­lu­tions post a year ago. How did it go?

  • I aimed to write a post a day. That was 366 post­s, and I failed mis­­er­ably. I did post 215 times, though, which is a heck of a lot.

  • I aimed at im­prov­ing at my work. I think I did do bet­ter for a while, and dipped a lit­­tle near year's end be­­cause of tired­­ness. I will give my­­self a pass there.

  • My health got bet­ter. I did lose some weight (although I re­­cov­­ered some of it) and my blood pres­­sure is look­ing good. My en­er­­gy lev­­els have im­proved.

  • My mar­riage is do­ing much bet­ter. Prob­a­bly hap­pi­est since 2008.

  • I did not get my teeth fixed be­­cause of in­­­sur­ance is­­sues. That should be ok af­ter march.

As bonus­es:

  • Took my mom to Paris.

  • Made some moves to achieve fi­­nan­­cial se­cu­ri­­ty in the far fu­­ture.

  • I gave the clos­ing con­fer­­ence at Py­­conAr

  • I re­­vived my free soft­­ware projects

So, not hor­ri­ble!

As for 2013:

  • Again, will try to get my mouth fixed.

  • Will try to lose much more weight.

  • I will aim for 200 post­s.

  • I will try to fi­­nal­­ly write a whole book.

  • I will have eye surgery to get rid of the glass­es.

We'll see how that goes.

Client-rendered, one-URL, dynamic, static site.

My va­ca­tions end to­mor­row. So, the time to spend hack­ing fun, per­son­al, free stuff is go­ing to be lim­it­ed be­cause of the time spent cod­ing fun, free stuff for mon­ey. So, I de­cid­ed to fin­ish with a bit of whim­sy.

I im­ple­ment­ed a com­plete­ly clien­t-ren­dered, one-URL, dy­nam­ic blog. Which is ac­tu­al­ly to­tal­ly stat­ic.

In fac­t, that blog is this blog, just with a twist. If you go to this URL you will see what's ba­si­cal­ly this very site, with com­ments and ev­ery­thing as usu­al. But if you click on "Pre­vi­ous Post" ... well, it stays in the same page, even though it dis­plays a dif­fer­ent post :-)

The mag­ic is the new, ex­per­i­men­tal, dy­nam­ic task_­mus­tache plug­in for my stat­ic site gen­er­a­tor, Niko­la. which does the fol­low­ing:

  1. Ren­ders post da­­ta as JSON files in­­stead of HTML

  2. Cre­ates a HTML file that is re­al­­ly a mus­­tache.js tem­­plate

  3. Cre­ates a HTML file with some bits of Javascript that loads the tem­­plate and the new­est post's da­­ta.

  4. If you ac­cess that mus­­tache.html with a frag­­men­t, it us­es that to fetch JSON da­­ta and re­write it­­self.

And that's it. It ac­tu­al­ly loads fast, and re­gen­er­ates very fast, since it does much less than the re­al site. There are a bunch of things that will dump you out of the "dy­nam­ic" site, like tag links, and what­ev­er, but it works sur­pris­ing­ly well (and if you want to theme it, it's just one tem­plate).

This is the first of a new kind of thing for Nikola, the "extra plugins". Basically, stuff that is too weird, specific or useless for the general distro, will go there, and to use those plugins, you have to create a plugins/ folder in your site and add it there manually.

En­joy!

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…


Contents © 2000-2024 Roberto Alsina