2024-09-16 14:51:50 +02:00
|
|
|
;; Set the package installation directory so that packages aren't stored in the
|
|
|
|
;; ~/.emacs.d/elpa path.
|
|
|
|
(require 'package)
|
|
|
|
(setq package-user-dir (expand-file-name "./.packages"))
|
|
|
|
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
|
|
|
|
("elpa" . "https://elpa.gnu.org/packages/")))
|
|
|
|
|
|
|
|
;; Initialize the package system
|
|
|
|
(package-initialize)
|
|
|
|
(unless package-archive-contents
|
|
|
|
(package-refresh-contents))
|
|
|
|
|
|
|
|
;; Install dependencies
|
|
|
|
(package-install 'htmlize)
|
2024-09-20 20:26:04 +02:00
|
|
|
(package-install 'f)
|
2024-09-16 14:51:50 +02:00
|
|
|
|
|
|
|
;; Load the publishing system
|
|
|
|
(require 'ox-publish)
|
2024-09-20 20:26:04 +02:00
|
|
|
(require 'f)
|
2024-09-16 14:51:50 +02:00
|
|
|
|
|
|
|
;; Customize the HTML output
|
|
|
|
(setq org-html-validation-link nil ;; Don't show validation link
|
|
|
|
org-html-head-include-scripts nil ;; Use our own scripts
|
|
|
|
org-html-head-include-default-style nil ;; Use our own styles
|
|
|
|
;; org-html-head "<link rel=\"stylesheet\" href=\"https://cdn.simplecss.org/simple.min.css\" /><link rel=\"icon\" type=\"image/x-icon\" href=\"../assets/favicon.ico\"><link rel=\"stylesheet\" href=\"../assets/custom.css\">")
|
2024-11-03 19:19:24 +01:00
|
|
|
;; @TODO fix favicon link
|
|
|
|
;; @TODO <link rel="stylesheet" href="/path/to/custom.css">
|
2024-09-16 14:51:50 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
(defvar novelli-html-head "<link rel=\"stylesheet\" href=\"https://cdn.simplecss.org/simple.min.css\" /><link rel=\"icon\" type=\"image/x-icon\" href=\"../assets/favicon.ico\"><link rel=\"stylesheet\" href=\"../assets/custom.css\">")
|
|
|
|
|
|
|
|
(defvar novelli-html-head-nested-1 (replace-regexp-in-string "../assets" "../../assets" novelli-html-head))
|
|
|
|
|
2024-09-20 20:26:04 +02:00
|
|
|
;; Read assets lio.txt
|
2024-11-03 19:19:24 +01:00
|
|
|
(defvar novelli-header-menu (concat "<div class=\"title logo\"><a href=\"index.html\"><pre class=\"rainbow rainbow_text_animated\">" (f-read "assets/lio.txt" 'utf-8) "</pre></a></div>
|
2024-10-07 19:14:22 +02:00
|
|
|
<div class=\"nav\">" (f-read "assets/menu.html" ) "</div>
|
|
|
|
<div class=\"language-menu test\"><a class=\"lang\" href=\"/\">SL</a> / <a class=\"lang\" href=\"en/\">EN</a></div>"))
|
2024-11-03 19:19:24 +01:00
|
|
|
(defvar novelli-header-menu-en (concat "<div class=\"title logo\"><a href=\"index.html\"><pre class=\"rainbow rainbow_text_animated\">" (f-read "assets/lio.txt" 'utf-8) "</pre></a></div>
|
|
|
|
<div class=\"nav\">" (f-read "assets/menu-en.html" ) "</div>
|
|
|
|
<div class=\"language-menu test\"><a class=\"lang\" href=\"/\">SL</a> / <a class=\"lang\" href=\"en/\">EN</a></div>"))
|
|
|
|
(defvar novelli-header-menu-nested-1 (replace-regexp-in-string "href=\"" "href=\"..\/" novelli-header-menu))
|
|
|
|
|
|
|
|
;; https://www.danliden.com/posts/20211203-this-site.html
|
|
|
|
;; https://thibaultmarin.github.io/blog/posts/2016-11-13-Personal_website_in_org.html#orgace8e3d
|
|
|
|
(defun lio/org-publish-org-sitemap-format (entry style project)
|
|
|
|
"Custom sitemap entry formatting: add date"
|
|
|
|
(cond ((not (directory-name-p entry))
|
|
|
|
(format "[[file:%s][(%s) %s]]"
|
|
|
|
entry
|
|
|
|
(format-time-string "%Y-%m-%d"
|
|
|
|
(org-publish-find-date entry project))
|
|
|
|
(org-publish-find-title entry project)))
|
|
|
|
((eq style 'tree)
|
|
|
|
;; Return only last subdir.
|
|
|
|
(file-name-nondirectory (directory-file-name entry)))
|
|
|
|
(t entry)))
|
2024-09-20 20:26:04 +02:00
|
|
|
|
2024-09-16 14:51:50 +02:00
|
|
|
;; Define the publishing project
|
|
|
|
(setq org-publish-project-alist
|
|
|
|
(list
|
|
|
|
(list "org-site:main"
|
|
|
|
:recursive t
|
|
|
|
:base-directory "./content"
|
|
|
|
:publishing-function 'org-html-publish-to-html
|
|
|
|
:publishing-directory "./public"
|
|
|
|
:with-author nil ;; Don't include author name
|
|
|
|
:with-creator t ;; Include Emacs and Org versions in footer
|
|
|
|
:with-toc t ;; Include a table of contents
|
|
|
|
:section-numbers nil ;; Don't include section numbers
|
|
|
|
:html-head novelli-html-head
|
2024-11-03 19:19:24 +01:00
|
|
|
:html-preamble novelli-header-menu
|
2024-09-23 11:02:08 +02:00
|
|
|
;; :auto-preamble t
|
|
|
|
:auto-sitemap t
|
|
|
|
:sitemap-filename "sitemap.org"
|
|
|
|
:sitemap-title "Pregled strani"
|
|
|
|
:sitemap-sans-extension t
|
|
|
|
:sitemap-style 'tree
|
|
|
|
:sitemap-file-entry-format "%t"
|
|
|
|
:html-postamble "<hr/>
|
|
|
|
<footer><span><a href=\"https://git.kompot.si/lio/osebna-stran\">Spletna stran</a> v izgradnji.</span></footer>"
|
2024-09-16 14:51:50 +02:00
|
|
|
:time-stamp-file nil)
|
2024-09-23 11:02:08 +02:00
|
|
|
(list "blog"
|
|
|
|
:base-directory "./content/blog"
|
|
|
|
:base-extension "org"
|
|
|
|
:publishing-directory "./public/blog"
|
|
|
|
:publishing-function 'org-html-publish-to-html
|
|
|
|
:section-numbers nil
|
|
|
|
:with-toc nil
|
|
|
|
:html-head novelli-html-head-nested-1
|
|
|
|
;; :html-head-extra
|
|
|
|
;; "<link rel=\"alternate\" type=\"application/rss+xml\"
|
|
|
|
;; href=\"http://nicolas-petton.fr/blog/blog.xml\"
|
|
|
|
;; title=\"RSS feed\">"
|
2024-11-03 19:19:24 +01:00
|
|
|
:html-preamble novelli-header-menu-nested-1
|
2024-09-23 11:02:08 +02:00
|
|
|
:auto-sitemap t
|
|
|
|
:sitemap-title "Objave"
|
|
|
|
:sitemap-filename "index.org"
|
2024-11-03 19:19:24 +01:00
|
|
|
:sitemap-format-entry 'lio/org-publish-org-sitemap-format
|
2024-09-23 11:02:08 +02:00
|
|
|
;; :html-postamble ,nico-website-html-postamble
|
|
|
|
;; :sitemap-filename "sitemap.org"
|
|
|
|
;; :sitemap-sort-files 'anti-chronologically
|
|
|
|
)
|
2024-11-03 19:19:24 +01:00
|
|
|
(list "org-site:en"
|
2024-09-16 14:51:50 +02:00
|
|
|
:recursive t
|
|
|
|
:base-directory "./en"
|
|
|
|
:publishing-function 'org-html-publish-to-html
|
|
|
|
:publishing-directory "./public/en"
|
|
|
|
:with-author nil ;; Don't include author name
|
|
|
|
:with-creator t ;; Include Emacs and Org versions in footer
|
|
|
|
:with-toc t ;; Include a table of contents
|
|
|
|
:section-numbers nil ;; Don't include section numbers
|
|
|
|
:html-head novelli-html-head-nested-1
|
2024-11-03 19:19:24 +01:00
|
|
|
:html-preamble novelli-header-menu-en
|
2024-09-16 14:51:50 +02:00
|
|
|
:time-stamp-file nil
|
2024-11-03 19:19:24 +01:00
|
|
|
:auto-sitemap t
|
|
|
|
:sitemap-filename "sitemap.org"
|
|
|
|
:sitemap-title "Sitemap"
|
|
|
|
:sitemap-sans-extension t
|
|
|
|
:sitemap-style 'tree
|
|
|
|
)
|
|
|
|
(list "org-site:assets"
|
|
|
|
:base-directory "./assets"
|
|
|
|
:publishing-function 'org-publish-attachment
|
|
|
|
:base-extension "css\\|js\\|ttf\\|woff2\\|ico"
|
|
|
|
:publishing-directory "./public/assets"
|
|
|
|
:recursive t
|
2024-09-16 14:51:50 +02:00
|
|
|
)
|
|
|
|
)) ;; Don't include time stamp in file
|
|
|
|
|
|
|
|
;; Generate the site output
|
|
|
|
(org-publish-all t)
|
|
|
|
|
|
|
|
(message "Build complete!")
|