source: .emacs@ 80f6e09

Last change on this file since 80f6e09 was df6c052, checked in by w96k <w96k@…>, on Oct 23, 2022 at 2:58:52 AM

Change license from cc-by-sa to cc0

  • Property mode set to 100644
File size: 3.8 KB
Line 
1;;; Emacs configuration for building a project
2
3(require 'org)
4(require 'ox-publish)
5(require 'ox-latex)
6;; (require 'org-webring)
7(require 's)
8(require 'simple-httpd)
9
10
11(setq org-html-head-include-default-style nil)
12
13(setq current-folder (file-truename "./"))
14
15(defvar youtube-iframe-format
16 ;; You may want to change your width and height.
17 (concat "<iframe id=\"ivplayer\" type=\"text/html\""
18 "src=\"https://youtube.host.w96k.dev/embed/%s\""
19 " frameborder=\"0\""
20 " allowfullscreen>%s</iframe>"))
21
22(defvar local-video-format
23 ;; You may want to change your width and height.
24 (concat "<video controls>"
25 "<source src=\"/public/videos/%s\"> Video are not supported </video>"))
26
27(org-add-link-type
28 "youtube"
29 (lambda (handle)
30 (browse-url
31 (concat "https://invidiou.site/embed/"
32 handle)))
33 (lambda (path desc backend)
34 (cl-case backend
35 (html (format youtube-iframe-format
36 path (or desc "")))
37 (latex (format "\href{%s}{%s}"
38 path (or desc "video"))))))
39
40(org-add-link-type
41 "video"
42 (lambda (handle)
43 (browse-url
44 (concat "/"
45 handle)))
46 (lambda (path desc backend)
47 (cl-case backend
48 (html (format local-video-format
49 path (or desc "")))
50 (latex (format "\href{%s}{%s}"
51 path (or desc "video"))))))
52
53(setq org-publish-project-alist
54 `(("blog"
55 :components ("blog-content" "blog-styles")
56 :base-directory current-folder)
57 ("blog-styles"
58 :base-directory ,(concat current-folder "public")
59 :base-extension "jpg\\|webp\\|gif\\|svg\\|png\\|ico\\|css\\|txt\\|pdf\\|webm\\|mp4\\|mp3\\|flac\\|mov\\|html"
60 :publishing-directory ,(concat current-folder "dist/public")
61 :recursive t
62 :publishing-function org-publish-attachment
63 )
64 ("blog-content"
65 :base-directory ,(concat current-folder "content")
66 :publishing-directory ,(concat current-folder "dist")
67 :recursive t
68 :publishing-function org-html-publish-to-html
69
70 :html-doctype "html5"
71
72 :with-title nil
73 :with-author t
74 :with-creator nil
75 :with-date t
76 :with-email t
77 :with-footnotes t
78 :html-preamble "
79<div class=\"navbar\">
80<a href=\"/\">~w96k</a>
81<a href=\"/about.html\">About</a>
82<a href=\"/articles.html\">Articles</a>
83<a href=\"/digarden/\">Digital Garden</a>
84<a href=\"/donate.html\">Donations</a>
85</div>"
86
87 :html-head "
88<link rel=\"shortcut icon\" href=\"/public/favicon_w96k.ico\">
89<link rel=\"stylesheet\" href=\"/public/css/custom.css\" type=\"text/css\"/>
90"
91
92 :html-container "article"
93 :html-postamble "
94
95 <p>w96k Ⓐ 2019-2022</p>
96
97 <p>
98 <a href=\"/legal.html\">
99 License
100 </a><br>
101 <a href=\"/sitemap.html\">
102 Sitemap
103 </a>
104 </p>
105
106
107 <p id=\"meta\">
108 %C
109 </p>"
110
111 :section-numbers nil
112 :with-sub-superscript nil
113
114 ;; sitemap - list of blog articles
115 :auto-sitemap t
116 :sitemap-filename "sitemap.org"
117 :sitemap-title "@w96k"
118 :sitemap-sort-files chronologically)))
119
120;; Don't ask for block evaluation
121(setq org-confirm-babel-evaluate nil)
122
123;; Set output folder
124(setq httpd-root (concat current-folder "/dist/"))
125
126;; Fix image width
127(setq org-image-actual-width nil)
128
129;; PDF output settings
130(setq org-latex-listings 'minted)
131(setq org-latex-tables-centered nil)
132(add-to-list 'org-latex-packages-alist '("russian" "babel"))
133(add-to-list 'org-latex-packages-alist '("" "minted"))
134(add-to-list 'org-latex-packages-alist '("" "nopageno"))
135(add-to-list 'org-latex-packages-alist '("utf8x" "inputenc"))
136(add-to-list 'org-latex-packages-alist '("a4paper, margin=0.75in" "geometry"))
137
138(setq org-src-fontify-natively t)
139
140
Note: See TracBrowser for help on using the repository browser.