Move files and configure system for blog posts.

master
Stéphane Adjemian (Charybdis) 2022-02-21 20:19:21 +01:00
parent 784cc42673
commit 9667551095
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
10 changed files with 733 additions and 24 deletions

View File

@ -0,0 +1,661 @@
/*
** Copyright © 2018 Diego Vicente
** Copyright © 2020, 2022 Stéphane Adjemian.
*/
/* Quicksand typefaces */
@font-face {
font-display: swap;
font-family: Quicksand;
src: url(../fonts/Quicksand/Quicksand-Regular.ttf);
font-weight: normal;
}
@font-face {
font-display: swap;
font-family: Quicksand;
src: url(../fonts/Quicksand/Quicksand-Bold.ttf);
font-weight: bold;
}
/* Nunito typefaces */
@font-face {
font-display: swap;
font-family: Nunito;
src: url(../fonts/Nunito/Nunito-Regular.ttf);
font-weight: normal;
font-style: normal;
}
@font-face {
font-display: swap;
font-family: Nunito;
src: url(../fonts/Nunito/Nunito-Bold.ttf);
font-weight: bold;
font-style: normal;
}
@font-face {
font-display: swap;
font-family: Nunito;
src: url(../fonts/Nunito/Nunito-Italic.ttf);
font-weight: normal;
font-style: italic;
}
@font-face {
font-display: swap;
font-family: Nunito;
src: url(../fonts/Nunito/Nunito-BoldItalic.ttf);
font-weight: bold;
font-style: italic;
}
/* Roboto Mono typefaces */
@font-face {
font-display: swap;
font-family: Roboto Mono;
src: url(../fonts/Roboto_Mono/RobotoMono-Regular.ttf);
font-weight: normal;
font-style: normal;
}
@font-face {
font-display: swap;
font-family: Roboto Mono;
src: url(../fonts/Roboto_Mono/RobotoMono-Bold.ttf);
font-weight: bold;
font-style: normal;
}
@font-face {
font-display: swap;
font-family: Roboto Mono;
src: url(../fonts/Roboto_Mono/RobotoMono-Italic.ttf);
font-weight: normal;
font-style: italic;
}
@font-face {
font-display: swap;
font-family: Roboto Mono;
src: url(../fonts/Roboto_Mono/RobotoMono-BoldItalic.ttf);
font-weight: bold;
font-style: italic;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body p, body ul{
font-size: 1.2rem;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
mark {
background: #3f9f9f;
color: #fffff8;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 85%;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
}
.figure p {
color: #657b83;
text-align: center;
font-size: 90%;
font-style: italic;
}
svg:not(:root) {
overflow: hidden;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
button,
input,
select,
textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
button,
input {
line-height: normal;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
margin: auto;
}
html {
font-family: 'Nunito', sans-serif;
}
pre,
code {
font-family: 'Roboto Mono', sans-serif;
}
div.banner{
font-family: 'Quicksand', sans-serif;
/* font-weight: bold; */
text-align: left;
color: #657b83;
padding-bottom: 1em;
margin-bottom: .5em;
border-bottom: 1px dashed #93a1a1;
}
#name{
color: #657b83;
text-decoration: none;
font-size: 30px;
}
/* @media all and (max-width: 650px) { */
/* #name { */
/* font-size: 3em; */
/* } */
/* } */
#name:hover {
color: #3f9f9f;
}
p#subtitle{
font-size: 2em;
visible: false;
}
h1,
h2,
h3,
h4,
h5,
h6 {
padding-top: 0.6em;
font-family: 'Quicksand', sans-serif;
font-weight: normal;
}
html {
background-color: #fffff8;
color: #2f2f2f;
margin: 1em;
}
body {
font-size: 13pt;
margin: 0 auto;
max-width: 1065px;
padding: 1em;
text-align: justify;
}
code {
background-color: #fdf6e3;
font-size: 85%;
padding: 2px;
border-radius: 0.3em;
}
a {
text-decoration: none;
color: #3f8f8f;
}
a:visited {
color: #2f6f6f;
}
a:hover {
text-decoration: underline;
color: #3f9f9f;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #657b83;
}
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
pre {
background-color: #fdf6e3;
color: #657b83;
border: 1pt solid #93a1a1;
padding: 1em;
box-shadow: 2pt 2pt 4pt #93a1a1;
}
pre code {
background-color: #fdf6e3;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.7rem;
}
h3 {
font-size: 1.3rem;
}
h4 {
font-size: 1.2rem;
}
h5 {
font-size: 1.1rem;
}
h6 {
font-size: 1rem;
}
h1, h2, h3, h4, h5, h6, ul {
/* max-width: 700px; */
/* margin: 0 auto; */
-moz-hyphens: auto;
}
p {
margin-top: 0px;
margin-bottom: 0px;
-moz-hyphens: auto;
}
.figure {
max-width: 765px;
margin: 0 auto;
}
.tag {
background-color: #93a1a1;
color: #3f9f9f;
padding: 0 0.2em;
}
.org-ref-bib-h1,
.footnotes {
font-size: 1.4rem;
font-style: italic;
}
.org-center {
margin-left: auto;
margin-right: auto;
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
#footer {
width: 100%;
font-size: 1.2em;
margin-bottom: 3em;
margin-top: 15%;
}
#footer ul {
display: flex;
justify-content: center;
align-items:center;
height:2em;
margin: 0;
padding: 0;
}
#footer li {
list-style: none;
display: inline-block;
margin: 0 5px;
}
#footer a {
color: #657b83;
}
#footer a:hover {
color: #3f9f9f;
}
#license-note {
color: #657b83;
text-align: center;
font-size: 75%;
padding-top: 3em;
}
/* Fallback for other elements from solarized-css */
.todo,
.next,
.done {
color: #fdf6e3;
background-color: #dc322f;
padding: 0 0.2em;
}
.tag {
-webkit-border-radius: 0.35em;
-moz-border-radius: 0.35em;
border-radius: 0.35em;
}
.TODO {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #2aa198;
}
.NEXT {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #268bd2;
}
.ACTIVE {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #268bd2;
}
.DONE {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #859900;
}
.WAITING {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #cb4b16;
}
.HOLD {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #d33682;
}
.NOTE {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #d33682;
}
.CANCELLED {
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
background-color: #859900;
}
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }

View File

@ -1,3 +0,0 @@
#!/bin/sh
WEBSITE_ROOT_FOLDER=~/website/stephane-adjemian.fr make all

View File

@ -13,21 +13,9 @@
(use-package ox-publish
:ensure t
:init
(setq sa-blog-header-file (concat (getenv "WEBSITE_ROOT_FOLDER") "/assets/partials/header.html")
sa-blog-footer-file (concat (getenv "WEBSITE_ROOT_FOLDER") "/assets/partials/footer.html")
org-html-validation-link nil
make-backup-files nil
org-src-fontify-natively t)
(defun sa-blog-header (arg)
(with-temp-buffer
(insert-file-contents sa-blog-header-file)
(buffer-string)))
(defun sa-blog-footer (arg)
(with-temp-buffer
(insert-file-contents sa-blog-footer-file)
(buffer-string)))
(setq org-html-validation-link nil
make-backup-files nil
org-src-fontify-natively t)
(defun sa-filter-local-links (link backend info)
"Filter that converts all the /index.html links to /"
@ -39,7 +27,7 @@
'(
;; Content that should be processed.
("pages"
:base-directory "./sources"
:base-directory "./pages"
:base-extension "org"
:publishing-directory "./output"
:recursive t
@ -49,20 +37,83 @@
:html-head nil
:html-head-include-default-style nil
:html-head-include-scripts nil
:html-preamble sa-blog-header
:html-postamble sa-blog-footer
:html-preamble nil
:html-postamble nil
)
("blog"
:base-directory "./blog"
:base-extension "org"
:publishing-directory "./output/posts"
:recursive t
:publishing-function org-html-publish-to-html
:headline-levels 4
:section-numbers nil
:html-head nil
:html-head-include-default-style nil
:html-head-include-scripts nil
:html-preamble "<h1 class=\"title\">%t</h1>
<ul style=\"text-align:center; font-size:1.2rem; list-style-type:none; margin:0; padding:0;\">
{<li style=\"display: inline;\"><a href=\"../\"><span style='font-size:25px;'>&#9757;</span></a></li>,
<li style=\"display: inline;\"><a href=\"./index.org\"><span style='font-size:25px;'>&#9760;</span></a></li>}
</ul>
<br/>
<br/>
"
:html-postamble "<br/><br/><br/><hr/>
<footer>
<div class=\"copyright-container-and-source\">
<div class=\"copyright\">
<ul style=\"text-align:center; font-size:1.2rem; list-style-type:none; margin:0; padding:0;\">
%a, %d <br/>
%e <br/>
</ul>
</div>
<div class=\"generated\">
<ul style=\"text-align:center; font-size:1.2rem; list-style-type:none; margin:0; padding:0;\">
Created with %c on <a href=\"https://www.gnu.org\">GNU</a>/<a href=\"https://www.kernel.org/\">Linux</a>
</ul>
<div class=\"source\">
<ul style=\"text-align:center; font-size:1.2rem; list-style-type:none; margin:0; padding:0;\">
Org source for this post is available <a href=\"./index.org\">here</a>
</ul>
</div>
<div class=\"cc-badge\">
<ul style=\"text-align:center; margin:0; padding:0;\">
<a rel=\"license\" href=\"https://creativecommons.org/share-your-work/public-domain/cc0/\">
<img style=\"text-align:center;\", src=\"https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg\"/>
</a>
</ul>
</div>
<div class=\"gitlab-repo\">
<ul style=\"text-align:center; margin:0; padding:0;\">
<a href=\"https://git.adjemian.eu/stepan/stephane-adjemian.fr\" title=\"stephane-adjemian.fr\">
<i class=\"fab fa-gitlab fa-lg\"></i>
</a>
</ul>
</div>
</div>
</footer>
<hr/>"
)
;; For static files (untouched by emacs)
("static"
:base-directory "./sources"
("static-pages"
:base-directory "./pages"
:base-extension "asc\\|css\\|scss\\|less\\|ttf\\|woff\\|woff2\\|eot\\|yml\\|json\\|js\\|png\\|ttf\\|jpg\\|gif\\|pdf\\|svg\\|tex\\|m\\|py\\|jl"
:publishing-directory "./output"
:recursive t
:publishing-function org-publish-attachment
)
("static-blog"
:base-directory "./blog"
:base-extension "org\\|css\\|yml\\|json\\|js\\|png\\|jpg\\|gif\\|pdf\\|svg\\|tex\\|m\\|py\\|jl"
:publishing-directory "./output/posts"
:recursive t
:publishing-function org-publish-attachment
)
;; Combine the two previous components in a single one
("site" :components ("pages" "static"))))
("site" :components ("pages" "blog" "static-pages" "static-blog"))))
(add-to-list 'org-export-filter-link-functions 'sa-filter-local-links)
)