source: .emacs@ 3cc0a68

Last change on this file since 3cc0a68 was 3cc0a68, checked in by Mikhail Kirillov <w96k@…>, on Apr 16, 2022 at 5:09:16 AM

Add emacs config link

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