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