diff --git a/.build/ox-hugo-build.el b/.build/ox-hugo-build.el new file mode 100644 index 0000000..938b66c --- /dev/null +++ b/.build/ox-hugo-build.el @@ -0,0 +1,35 @@ +;; Package configuration +(package-initialize) +(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) + +(setq-default load-prefer-newer t) +(setq-default package-enable-at-startup nil) + +(package-refresh-contents) +(package-install 'use-package) +(setq package-user-dir (expand-file-name "./.packages")) +(add-to-list 'load-path package-user-dir) +(require 'use-package) + +(setq use-package-always-ensure t) + +;; Install and configure necessary packages +(use-package org + :pin gnu + :config + (setq org-todo-keywords '((sequence + "TODO(t!)" "NEXT(n!)" "STARTED(a!)" "WAIT(w@/!)" "SOMEDAY(s)" + "|" "DONE(d!)" "CANCELLED(c@/!)")))) + +(use-package ox-hugo + :after org) + +;; Export blog posts +(defun mmk2410/export (file) + (save-excursion + (find-file file) + (org-hugo-export-wim-to-md t))) + +(mapcar (lambda (file) (mmk2410/export file)) + (directory-files (expand-file-name "./content-org/") t "\\.org$")) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..a201988 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +variables: + GIT_SUBMODULE_STRATEGY: recursive + +build: + image: silex/emacs:27.2-alpine-ci + stage: build + script: + - emacs -Q --script .build/ox-hugo-build.el + - apk add --no-cache hugo + - hugo + artifacts: + paths: + - public diff --git a/.gitmodules b/.gitmodules index 7ed20e2..9b3aa84 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "nextDESIGN"] path = themes/nextDESIGN - url = git@git.mmk2410.org:mmk2410/nextDESIGN + url = ../nextDESIGN diff --git a/content-org/blog.org b/content-org/blog.org index f39eced..da66d8d 100644 --- a/content-org/blog.org +++ b/content-org/blog.org @@ -333,7 +333,7 @@ But there is currently a problem. When exporting an Org buffer e.g. to Markdown "https://git.mmk2410.org/%n/commit/%r")) ;; The link to the revision #+end_src -As written in the documentation for =orgit-export-alist= it is also possible to set these values using the =git config= command with the keys =orgit.status=, =orgit.log= and =orgit.commit=. Thereby only the =%r= (the revision) must appear in the string of the last two keys. The =%n= in the code above will get expanded to the path of the project. Using this configuration the exporting works and I can now also link here to my projects overview page ([[orgit:~/projects/mmk2410.org/][projects overview page]]) and the commit of my last blog post ([[orgit-rev:~/projects/mmk2410.org/::e1b5ee5496fe7147c77985ac5f49e8bb7f4d4725][commit of my last blog post]] ). +As written in the documentation for =orgit-export-alist= it is also possible to set these values using the =git config= command with the keys =orgit.status=, =orgit.log= and =orgit.commit=. Thereby only the =%r= (the revision) must appear in the string of the last two keys. The =%n= in the code above will get expanded to the path of the project. Using this configuration the exporting works and I can now also link here to my projects overview page and the commit of my last blog post (/Update 2021-02-03: Well, at least in theory and also locally. But since I'm now probably building my block using a GitLab CI pipeline the links to not work since Orgit cannot find the directory in the link location. Therefore I needed to remove the links./). That's it! I sure will integrate this package into my workflow and Emacs configuration and I hope you enjoyed this brief presentation.