Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre python (publicaciones antiguas, página 93)

New in Nikola v6 III: comment alternatives

I am plan­ning to do a ma­jor re­lea­se (ver­sion 6!) of Niko­la my sta­tic blog and si­te ge­ne­ra­tor the next weeken­d. It's a ma­jor ver­sion be­cau­se the­re has been a ton of fea­tu­re wo­rk do­ne. So, I wi­ll do a qui­ck se­ries hi­gh­li­gh­ting so­me of tho­se im­pro­ve­men­ts this week.

Today's Topic: Comments

Niko­la has su­pported 3rd par­ty co­m­ment ser­vi­ces sin­ce day one. Be­cau­se it started as "so­me­thing that ge­ne­ra­tes my si­te", it su­pported the co­m­ment sys­tem I was using (and sti­ll am usin­g), Dis­qus.

The­re is no­thing wrong wi­th Dis­qus, and it wi­ll be the de­fault in v6, but if you want so­me­thing el­se... we got you co­ve­re­d.

So Niko­la v6 su­ppor­ts:

All wi­th just mi­nor chan­ges in your con­fi­g. Be­cau­se of how it's do­ne, all the­mes wi­ll su­pport all co­m­ment sys­te­ms wi­th at most ve­ry mi­nor tweaks.

If you know of any other co­m­ment sys­te­ms wor­th su­ppor­tin­g, just open an is­sue and I'­ll get them in.

UPDATE

Thanks to Kw­pol­ska and pun­cha­gan now Google+ and Fa­ce­book are al­so su­pported for co­m­men­ts.

New in Nikola v6 part II: We Love Javascript

I am plan­ning to do a ma­jor re­lea­se (ver­sion 6!) of Niko­la my sta­tic blog and si­te ge­ne­ra­tor the next weeken­d. It's a ma­jor ver­sion be­cau­se the­re has been a ton of fea­tu­re wo­rk do­ne. So, I wi­ll do a qui­ck se­ries hi­gh­li­gh­ting so­me of tho­se im­pro­ve­men­ts this week.

Today's Topic: Javascript

So, Niko­la buil­ds sta­tic pa­ges. Like I often sa­y, that does­n't mean they ha­ve to be bo­ring. IN this re­lea­se, Niko­la's tem­pla­tes are or­ga­ni­zed in su­ch a way that it's ea­sy to crea­te com­plex ja­vas­crip­t-­ba­sed la­you­ts. Le­t's see an exam­ple.

Leer más…

New in Nikola v6 part I: Typography

I am plan­ning to do a ma­jor re­lea­se (ver­sion 6!) of Niko­la my sta­tic blog and si­te ge­ne­ra­tor the next weeken­d. It's a ma­jor ver­sion be­cau­se the­re has been a ton of fea­tu­re wo­rk do­ne. So, I wi­ll do a qui­ck se­ries hi­gh­li­gh­ting so­me of tho­se im­pro­ve­men­ts this week.

Today's Topic: Typography.

Niko­la us­ed to su­ck at this. It pro­du­ced si­tes like most web­si­tes: ab­so­lu­te gar­ba­ge when it ca­me to ty­po­gra­ph­y. So, we fixed it.

He­re is what a cer­tain sec­tion of A Study in Scar­let looked like when built using Niko­la 5.5.1 (the cu­rrent re­lea­se):

Leer más…

The best reStructuredText directive ever. Really.

It all started quie­tly wi­th an Is­sue in the Niko­la bug tra­cke­r:

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­so­me and I had ne­ver heard of it be­fo­re. What it does is, it looks at a UR­L, and if it kno­ws the si­te whe­re it's pointed at, it wi­ll then ga­ther in­for­ma­tion from it. And using that in­for­ma­tion it wi­ll crea­te for you a HT­ML frag­ment so you can em­bed it in your own HT­ML pa­ge.

And how hard is it to turn that in­to a reS­truc­tu­re­dText di­rec­ti­ve? 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 no­w, in Niko­la's gi­thub mas­ter you can do this:

Leer más…

New Nikola Galleries

One of the re­qui­re­men­ts I had for Niko­la my sta­tic si­te/­blog ge­ne­ra­to­r, was that it should build ima­ge ga­lle­rie­s. And that it should show the ima­ges sorted by da­te, and that it should be func­tio­nal and ni­ce.

We­ll, the ni­ce part has been la­cking for a long ti­me. But I thi­nk I ha­ve a grasp on it no­w.

He­re's be­fo­re:

Leer más…


Contents © 2000-2020 Roberto Alsina