From dedeeb1904a68743b393d39c5dbadc0c6a729ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ruvalcaba?= Date: Mon, 15 May 2023 15:52:14 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Actualizar=20Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reestructuración del archivo Makefile. Implementación de la tarea «timestamp». --- Makefile | 75 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index a73bacd..a8b3061 100644 --- a/Makefile +++ b/Makefile @@ -12,13 +12,13 @@ # See the FSF All-Permissive License for more details # . -MARKDOWN_CONFIG_FILE?=.markdownlint.yml MARKDOWN_DIR?=md MARKDOWN_FILE?=$(shell bash -c 'read -p "Nombre del archivo Markdown: " file_name; echo $$file_name') -MARKDOWNLINT_OPTIONS?=--disable MD013 +MARKDOWNLINT_OPTIONS?= BLOG_DIR?=content/blog PUBLIC_DIR?=public REMOTEHOST_NAME?=ivanruvalcaba@tilde.team:public_gemini +TIMESTAMP?=`date +%FT%T%:z` # Variables utilizadas para colorear los mensajes mostrados en la ayuda. GREEN := $(shell tput -Txterm setaf 2) @@ -29,38 +29,6 @@ RESET := $(shell tput -Txterm sgr0) all: help -## build: -build: ## Generar el directorio público. - @echo "Generar el directorio público…" - kiln build - -## mdconvert: -mdconvert: ## Convertir el contenido de un archivo Markdown a Gemtext. - @echo "Convertir archivo Markdown a Gemtext…" - md2gemini \ - --plain \ - --frontmatter \ - --no-checklist \ - --links 'at-end' \ - --write $(MARKDOWN_DIR)/$(MARKDOWN_FILE) \ - --dir $(BLOG_DIR) - -## deploy: -deploy: clean build ## Hospedar el directorio público en el host remoto. - @echo "Desplegar el directrio «${PUBLIC_DIR}» a «${REMOTEHOST_NAME}»…" - rsync -rtvzP --delete $(PUBLIC_DIR)/ $(REMOTEHOST_NAME)/ - -## mdlint: -mdlint: ## Ejecutar el «lintern» a los archivos Markdown en el directorio de contenido. - # Véase: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md - @echo "Realizar el «linting» de los archivos Markdown en el directorio «${MARKDOWN_DIR}»…" - markdownlint --config $(MARKDOWN_DIR)/$(MARKDOWN_CONFIG_FILE) $(MARKDOWN_DIR)/ $(MARKDOWNLINT_OPTIONS) - -## clean: -clean: ## Eliminar el directorio público. - @echo "Eliminar el directorio «${PUBLIC_DIR}»…" - rm -rf $(PUBLIC_DIR) - ## help: help: ## Mostrar la ayuda. @echo '' @@ -75,6 +43,43 @@ help: ## Mostrar la ayuda. else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \ }' $(MAKEFILE_LIST) -.PHONY: all build clean deploy help mdconvert mdlint +## build: +build: ## Generar el directorio público. + @echo "Generar el directorio público…" + kiln build + +## clean: +clean: ## Eliminar el directorio público. + @echo "Eliminar el directorio «${PUBLIC_DIR}»…" + rm -rf $(PUBLIC_DIR) + +## deploy: +deploy: clean build ## Hospedar el directorio público en el host remoto. + @echo "Desplegar el directrio «${PUBLIC_DIR}» a «${REMOTEHOST_NAME}»…" + rsync -rtvzP --delete $(PUBLIC_DIR)/ $(REMOTEHOST_NAME)/ + +## mdconvert: +mdconvert: ## Convertir el contenido de un archivo Markdown a Gemtext. + @echo "Convertir archivo Markdown a Gemtext…" + md2gemini \ + --plain \ + --frontmatter \ + --no-checklist \ + --links 'at-end' \ + --write $(MARKDOWN_DIR)/$(MARKDOWN_FILE) \ + --dir $(BLOG_DIR) + +## mdlint: +mdlint: ## Ejecutar el «lintern» a los archivos Markdown en el directorio de contenido. + # Véase: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md + @echo "Realizar el «linting» de los archivos Markdown ubicados en el directorio «${MARKDOWN_DIR}»…" + markdownlint $(MARKDOWN_DIR)/ $(MARKDOWNLINT_OPTIONS) + +## timestamp: +timestamp: ## Imprimir en pantalla la fecha y hora actual del sistema en un formato RFC 3339. + @echo "Mostrar la fecha y hora actual del sistema…" + @echo $(TIMESTAMP) + +.PHONY: all build clean deploy help mdconvert mdlint timestamp # vim: setlocal cc=80 ts=8 sw=8 noet: