source: .emacs@ 1bedcd7

Last change on this file since 1bedcd7 was 1bedcd7, checked in by Mikhail Kirillov <w96k@…>, on Apr 10, 2022 at 6:26:10 PM

Add music page

  • 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</header>"
102
103 :html-head "
104<link rel=\"shortcut icon\" href=\"/public/favicon.png\">
105<link rel=\"stylesheet\" href=\"/public/css/mini.css\" type=\"text/css\"/>
106<link rel=\"stylesheet\" href=\"/public/css/custom.css\" type=\"text/css\"/>
107"
108
109 :html-container "article"
110 :html-postamble "
111 <div class=\"row\">
112
113 <div id=\"copyright\" class=\"col-sm-12 col-md-4\">
114 <p>Mikhail Kirillov © 2019-2022</p>
115 <p style=\"style=\"opacity: 0.7;\">
116 Works in <a href=\"https://anybrowser.org/campaign/\">any browser</a>
117 </p>
118 </div>
119
120 <div class=\"col-sm-12 col-md-3\">
121 <p class=\"licenses\">
122 <a href=\"https://creativecommons.org/licenses/by/4.0/\">
123 <img alt=\"Creative Commons License\" src=\"/public/images/cc.png\" />
124</a>
125<!--
126 <a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">
127 <img src=\"/public/images/gpl.png\">
128 </a>
129-->
130 </p>
131 </div>
132
133 <div class=\"col-sm-12 col-md-5\" id=\"meta\">
134 <p><span class=\"icon-settings\"></span> %c</p>
135 <p><span class=\"icon-calendar\"></span> %C</p>
136 </div>
137 </div>
138
139 <br>
140 <div align=\"center\">
141 <small>
142 <p>The content is distributed under license
143 <a href=\"https://creativecommons.org/licenses/by-sa/4.0/deed.en\">
144 Creative Commons «Attribution-ShareAlike» 4.0 International (CC BY-SA 4.0)
145 </a>
146 </p>
147 </small>
148 </div>"
149
150 :section-numbers nil
151 :with-sub-superscript nil
152
153 ;; sitemap - list of blog articles
154 :auto-sitemap t
155 :sitemap-filename "sitemap.org"
156 :sitemap-title "@w96k"
157 :sitemap-sort-files chronologically)))
158
159;; Don't ask for block evaluation
160(setq org-confirm-babel-evaluate nil)
161
162;; Set output folder
163(setq httpd-root (concat current-folder "/dist/"))
164
165;; Fix image width
166(setq org-image-actual-width nil)
167
168;; PDF output settings
169(setq org-latex-listings 'minted)
170(setq org-latex-tables-centered nil)
171(add-to-list 'org-latex-packages-alist '("russian" "babel"))
172(add-to-list 'org-latex-packages-alist '("" "minted"))
173(add-to-list 'org-latex-packages-alist '("" "nopageno"))
174(add-to-list 'org-latex-packages-alist '("utf8x" "inputenc"))
175(add-to-list 'org-latex-packages-alist '("a4paper, margin=0.75in" "geometry"))
176
177(setq org-src-fontify-natively t)
178
179
Note: See TracBrowser for help on using the repository browser.