source: .emacs@ 6596178

Last change on this file since 6596178 was 6596178, checked in by Mikhail Kirillov <w96k@…>, on Apr 21, 2022 at 7:34:43 AM

Add guix page. Add Articles page.

  • Property mode set to 100644
File size: 5.2 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(setq current-folder (file-truename "./"))
11
12(defvar youtube-iframe-format
13 ;; You may want to change your width and height.
14 (concat "<iframe id=\"ivplayer\" type=\"text/html\""
15 "src=\"https://youtube.host.w96k.dev/embed/%s\""
16 " frameborder=\"0\""
17 " allowfullscreen>%s</iframe>"))
18
19(defvar local-video-format
20 ;; You may want to change your width and height.
21 (concat "<video controls>"
22 "<source src=\"/public/videos/%s\"> Video are not supported </video>"))
23
24(org-add-link-type
25 "peertube"
26 (lambda (handle)
27 (browse-url
28 (concat "https://peervideo.ru/videos/embed/"
29 handle)))
30 (lambda (path desc backend)
31 (cl-case backend
32 (html (format peertube-iframe-format
33 path (or desc "")))
34 (latex (format "\href{%s}{%s}"
35 path (or desc "video"))))))
36
37(org-add-link-type
38 "youtube"
39 (lambda (handle)
40 (browse-url
41 (concat "https://invidiou.site/embed/"
42 handle)))
43 (lambda (path desc backend)
44 (cl-case backend
45 (html (format youtube-iframe-format
46 path (or desc "")))
47 (latex (format "\href{%s}{%s}"
48 path (or desc "video"))))))
49
50(org-add-link-type
51 "video"
52 (lambda (handle)
53 (browse-url
54 (concat "/"
55 handle)))
56 (lambda (path desc backend)
57 (cl-case backend
58 (html (format local-video-format
59 path (or desc "")))
60 (latex (format "\href{%s}{%s}"
61 path (or desc "video"))))))
62
63(setq org-publish-project-alist
64 `(("blog"
65 :components ("blog-content" "blog-styles")
66 :base-directory current-folder)
67 ("blog-styles"
68 :base-directory ,(concat current-folder "public")
69 :base-extension "jpg\\|webp\\|gif\\|svg\\|png\\|ico\\|css\\|txt\\|pdf\\|webm\\|mp4\\|mp3\\|flac\\|mov"
70 :publishing-directory ,(concat current-folder "dist/public")
71 :recursive t
72 :publishing-function org-publish-attachment
73 )
74 ("blog-content"
75 :base-directory ,(concat current-folder "content")
76 :publishing-directory ,(concat current-folder "dist")
77 :recursive t
78 :publishing-function org-html-publish-to-html
79
80 :html-doctype "html5"
81
82 :with-title nil
83 :with-author t
84 :with-creator nil
85 :with-date t
86 :with-email t
87 :with-footnotes t
88 :html-html5-fancy t
89 :html-preamble "
90<header class=\"navbar\">
91<a href=\"/\" class=\"button logo\">~w96k</a>
92<a class=\"button\" href=\"/articles.html\">Articles</a>
93<a class=\"button\" href=\"/cv.html\">CV</a>
94<a class=\"button\" href=\"/music.html\">Music</a>
95<a class=\"button\" href=\"/emacs.html\">Emacs</a>
96<a class=\"button\" href=\"/guix.html\">Guix</a>
97</header>"
98
99 :html-head "
100<link rel=\"shortcut icon\" href=\"/public/favicon.png\">
101<link rel=\"stylesheet\" href=\"/public/css/mini.css\" type=\"text/css\"/>
102<link rel=\"stylesheet\" href=\"/public/css/custom.css\" type=\"text/css\"/>
103"
104
105 :html-container "article"
106 :html-postamble "
107 <div class=\"row\">
108
109 <div id=\"copyright\" class=\"col-sm-12 col-md-4\">
110 <p>Mikhail Kirillov © 2019-2022</p>
111 <p style=\"style=\"opacity: 0.7;\">
112 Works in <a href=\"https://anybrowser.org/campaign/\">any browser</a>
113 </p>
114 </div>
115
116 <div class=\"col-sm-12 col-md-3\">
117 <p class=\"licenses\">
118 <a href=\"https://creativecommons.org/licenses/by/4.0/\">
119 <img alt=\"Creative Commons License\" src=\"/public/images/cc.png\" />
120</a>
121<!--
122 <a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">
123 <img src=\"/public/images/gpl.png\">
124 </a>
125-->
126 </p>
127 </div>
128
129 <div class=\"col-sm-12 col-md-5\" id=\"meta\">
130 <p><span class=\"icon-settings\"></span> %c</p>
131 <p><span class=\"icon-calendar\"></span> %C</p>
132 </div>
133 </div>
134
135 <br>
136 <div align=\"center\">
137 <small>
138 <p>The content is distributed under license
139 <a href=\"https://creativecommons.org/licenses/by-sa/4.0/deed.en\">
140 Creative Commons «Attribution-ShareAlike» 4.0 International (CC BY-SA 4.0)
141 </a>
142 </p>
143 </small>
144 </div>"
145
146 :section-numbers nil
147 :with-sub-superscript nil
148
149 ;; sitemap - list of blog articles
150 :auto-sitemap t
151 :sitemap-filename "sitemap.org"
152 :sitemap-title "@w96k"
153 :sitemap-sort-files chronologically)))
154
155;; Don't ask for block evaluation
156(setq org-confirm-babel-evaluate nil)
157
158;; Set output folder
159(setq httpd-root (concat current-folder "/dist/"))
160
161;; Fix image width
162(setq org-image-actual-width nil)
163
164;; PDF output settings
165(setq org-latex-listings 'minted)
166(setq org-latex-tables-centered nil)
167(add-to-list 'org-latex-packages-alist '("russian" "babel"))
168(add-to-list 'org-latex-packages-alist '("" "minted"))
169(add-to-list 'org-latex-packages-alist '("" "nopageno"))
170(add-to-list 'org-latex-packages-alist '("utf8x" "inputenc"))
171(add-to-list 'org-latex-packages-alist '("a4paper, margin=0.75in" "geometry"))
172
173(setq org-src-fontify-natively t)
174
175
Note: See TracBrowser for help on using the repository browser.