Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about python (old posts, page 82)

New Nikola Feature: wordpress.com Importer

I im­ple­ment­ed a first drat of a word­press.­com im­porter for my Niko­la stat­ic site/blog gen­er­a­tor It's a work in progress but it works well enough that it can turn this blog in­to this blog

What work­s:

  • Posts

  • Pages

  • Drafts

  • Tags

  • Per­­son­al in­­­for­­ma­­tion

What does­n't work:

  • Com­­ments

  • Links across post­s/­­pages are left un­­touched

  • The out­­put is pret­­ty gen­er­ic

This needs testing, so feel free to get master and try it. Asuming foo.xml is your data from wordpress.com:

nikola_import_wordpress foo.xml
cd new_site
doit && doit serve

And point your brows­er to http://lo­cal­host:8000 to see the re­sult :-)

Minor tweaking of the generated conf.py is generally needed for improved results.

Nikola: New Tag Index Pages

Short and sweet:

In Niko­la my stat­ic site/blog gen­er­a­tor, the Tag pages used to just be a big list of ti­tles link­ing to the posts in the tag. Now they can (op­tion­al­ly) look just like the blog does, but fil­tered. Check it out.

Mi­nor tweaks still need­ed (like, men­tion­ing the tag some­where in the ti­tle), but the ba­sic func­tion­al­i­ty (fil­ter­ing, pag­i­na­tion, lay­out, etc) is com­plete.

To enable it in your site, just use master from git and enable TAG_PAGES_ARE_INDEXES = True in your conf.py.

Qt Mac Tips

My team has been work­ing on port­ing some PyQt stuff to Mac OS­X, and we have run in­to sev­er­al Qt bugs, sad­ly. Here are two, and the work­arounds we found.

Na­tive di­alogs are bro­ken.

Us­ing QFile­Di­a­log.ge­tEx­ist­ingDi­rec­to­ry we no­ticed the fol­low­ing symp­tom­s:

  • If you do noth­ing, the di­a­log went away on its own af­ter about 20 sec­ond­s.

  • Af­ter you used it on­ce, it may pop up and dis­­ap­­pear im­me­di­ate­­ly. Or not.

So­lu­tion: use the Don­tUse­N­a­tive­Di­a­log op­tion.

Wid­gets in QTreeWid­getItems don't scrol­l.

When you use Wid­gets in­side the items of a QTreeWid­get (which I know, is not a com­mon case, but hey, it hap­pen­s), the wid­gets don't scroll with the item­s.

Solution: use the -graph­ic­ssys­tem raster options. You can even inject them into argv if the platform is darwin.

Nikola 4 Released

I have just up­load­ed re­lease 4 of Niko­la my stat­ic blog/site gen­er­a­tor. Here are some of the changes in this ver­sion:

Features

  • Pre­vi­ous/Next post links

  • Teas­er sup­­port

  • Sup­­port posts with HTML "sources"

  • Site check­­ing script (niko­la_check)

  • Max­i­­mum im­age size in gal­­leries

  • Im­age de­scrip­­tions in gal­­leries

  • Im­age ex­­clu­­sion in gal­­leries

  • Spe­­cial "draft" tag

  • Pret­­ty code list­ings ("­­code gal­­leries")

  • Page de­scrip­­tions

  • Easy theme tun­ing via Bootswatch

  • Sup­­port for We­bAs­sets bun­­dles

  • "Fil­ter­s" for pow­er­­ful file post-pro­cess­ing

Bugfixes

  • Im­proved HTML out­­put

  • Sup­­port mul­ti­­ple time for­­mats in post meta­­da­­ta

  • Slugi­­fy tag names for URLs

  • Ar­chive path and file­­name con­­fig­urable

  • Gal­­leries sort­ed by date (sup­­ports EX­IF)

  • Ro­­tate gallery thum­b­­nails (EX­IF)

  • Tag feeds in tag pages

  • Col­or­box sup­­port in re­struc­­tured text fig­ures

  • Fix for con­­tent dis­­­play­ing too wide

  • Changel­og

As usu­al, you can dis­cuss bugs or make fea­ture re­quests at the niko­la-dis­cuss group and I love to know of sites us­ing Niko­la.

Hope you like it!


Contents © 2000-2023 Roberto Alsina