Estos son los apuntes que he tomado cambiándo a la última versión del tema FixIt.
Al cambiar la versión del tema he aprovechado para pulir algunos pequeños errores y de momento lo dejo en un sólo idioma. Nunca conseguí tiempo para hacer las traducciones de los artículos.
Instalación
Nos creamos un repo en Github a partir del template que Lruihao (el autor del tema) ha publicado aqui.
Clonamos este nuevo repo en nuestro disco. Me he hecho copias de este template tanto en git.comacero.com como en mi gitlab
hsrv
# hsrv: aliased to hugo --buildDrafts server --disableFastRender
Procedemos con la configuración
Configuración
Vamos a usar un directorio de configuración como se describe en la documentación de Hugo.
config.toml
En el directorio de configuración tenemos la configuración organizada en distintos ficheros. El primero que necesitamos es config.toml que queda con el siguiente contenido:
# -------------------------------------------------------------------------------------# Hugo Configuration# See: https://gohugo.io/getting-started/configuration/# -------------------------------------------------------------------------------------# title = "Hugo FixIt Blog"title="comacero"baseURL="http://comacero.com/"theme="FixIt"defaultContentLanguage="es"languageCode="es"hasCJKLanguage=trueenableRobotsTXT=trueenableEmoji=trueenableGitInfo=truerelativeURLs=falsebuildDrafts=falsesummaryLength=150# ignore some build errorsignoreErrors=["error-remote-getjson","error-missing-instagram-accesstoken"]
params.toml
A continuación configuramos el fichero params.toml
En la primera sección del fichero cambiamos sólo tres líneas, configurando la descripción y el tema por defecto. Y ademas desativamos (de momento) la opción gitRepo.
# -------------------------------------------------------------------------------------# Theme Core Configuration# See: https://fixit.lruihao.cn/theme-documentation-basics/#site-configuration# -------------------------------------------------------------------------------------# FixIt 0.2.15 | CHANGED FixIt theme versionversion="0.2.X"# e.g. "0.2.X", "0.2.15", "v0.2.15" etc.# site descriptiondescription="Notas personales sobre hardware y software libres"# site keywordskeywords=["Hugo","FixIt"]# site default theme ["light", "dark", "auto"]defaultTheme="dark"# public git repo url only then enableGitInfo is true# gitRepo = ""# FixIt 0.1.1 | NEW which hash function used for SRI, when empty, no SRI is used# ["sha256", "sha384", "sha512", "md5"]fingerprint=""# FixIt 0.2.0 | NEW date formatdateFormat="2006-01-02"# website images for Open Graph and Twitter Cardsimages=[]# FixIt 0.2.12 | NEW enable PWAenablePWA=false# FixIt 0.2.14 | NEW whether to add external Icon for external links automaticallyexternalIcon=false# FixIt 0.2.14 | NEW FixIt will, by default, inject a theme meta tag in the HTML head on the home page only.# You can turn it off, but we would really appreciate if you don’t, as this is a good way to watch FixIt's popularity on the rise.disableThemeInject=false
En las secciones siguientes (app y search) del fichero params.toml no cambiamos nada de momento. Aunque probablemente probemos con otros motores de búsqueda en el futuro.
# FixIt 0.2.0 | NEW App icon config[app]# optional site title override for the app when added to an iOS home screen or Android launchertitle=""# whether to omit favicon resource linksnoFavicon=false# modern SVG favicon to use in place of older style .png and .ico filessvgFavicon=""# Safari mask icon coloriconColor="#5bbad5"# Windows v8-10 tile colortileColor="#da532c"# FixIt 0.2.12 | CHANGED Android browser theme color[app.themeColor]light="#f8f8f8"dark="#252627"# FixIt 0.2.0 | NEW Search config[search]enable=true# type of search engine ["lunr", "algolia", "fuse"]type="lunr"# max index length of the chunked contentcontentLength=4000# placeholder of the search barplaceholder="test"# FixIt 0.2.1 | NEW max number of results lengthmaxResultLength=10# FixIt 0.2.3 | NEW snippet length of the resultsnippetLength=30# FixIt 0.2.1 | NEW HTML tag name of the highlight part in resultshighlightTag="em"# FixIt 0.2.4 | NEW whether to use the absolute URL based on the baseURL in search indexabsoluteURL=false[search.algolia]index=""appID=""searchKey=""[search.fuse]# FixIt 0.2.17 | NEW https://fusejs.io/api/options.htmlisCaseSensitive=falseminMatchCharLength=2findAllMatches=falselocation=0threshold=0.3distance=100ignoreLocation=falseuseExtendedSearch=falseignoreFieldNorm=false
En la siguiente sección (header) si que hacemos cambios. Configuramos el logo, el nombre de la web. y el subtítulo que aparecerá en la cabecera.
Para configurar el logo tendremos que añadir el fichero cerito.svg en el directorio assets/images. Tendremos que crear ese directorio y copiar el fichero cerito.svg en el mismo.
# Header config[header]# FixIt 0.2.13 | CHANGED desktop header mode ["sticky", "normal", "auto"]desktopMode="sticky"# FixIt 0.2.13 | CHANGED mobile header mode ["sticky", "normal", "auto"]mobileMode="auto"# FixIt 0.2.0 | NEW Header title config[header.title]# URL of the LOGOlogo="/images/cerito.svg"# title namename="comacero"# you can add extra information before the name (HTML format is supported), such as iconspre=" "# you can add extra information after the name (HTML format is supported), such as iconspost=""# FixIt 0.2.5 | NEW whether to use typeit animation for title nametypeit=false# FixIt 0.2.12 | NEW Header subtitle config[header.subtitle]# subtitle namename="Notas sobre hardware y software libres"# whether to use typeit animation for subtitle nametypeit=false# FixIt 0.2.18 | NEW Breadcrumb config[breadcrumb]enable=falsesticky=falseshowHome=false
En la sección footer cambiamos sólo el parámetro site creation year.
# Footer config[footer]enable=true# FixIt 0.2.17 | CHANGED Custom content (HTML format is supported)# For advanced use, see parameter `params.customFilePath.footer`custom=""# FixIt 0.2.0 | NEW whether to show Hugo and theme infohugo=true# FixIt 0.2.0 | NEW whether to show copyright infocopyright=true# FixIt 0.2.0 | NEW whether to show the authorauthor=true# Site creation yearsince=2019# FixIt 0.2.14 | NEW whether to show total word count of site contentwordCount=true# FixIt 0.2.12 | NEW Public network security only in China (HTML format is supported)gov=""# ICP info only in China (HTML format is supported)icp=""# license info (HTML format is supported)license='<a rel="license external nofollow noopener noreferrer" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a>'# FixIt 0.2.17 | CHANGED Site creation time# FixIt 0.2.17 | CHANGED Site creation time[footer.siteTime]enable=falseanimate=trueicon="fa-solid fa-heartbeat"pre=""value=""# e.g. "2021-12-18T16:15:22+08:00"# FixIt 0.2.17 | NEW footer lines order, optional values: ["first", 0, 1, 2, 3, 4, 5, "last"][footer.order]powered=0copyright=0statistics=0visitor=0beian=0
En las secciones section, list y tagcloud no hacemos cambios de momento.
# FixIt 0.2.0 | NEW Section (all posts) page config[section]# special amount of posts in each section pagepaginate=20# date format (month and day)dateFormat="01-02"# amount of RSS pagesrss=10# FixIt 0.2.13 | NEW recently updated posts settings[section.recentlyUpdated]enable=falserss=falsedays=30maxCount=10# FixIt 0.2.0 | NEW List (category or tag) page config[list]# special amount of posts in each list pagepaginate=20# date format (month and day)dateFormat="01-02"# amount of RSS pagesrss=10# FixIt 0.2.17 | NEW TagCloud config for tags page[tagcloud]enable=falsemin=14# Minimum font size in pxmax=32# Maximum font size in pxpeakCount=10# Maximum count of posts per tagorderby="name"# Order of tags, optional values: ["name", "count"]
En la seccion home hacemos los cambios marcados en el listado. Es importante borrar el correo del gravatar para que el tema cargue la imagen que le pasamos.
# Home page config[home]# FixIt 0.2.0 | NEW amount of RSS pagesrss=10# Home page profile[home.profile]enable=true# Gravatar Email for preferred avatar in home pagegravatarEmail=""# URL of avatar shown in home pageavatarURL="/images/cerito.svg"# FixIt 0.2.17 | NEW identifier of avatar menu linkavatarMenu=""# FixIt 0.2.7 | CHANGED title shown in home page (HTML format is supported)title=""# subtitle shown in home pagesubtitle="Apuntes personales de hardware y software libres"# whether to use typeit animation for subtitletypeit=true# whether to show social linkssocial=true# FixIt 0.2.0 | NEW disclaimer (HTML format is supported)disclaimer="Sólo para autoconsumo (^_^)"# Home page posts[home.posts]enable=true# special amount of posts in each home posts pagepaginate=6
En la sección social puedes rellenar todas las RRSS que te apetezca que aparezcan en tu página. No voy a detallar todos los cambios pero pego la configuración para mastodon y gitea que, al menos en mi caso, es un poco especial:
# -------------------------------------------------------------------------------------# Menu Configuration# See: https://fixit.lruihao.cn/theme-documentation-basics/#menu-advanced-configuration# -------------------------------------------------------------------------------------[[main]]identifier="posts"# you can add extra information before the name (HTML format is supported), such as iconspre=""# you can add extra information after the name (HTML format is supported), such as iconspost=""name="Posts"url="/posts/"# title will be shown when you hover on this menu linktitle=""weight=1# FixIt 0.2.14 | NEW add user-defined content to menu items[main.params]# add css class to a specific menu itemclass=""# whether set as a draft menu item whose function is similar to a draft post/pagedraft=false# FixIt 0.2.16 | NEW add fontawesome icon to a specific menu itemicon="fa-solid fa-archive"# FixIt 0.2.16 | NEW set menu item type, optional values: ["mobile", "desktop"]type=""[[main]]identifier="categories"pre=""post=""name="Categorias"url="/categories/"title=""weight=2[main.params]icon="fa-solid fa-th"[[main]]identifier="tags"pre=""post=""name="Etiquetas"url="/tags/"title=""weight=3[main.params]icon="fa-solid fa-tags"[[main]]identifier="links"pre=""post=""name="Enlaces"url="/links/"title=""weight=6[main.params]icon="fa-solid fa-link"[[main]]identifier="about"pre=""post=""name="Acerca de"url="/about/"title=""weight=10[main.params]icon="fa-solid fa-info-circle"
Actualizaciones
2024-07-05
Actualizado hugo a la versión v0.128.2
Actualizado FixIt a la versión v0.3.8
Busquedas con lunr dejan de funcionar, cambiamos a fuse
Actualizados los ficheros de configuración copiando del template