Hugo generador de páginas web estáticas: Script para generar la configuración inicial.

Table of contents

Código del Script

Este script que os dejo a continuación me ha servido para generar este sitio web en sus momento iniciales ya que para mi era un poco incomodo tener que estar editando todos los archivos de uno en uno para hace pruebas y ver el resultado de la configuración de Hugo. Con este script tenemos toda la configuración inicial en un solo archivo para poder hacer pruebas de configuración con Hugo relativamente fácil.

hugo-script-create-basic-site.sh

Probando el script

Descarga

root@kali:~# wget https://raw.githubusercontent.com/VielLosero/scripts/master/hugo-SSG/hugo-script-create-basic-site.sh
--2019-10-15 13:59:20--  https://raw.githubusercontent.com/VielLosero/scripts/master/hugo-SSG/hugo-script-create-basic-site.sh
Resolviendo raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Conectando con raw.githubusercontent.com (raw.githubusercontent.com)[151.101.0.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 10006 (9,8K) [text/plain]
Grabando a: “hugo-script-create-basic-site.sh”

hugo-script-create-basic-site.sh        100%[=============================================================================>]   9,77K  --.-KB/s    en 0s      

2019-10-15 13:59:21 (39,1 MB/s) - “hugo-script-create-basic-site.sh” guardado [10006/10006]

root@kali:~# 

Ejecución

Cambiamos los permisos

root@kali:~# chmod +x hugo-script-create-basic-site.sh

Editamos las rutas y lo ejecutamos

root@kali:~# ./hugo-script-create-basic-site.sh                                                                                                               
[*] Generating basic structure with hugo templates                                                                                                            
Congratulations! Your new Hugo site is created in /home/user/mi_new_static_website/mi_blog.                                                                   
                                                                                                                                                              
Just a few more steps and you're ready to go:                                                                                                                 
                                                                                                                                                              
1. Download a theme into the same-named folder.                                                                                                               
   Choose a theme from https://themes.gohugo.io/ or                                                                                                           
   create your own with the "hugo new theme <THEMENAME>" command.                                                                                             
2. Perhaps you want to add some content. You can add single files                                                                                             
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".                                                                                                         
3. Start the built-in live server via "hugo server".                                                                                                          
                                                                                                                                                              
Visit https://gohugo.io/ for quickstart guide and full documentation.                                                                                         
Creating theme at /home/user/mi_new_static_website/mi_blog/themes/mi_theme                                                                                    
[*] Creating baseof.html
[*] Creating index.html
[*] Creating list.html
[*] Creating single.html
[*] Creating head.html
[*] Creating header.html
[*] Creating footer.html
[*] Creating config.toml
[*] Generating css
[*] Creating content files
/home/user/mi_new_static_website/mi_blog/content/_index.en.md created
/home/user/mi_new_static_website/mi_blog/content/posts/post1.md created
[*] Making dir for images
[*] Generating pygments
[*] Generating Multilanguage Menu
[*] Making dir for static images like logo
[*] Starting Hugo Server

                   | EN | ES  
+------------------+----+----+
  Pages            | 11 |  8  
  Paginator pages  |  0 |  0  
  Non-page files   |  0 |  0  
  Static files     |  2 |  2  
  Processed images |  0 |  0  
  Aliases          |  1 |  0  
  Sitemaps         |  2 |  1  
  Cleaned          |  0 |  0  

Total in 16 ms
Watching for changes in /home/user/mi_new_static_website/mi_blog/{archetypes,content,data,layouts,static,themes}
Watching for config changes in /home/user/mi_new_static_website/mi_blog/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Resultado

Aquí tenemos el resultado.

Imágen ejecutando script

back

Referencias:

How to make gifs with ffmpeg

Licencia: CC-BY-SA