source: .emacs@ 7123feb

Last change on this file since 7123feb was 7123feb, checked in by Mikhail Kirillov <w96k@…>, on Aug 28, 2022 at 11:48:21 PM

make mini.css less website

  • Property mode set to 100644
File size: 4.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 "youtube"
26 (lambda (handle)
27 (browse-url
28 (concat "https://invidiou.site/embed/"
29 handle)))
30 (lambda (path desc backend)
31 (cl-case backend
32 (html (format youtube-iframe-format
33 path (or desc "")))
34 (latex (format "\href{%s}{%s}"
35 path (or desc "video"))))))
36
37(org-add-link-type
38 "video"
39 (lambda (handle)
40 (browse-url
41 (concat "/"
42 handle)))
43 (lambda (path desc backend)
44 (cl-case backend
45 (html (format local-video-format
46 path (or desc "")))
47 (latex (format "\href{%s}{%s}"
48 path (or desc "video"))))))
49
50(setq org-publish-project-alist
51 `(("blog"
52 :components ("blog-content" "blog-styles")
53 :base-directory current-folder)
54 ("blog-styles"
55 :base-directory ,(concat current-folder "public")
56 :base-extension "jpg\\|webp\\|gif\\|svg\\|png\\|ico\\|css\\|txt\\|pdf\\|webm\\|mp4\\|mp3\\|flac\\|mov"
57 :publishing-directory ,(concat current-folder "dist/public")
58 :recursive t
59 :publishing-function org-publish-attachment
60 )
61 ("blog-content"
62 :base-directory ,(concat current-folder "content")
63 :publishing-directory ,(concat current-folder "dist")
64 :recursive t
65 :publishing-function org-html-publish-to-html
66
67 :html-doctype "html5"
68
69 :with-title nil
70 :with-author t
71 :with-creator nil
72 :with-date t
73 :with-email t
74 :with-footnotes t
75 :html-html5-fancy t
76 :html-preamble "
77<div class=\"navbar\">
78<a href=\"/\" class=\"button logo\">~w96k</a>
79<a class=\"button\" href=\"/articles.html\">Articles</a>
80<a class=\"button\" href=\"/projects.html\">Projects</a>
81<a class=\"button\" href=\"/music.html\">Music</a>
82<a class=\"button\" href=\"/emacs.html\">Emacs</a>
83<a class=\"button\" href=\"/guix.html\">Guix</a>
84</div>"
85
86 :html-head "
87<link rel=\"shortcut icon\" href=\"/public/favicon.png\">
88<link rel=\"stylesheet\" href=\"/public/css/custom.css\" type=\"text/css\"/>
89"
90
91 :html-container "article"
92 :html-postamble "
93 <div id=\"copyright\">
94 <p>Mikhail Kirillov © 2019-2022</p>
95 <p>
96 Works in <a href=\"https://anybrowser.org/campaign/\">any browser</a>
97 </p>
98 </div>
99
100 <div align=\"center\">
101 <p class=\"licenses\">
102 <a href=\"https://creativecommons.org/licenses/by/4.0/\">
103 <img alt=\"Creative Commons License\" src=\"/public/images/cc.png\" />
104 </a>
105 </p>
106 </div>
107
108 <div class=\"col-sm-12 col-md-5\" id=\"meta\">
109 <p><span class=\"icon-settings\"></span> %c</p>
110 <p><span class=\"icon-calendar\"></span> %C</p>
111 </div>"
112
113 :section-numbers nil
114 :with-sub-superscript nil
115
116 ;; sitemap - list of blog articles
117 :auto-sitemap t
118 :sitemap-filename "sitemap.org"
119 :sitemap-title "@w96k"
120 :sitemap-sort-files chronologically)))
121
122;; Don't ask for block evaluation
123(setq org-confirm-babel-evaluate nil)
124
125;; Set output folder
126(setq httpd-root (concat current-folder "/dist/"))
127
128;; Fix image width
129(setq org-image-actual-width nil)
130
131;; PDF output settings
132(setq org-latex-listings 'minted)
133(setq org-latex-tables-centered nil)
134(add-to-list 'org-latex-packages-alist '("russian" "babel"))
135(add-to-list 'org-latex-packages-alist '("" "minted"))
136(add-to-list 'org-latex-packages-alist '("" "nopageno"))
137(add-to-list 'org-latex-packages-alist '("utf8x" "inputenc"))
138(add-to-list 'org-latex-packages-alist '("a4paper, margin=0.75in" "geometry"))
139
140(setq org-src-fontify-natively t)
141
142
Note: See TracBrowser for help on using the repository browser.