Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Como se hace

Lo hi­ce por va­rias ra­zo­nes:

  1. Po­r­­que un co­­­men­­ta­­rio pa­­re­­cía su­­ge­­ri­r­­lo ;-)

  2. Po­r­­que es al­­go li­n­­do de ha­­ce­­r. Me gus­­ta reS­­t, me gus­­ta­­ría que lo use más gen­­te, y mo­s­­trar lo fá­­cil que es, es­­tá bue­­no.

  3. Es el ca­­mino del so­­­ftwa­­re li­­bre. Les doy la ma­­ne­­ra pre­­fe­­ri­­da de mo­­­di­­fi­­car mis po­s­­ts.

  4. Era una pa­­va­­da ha­­ce­r­­lo.

Si ven al­gu­na co­sa que fal­te en el blo­g, o les pa­re­ce que quer­da­ría bue­no agre­gar al­go, co­men­ten y ve­mo­s.

Nikola está Cerca

  • Im­­ple­­men­­té tags (i­n­­clu­­yen­­do fee­­ds pa­­ra ca­­da ta­­g).

  • Si­m­­pli­­fi­­qué los te­m­­pla­­tes.

  • Se­­pa­­ré có­­­di­­go y co­n­­fi­­gu­­ra­­ció­­n.

El úl­ti­mo fué el más com­pli­ca­do. Y pa­ra que se vea co­mo es, és­ta es la con­fi­gu­ra­ción com­ple­ta, ex­cep­to pe­da­ci­tos de HT­ML que no va­len la pe­na ve­r, co­mo el có­di­go de google cus­tom sear­ch. ¡Es­pe­ro que sea cla­ro!

# -*- coding: utf-8 -*-

# post_pages contains (wildcard, destination, template) tuples.
#
# The wildcard is used to generate a list of reSt source files (whatever/thing.txt)
# That fragment must have an associated metadata file (whatever/thing.meta),
# and opcionally translated files (example for spanish, with code "es"):
#     whatever/thing.txt.es and whatever/thing.meta.es
#
# From those files, a set of HTML fragment files will be generated:
# whatever/thing.html (and maybe whatever/thing.html.es)
#
# These files are combinated with the template to produce rendered
# pages, which will be placed at
# output / TRANSLATIONS[lang] / destination / pagename.html
#
# where "pagename" is specified in the metadata file.
#

post_pages = (
    ("posts/*.txt", "weblog/posts", "post.tmpl"),
    ("stories/*.txt", "stories", "post.tmpl"),
)

# What is the default language?

DEFAULT_LANG = "en"

# What languages do you have?
# If a specific post is not translated to a language, then the version
# in the default language will be shown instead.
# The format is {"translationcode" : "path/to/translation" }
# the path will be used as a prefix for the generated pages location

TRANSLATIONS = {
    "en": "",
    "es": "tr/es",
    }

# Data about this site
BLOG_TITLE = "Lateral Opinion"
BLOG_URL = "//ralsina.me"
BLOG_EMAIL = "ralsina@kde.org"
BLOG_DESCRIPTION = "I write free software. I have an opinion on almost "\
    "everything. I write quickly. A weblog was inevitable."

# Paths for different autogenerated bits. These are combined with the translation
# paths.

# Final locations are:
# output / TRANSLATION[lang] / TAG_PATH / index.html (list of tags)
# output / TRANSLATION[lang] / TAG_PATH / tag.html (list of posts for a tag)
# output / TRANSLATION[lang] / TAG_PATH / tag.xml (RSS feed for a tag)
TAG_PATH = "categories"
# Final location is output / TRANSLATION[lang] / INDEX_PATH / index-*.html
INDEX_PATH = "weblog"
# Final locations for the archives are:
# output / TRANSLATION[lang] / ARCHIVE_PATH / archive.html
# output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / index.html
ARCHIVE_PATH = "weblog"
# Final locations are:
# output / TRANSLATION[lang] / RSS_PATH / rss.xml
RSS_PATH = "weblog"

# A HTML fragment describing the license, for the sidebar.
LICENSE = """
    <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ar/">
    <img alt="Creative Commons License" style="border-width:0; margin-bottom:12px;"
    src="http://i.creativecommons.org/l/by-nc-sa/2.5/ar/88x31.png"></a>
"""

# A search form to search this site, for the sidebar. Has to be a <li>
# for the default template (base.tmpl).
SEARCH_FORM = """
    <!-- google custom search -->
    <!-- End of google custom search -->
"""

# Google analytics or whatever else you use. Added to the bottom of <body>
# in the default template (base.tmpl).
ANALYTICS = """
        <!-- Start of StatCounter Code -->
        <!-- End of StatCounter Code -->
        <!-- Start of Google Analytics -->
        <!-- End of Google Analytics -->
"""

# Put in global_context things you want available on all your templates.
# It can be anything, data, functions, modules, etc.
GLOBAL_CONTEXT = {
    'analytics': ANALYTICS,
    'blog_title': BLOG_TITLE,
    'blog_url': BLOG_URL,
    'translations': TRANSLATIONS,
    'license': LICENSE,
    'search_form': SEARCH_FORM,
    # Locale-dependent links
    'archives_link': {
        'es': '<a href="/tr/es/weblog/archive.html">Archivo</a>',
        'en': '<a href="/weblog/archive.html">Archives</a>',
        },
    'tags_link': {
        'es': '<a href="/tr/es/categories/index.html">Tags</a>',
        'en': '<a href="/categories/index.html">Tags</a>',
        },
    }

execfile("nikola/nikola.py")

Bienvenidos a Nikola

Así que, ahí va una ex­pli­ca­ció­n:

  • Ca­m­­bié to­­­do el so­­­ftwa­­re y los te­m­­pla­­tes pa­­ra es­­te blo­­­g.

  • Sí, es­­tá to­­­do sin te­r­­mi­­na­­r.

  • El nue­­vo so­­­ftwa­­re se lla­­ma Niko­­­la.

  • Sí, creo que es­­tá bue­­no.

¿Porqué cambiar?

¿En se­rio? EL ge­ne­ra­dor an­te­rior (Son of Bar­tle­Blo­g) no es­ta­ba en buen es­ta­do. Los ar­chi­vos cu­brían só­lo 2000-2010, el li­nk "pos­ts an­te­rio­res" era una qui­nie­la, y a la ver­sión en es­pa­ñol le fal­ta­ban pá­gi­nas en­te­ra­s.

¿Qué es Nikola?

Niko­la es un ge­ne­ra­dor de si­tios es­tá­ti­co­s. Una co­sa in­te­re­san­te de es­te si­tio es que es, y siem­pre ha sio, pu­ro HT­M­L. Ca­da co­sa "di­ná­mi­ca" que veas acá, co­mo ser co­men­ta­rio­s, es un ser­vi­cio de ter­ce­ro­s. Es­te si­tio es na­da más que unas car­pe­tas lle­nas de HT­M­L.

¿Cómo funciona Nikola?

Niko­la to­ma una car­pe­ta lle­na de ar­chi­vos txt es­cri­tos en res­truc­tu­red text, y ge­ne­ra frag­men­tos de HT­M­L.

Esos frag­men­to­s, con un po­co de me­ta­da­ta (tí­tu­lo, tags, nom­bre del ar­chi­vo de sali­da, li­nks a fuen­tes ex­ter­na­s) y unos Mako Tem­pla­tes crean pá­gi­nas HT­M­L.

Esas pá­gi­nas usan boots­trap pa­ra no ser una re­ve­ren­da ba­zo­fia (nun­ca di­je ser un di­se­ña­do­r).

Pa­ra ase­gu­rar­me de no ha­cer tra­ba­jo inú­ti­l, doit se en­car­ga de re­crear lo mí­ni­mo in­dis­pen­sa­ble.

¿Por qué no usar <esto>?

Por­que, por di­ver­sas ra­zo­nes, que­ría man­te­ner exac­ta­men­te las URLs que siem­pre tu­ve.

  • Si mue­­vo una pá­­gi­­na, man­­te­­ner aso­­­cia­­dos los co­­­men­­ta­­rios de Dis­­qus es un ba­r­­do.

  • Pue­­de ha­­ber gen­­te que te­­ga book­­ma­­rks.

Ade­más quie­ro:

  • Mako te­m­­pla­­tes (po­r­­que me gus­­tan)

  • Res­­tru­c­­tu­­red text (po­r­­que ten­­go más de 1000 po­s­­ts es­­cri­­tos en eso)

  • Py­­thon (pa­­ra ha­­ckea­r­­lo)

  • Fá­­cil de ha­­ckear (Niko­­­la es­­tá por las 600 LO­­­C, y es ca­­si fea­­tu­­re co­m­­ple­­te)

  • So­­­po­r­­te de blogs mu­l­­ti­­li­n­­gües co­­­mo es­­te.

Y por su­pues­to:

  • So­­­na­­ba co­­­mo un pro­­­ye­c­­to co­r­­to y di­­ve­r­­ti­­do. Te­­nía la so­s­­pe­­cha que con un po­­­co de pe­­ga­­men­­to las he­­rra­­mien­­tas exis­­ten­­tes ha­­cían el 90% del tra­­ba­­jo. Pa­­re­­ce que te­­nía ra­­zó­­n, ya que lo pu­­de es­­cri­­bir en unos po­­­cos dia­s.

¿Lo vas a mantener?

Y, lo es­toy usan­do­...

¿Es útil para alguien más?

No por aho­ra, por­que ha­ce mon­to­nes de su­po­si­cio­nes vá­li­das só­lo pa­ra es­te si­tio. hay que lim­piar­lo un po­co an­tes de que que­de lin­do.

¿Lo pueden usar los demás?

Pronti­to, es­pe­ro.

¿Faltan features?

No tie­ne tags, y al­gu­na co­si­ta me­no­r.

Blog en espera

Quie­ro ha­cer al­gu­nas co­sas con es­te blog (o más bien, con mi "pre­sen­cia we­b" en ge­ne­ra­l) y el tiem­po pa­ra ha­cer­las tie­ne que salir de al­gu­na par­te, así que es­tá salien­do del tiem­po que usa­ría pa­ra es­cri­bir en el blo­g.

Voy a vol­ve­r, es­pe­ro, a un cro­no­gra­ma más fre­cuen­te en una se­ma­na.


Contents © 2000-2024 Roberto Alsina