Add org-publish configuration for publishing my config

The config is live since a few minutes at https://config.mmk2410.org.
A related blog post is coming tomorrow!
This commit is contained in:
Marcel Kapfer 2022-01-29 22:35:44 +01:00
parent 8bae7c5cce
commit e5013af499
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09
21 changed files with 4952 additions and 0 deletions

1
publish/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.packages/

4157
publish/assets/code.css Normal file

File diff suppressed because it is too large Load diff

BIN
publish/assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

80
publish/assets/fonts.css Normal file
View file

@ -0,0 +1,80 @@
/**************
* Raleway
**************/
/* raleway-regular - latin */
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: 400;
src: local('Raleway'), local('Raleway-Regular'),
url('fonts/raleway-v14-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/raleway-v14-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* raleway-italic - latin */
@font-face {
font-family: 'Raleway';
font-style: italic;
font-weight: 400;
src: local('Raleway Italic'), local('Raleway-Italic'),
url('fonts/raleway-v14-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/raleway-v14-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* raleway-700 - latin */
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: 700;
src: local('Raleway Bold'), local('Raleway-Bold'),
url('fonts/raleway-v14-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/raleway-v14-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* raleway-700italic - latin */
@font-face {
font-family: 'Raleway';
font-style: italic;
font-weight: 700;
src: local('Raleway Bold Italic'), local('Raleway-BoldItalic'),
url('fonts/raleway-v14-latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/raleway-v14-latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/**************
* JetBrains Mono
**************/
/* JetBrains Mono Regular */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 400;
src: local('JetBrains Mono'),
url('fonts/JetBrainsMono-Regular.woff2') format('woff2');
}
/* JetBrains Mono Regular Italic */
@font-face {
font-family: 'JetBrains Mono';
font-style: italic;
font-weight: 400;
src: local('JetBrains Mono Italic'),
url('fonts/JetBrainsMono-RegularItalic.woff2') format('woff2');
}
/* JetBrains Mono Bold */
@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
font-weight: 700;
src: local('JetBrains Mono Bold'),
url('fonts/JetBrainsMono-Bold.woff2') format('woff2');
}
/* JetBrains Mono Bold Italic italic */
@font-face {
font-family: 'JetBrains Mono';
font-style: italic;
font-weight: 700;
src: local('JetBrains Mono Bold Italic'),
url('fonts/JetBrainsMono-BoldItalic.woff2') format('woff2');
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

284
publish/assets/layout.css Normal file
View file

@ -0,0 +1,284 @@
@charset "UTF-8";
/* nextDESIGN v9
*
* nextDESIGN is a personal web design for mmk2410.org.
* The current version (v9) is focused in simplicity and minimalism.
*
* 2020-2021 © Marcel Kapfer <opensource@mmk2410.org>
* Licensed under the MIT License
*/
html {
font-size: 18px;
}
body {
background-color: #fafafa;
color: #333;
font-family: "Raleway", sans-serif;
line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #333;
color: #fafafa;
}
}
body > #preamble {
align-items: center;
color: #f4f4f4;
display: flex;
background-color: #4d3c9b;
justify-content: space-between;
padding: 20px 40px;
}
body > #preamble #title {
font-size: 24px;
font-weight: 700;
}
body > #preamble a {
color: #f4f4f4;
text-decoration: none;
}
body > #preamble a:hover {
text-decoration: underline;
}
body > #preamble nav {
display: inline;
}
body > #preamble nav ul {
margin: 0;
padding: 0;
float: right;
}
body > #preamble nav ul li {
display: inline;
padding-right: 10px;
}
body > #preamble nav ul li:last-child {
padding-right: 0;
}
body > #preamble .show-menu {
display: none;
margin-top: 10px;
padding: 10px;
text-align: center;
width: 100%;
}
body > #preamble input[type=checkbox] {
display: none;
}
@media screen and (max-width: 1000px) {
body > #preamble {
border-radius: initial;
flex-direction: column;
}
body > #preamble nav {
display: none;
text-align: center;
width: 100%;
}
body > #preamble nav ul {
float: unset;
}
body > #preamble nav ul li {
display: block;
padding: 0;
}
body > #preamble nav ul li a {
display: block;
padding: 10px 0;
}
body > #preamble .show-menu {
display: block;
}
body > #preamble input[type=checkbox]:checked ~ nav {
display: block;
}
}
#content {
background-color: #fff;
border: solid 2px #4d3c9b;
box-shadow: 1px 1px 5px #888;
margin: 100px auto;
max-width: 800px;
padding: 40px;
}
@media (prefers-color-scheme: dark) {
#content {
background-color: #222;
box-shadow: none;
}
}
#content article {
margin: 40px 0;
}
#content h1, #content h2, #content h3 {
font-size: 3rem;
margin: 20px 0 0;
padding: 0;
text-decoration: underline;
text-decoration-color: #4d3c9b;
text-decoration-thickness: 4px;
}
@media (prefers-color-scheme: dark) {
#content h1, #content h2, #content h3 {
text-decoration-color: #755bf0;
}
}
#content h2 {
font-size: 2rem;
margin: 40px 0 0;
text-decoration-thickness: 3px;
}
#content h2 a {
color: #333;
text-decoration-color: #4d3c9b;
}
@media (prefers-color-scheme: dark) {
#content h2 a {
color: #fafafa;
text-decoration-color: #755bf0;
}
}
#content h2 a:hover {
text-decoration: none;
}
#content h3 {
font-size: 1.3rem;
margin: 40px 0 0;
text-decoration-thickness: 3px;
}
#content h3 a {
color: #333;
text-decoration-color: #4d3c9b;
}
@media (prefers-color-scheme: dark) {
#content h3 a {
color: #fafafa;
text-decoration-color: #755bf0;
}
}
#content h3 a:hover {
text-decoration: none;
}
#content h4 {
font-size: 1.1rem;
}
#content figure {
margin: 0;
}
#content figure img {
width: 100%;
}
#content p {
text-align: justify;
}
#content a {
color: #4d3c9b;
text-decoration: none;
/* BEGIN: From https://css-tricks.com/better-line-breaks-for-long-urls/ */
/* These are technically the same, but use both */
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
/* Adds a hyphen where the word breaks, if supported (No Blink) */
hyphens: auto;
/* END: From https://css-tricks.com/better-line-breaks-for-long-urls/ */
}
@media (prefers-color-scheme: dark) {
#content a {
color: #755bf0;
}
}
#content a:hover {
text-decoration: underline;
}
#content dt {
font-weight: 700;
}
code, pre {
font-family: "JetBrains Mono", monospace;
}
#content .btn {
color: #f4f4f4;
background: #4d3c9b;
padding: 8px 16px;
border-radius: 20px;
line-height: 3;
white-space: nowrap;
}
#content .org-src-container > pre {
border-radius: 2px;
overflow-y: auto;
padding: 20px;
}
#content .pagination {
text-align: center;
}
#content .page-item {
display: inline;
padding-right: 10px;
}
#content .page-item:last-child {
padding-right: 0;
}
#content .comment {
margin-top: 60px;
text-align: center;
}
#content .comment a {
font-size: 1.1rem;
}
#content .comment p {
font-size: 0.95rem;
text-align: center;
}
#content #tags > a, #content #categories > a {
font-size: 0.9rem;
color: #fff;
padding: 4px 8px;
border-radius: 20px;
white-space: nowrap;
}
#content #tags > a {
background: #8171c8;
}
@media (prefers-color-scheme: dark) {
#content #tags > a {
background: #4d3c9b;
}
}
#content #categories > a {
background: #4d3c9b;
}
@media (prefers-color-scheme: dark) {
#content #categories > a {
background: #755bf0;
}
}
@media screen and (max-width: 1000px) {
#content {
border: none;
box-shadow: none;
margin: 0 auto;
}
}
#postamble {
background-color: #4d3c9b;
color: #f4f4f4;
padding: 40px;
text-align: center;
}
#postamble a {
color: #f4f4f4;
text-decoration: none;
}
#postamble a:hover {
text-decoration: underline;
}

349
publish/assets/normalize.css vendored Normal file
View file

@ -0,0 +1,349 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

65
publish/publish.el Normal file
View file

@ -0,0 +1,65 @@
(setq mmk2410/dot-emacs-publish-publishing-dir "/tmp/dot-emacs-publish/")
(setq mmk2410/dot-emacs-publish-html-head-extra
(concat "<link rel=\"stylesheet\" href=\"normalize.css\">\n"
"<link rel=\"stylesheet\" href=\"layout.css\">\n"
"<link rel=\"stylesheet\" href=\"code.css\">\n"
"<link rel=\"stylesheet\" href=\"font.css\">"
"<script defer data-domain=\"config.mmk2410.org\" src=\"https://stats.mmk2410.org/js/plausible.js\"></script>"))
(setq mmk2410/dot-emacs-publish-html-preamble
(concat "<a id=\"title\" href=\"https://mmk2410.org\">"
"Marcel Kapfer"
"</a>"))
(when (file-directory-p mmk2410/dot-emacs-publish-publishing-dir)
(delete-directory mmk2410/dot-emacs-publish-publishing-dir t))
(mkdir mmk2410/dot-emacs-publish-publishing-dir)
(setq-default load-prefer-newer t)
(setq package-user-dir (expand-file-name "./.packages"))
(package-initialize)
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
(package-refresh-contents)
(package-install 'htmlize)
(add-to-list 'load-path "~/.emacs.d/elpa")
(require 'org)
(require 'ox-publish)
(require 'htmlize)
(setq org-html-htmlize-output-type 'css)
(setq org-publish-project-alist
`(("dot-emacs:org"
:base-directory "~/.emacs.d"
:publishing-directory ,mmk2410/dot-emacs-publish-publishing-dir
:exclude ".*"
:include ("config.org")
:publishing-function org-html-publish-to-html
:section-numbers nil
:html-doctype "html5"
:html-head-include-default-style nil
:html-head-include-scripts nil
:html-head-extra ,mmk2410/dot-emacs-publish-html-head-extra
:html-html5-fancy t
:html-preamble ,mmk2410/dot-emacs-publish-html-preamble
:html-self-link-headlines t
:html-validation-link nil
)
("dot-emacs:static"
:base-directory "~/.emacs.d/publish/assets"
:publishing-directory ,mmk2410/dot-emacs-publish-publishing-dir
:base-extension "css\\|woff\\|woff2\\|ico"
:publishing-function org-publish-attachment
:recursive t)))
(defun mmk2410/dot-emacs-publish-additional ()
(rename-file
(concat mmk2410/dot-emacs-publish-publishing-dir "config.html")
(concat mmk2410/dot-emacs-publish-publishing-dir "index.html")))
(defun mmk2410/dot-emacs-publish ()
(interactive)
(org-publish-all t)
(mmk2410/dot-emacs-publish-additional))

4
publish/publish.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# emacs -Q --script ./publish.el
emacs -q --batch -l ./publish.el --funcall mmk2410/dot-emacs-publish

12
publish/upload.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
# Deploy using rsync
rsync \
--archive \
--verbose \
--compress \
--chown=marcel:www-data \
--delete \
--progress \
/tmp/dot-emacs-publish/ \
tolkien:/var/www/config.mmk2410.org/