source: .emacs@ 9742500

Last change on this file since 9742500 was 9742500, checked in by Mikhail Kirillov <w96k@…>, on Oct 10, 2020 at 3:32:27 AM

Add new post; Update visuals;

  • Property mode set to 100644
File size: 4.4 KB
Line 
1;;; Emacs configuration for building a project
2
3(require 'org)
4(require 'ox-publish)
5(require 'ox-latex)
6(require 's)
7(require 'simple-httpd)
8
9(setq current-folder (file-truename "./"))
10
11(defvar peertube-iframe-format
12 ;; You may want to change your width and height.
13 (concat "<iframe id=\"ivplayer\" type=\"text/html\""
14 "src=\"https://peervideo.ru/videos/embed/%s\""
15 " frameborder=\"0\""
16 " allowfullscreen>%s</iframe>"))
17
18(org-add-link-type
19 "peertube"
20 (lambda (handle)
21 (browse-url
22 (concat "https://peervideo.ru/videos/embed/"
23 handle)))
24 (lambda (path desc backend)
25 (cl-case backend
26 (html (format peertube-iframe-format
27 path (or desc "")))
28 (latex (format "\href{%s}{%s}"
29 path (or desc "video"))))))
30
31(setq org-publish-project-alist
32 `(("blog"
33 :components ("blog-content" "blog-styles")
34 :base-directory current-folder)
35 ("blog-styles"
36 :base-directory ,(concat current-folder "public")
37 :base-extension "jpg\\|gif\\|png\\|ico\\|css\\|txt\\|pdf"
38 :publishing-directory ,(concat current-folder "dist/public")
39 :recursive t
40 :publishing-function org-publish-attachment
41 )
42 ("blog-content"
43 :base-directory ,(concat current-folder "content")
44 :publishing-directory ,(concat current-folder "dist")
45 :recursive t
46 :publishing-function org-html-publish-to-html
47
48 :html-doctype "xhtml5"
49
50 :with-title nil
51 :with-author t
52 :with-creator nil
53 :with-date t
54 :with-email t
55 :with-footnotes t
56 :html-html5-fancy t
57 :html-preamble "
58<header class=\"navbar\">
59<a href=\"/\" class=\"logo\">@w96k</a>
60<a class=\"button\" href=\"/about.html\">Обо мне</a>
61<a class=\"button\" href=\"/cv.html\">CV</a>
62</header>"
63
64 :html-head "
65<link rel=\"shortcut icon\" href=\"/public/favicon.png\">
66<link rel=\"stylesheet\" href=\"/public/css/mini.css\" type=\"text/css\"/>
67<link rel=\"stylesheet\" href=\"/public/css/custom.css\" type=\"text/css\"/>
68"
69
70 :html-container "article"
71 :html-postamble "
72 <div class=\"row\">
73 <div class=\"col-sm-12 col-md-4\">
74 <p class=\"licenses\">
75 <a href=\"https://creativecommons.org/licenses/by/4.0/\">
76 <img alt=\"Лицензия Creative Commons\" src=\"/public/images/cc.png\" />
77</a>
78 <a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">
79 <img src=\"/public/images/gpl.png\">
80 </a>
81 </p>
82 </div>
83
84 <div id=\"copyright\" class=\"col-sm-12 col-md-4\">
85 <p>© 2019-2020 <i>Mikhail Kirillov</i></p>
86 <p>
87 Сайт работает в <a href=\"https://anybrowser.org/campaign/\">любом браузере</a>
88 </p>
89 </div>
90
91 <div class=\"col-sm-12 col-md-4\" id=\"meta\">
92 <p><span class=\"icon-settings\"></span> %c</p>
93 <p><span class=\"icon-calendar\"></span> %C</p>
94 </div>
95 </div>
96
97 <br>
98 <div align=\"center\">
99 <small>
100 <p>Содержимое доступно по лицензии
101 <a href=\"https://creativecommons.org/licenses/by-sa/4.0/deed.ru\">
102 Creative Commons «Attribution-ShareAlike» («Атрибуция — На тех же условиях») 4.0 Всемирная (CC BY-SA 4.0)
103 </a>
104 </p>
105 <p>Исходный код доступен по лицензии GNU General Public License Version 3</p>
106 <p><a href=\"/legal.html\">Подробнее о правах</a></p>
107 </small>
108 </div>"
109
110 :section-numbers nil
111 :with-sub-superscript nil
112
113 ;; sitemap - list of blog articles
114 :auto-sitemap t
115 :sitemap-filename "sitemap.org"
116 :sitemap-title "@w96k"
117 :sitemap-sort-files chronologically)))
118
119;; Don't ask for block evaluation
120(setq org-confirm-babel-evaluate nil)
121
122;; Set output folder
123(setq httpd-root (concat current-folder "/dist/"))
124
125;; Fix image width
126(setq org-image-actual-width nil)
127
128;; PDF output settings
129(setq org-latex-listings 'minted)
130(setq org-latex-tables-centered nil)
131(add-to-list 'org-latex-packages-alist '("russian" "babel"))
132(add-to-list 'org-latex-packages-alist '("" "minted"))
133(add-to-list 'org-latex-packages-alist '("" "nopageno"))
134(add-to-list 'org-latex-packages-alist '("utf8x" "inputenc"))
135(add-to-list 'org-latex-packages-alist '("a4paper, margin=0.75in" "geometry"))
136
Note: See TracBrowser for help on using the repository browser.