summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-02-04 20:58:25 +0100
committerThomas Letan <lthms@soap.coffee>2020-02-04 20:58:25 +0100
commited3ce3ec850b416d449c32f000467c83cbe2fe20 (patch)
tree4e49c5f4e357d657741efae2e4f1f5875e487c88
parent9754a53fdc14f6ee4cf00f851cda68d69889bdcd (diff)
Various fixes related to absolute URLs
-rw-r--r--.gitignore3
-rw-r--r--plugins/site-prefix.lua28
-rw-r--r--site/index.html4
-rw-r--r--site/posts/lisp-journey-getting-started.org4
-rw-r--r--site/style/main.css4
-rw-r--r--soupault.conf11
-rw-r--r--templates/main.html2
7 files changed, 47 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 96db5e5..94c05db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@ build/
*.vok
*.vo
.*.aux
-*.glob \ No newline at end of file
+*.glob
+*.html~ \ No newline at end of file
diff --git a/plugins/site-prefix.lua b/plugins/site-prefix.lua
new file mode 100644
index 0000000..e64f839
--- /dev/null
+++ b/plugins/site-prefix.lua
@@ -0,0 +1,28 @@
+site_url = config["site_url"]
+
+if not site_url then
+ Log.warning("site_url is not configured, using default")
+ site_url = ""
+end
+
+if not Regex.match(site_url, "(.*)/$") then
+ site_url = site_url .. "/"
+end
+
+links = HTML.select(page, "a")
+
+index, link = next(links)
+
+while index do
+ href = HTML.get_attribute(link, "href")
+ if href then
+ -- Check if URL starts with a leading "/"
+ if Regex.match(href, "^/") then
+ -- Remove leading slashes
+ href = Regex.replace(href, "^/*", "")
+ href = site_url .. href
+ HTML.set_attribute(link, "href", href)
+ end
+ end
+ index, link = next(links, index)
+end
diff --git a/site/index.html b/site/index.html
index 442f5a5..b0e3609 100644
--- a/site/index.html
+++ b/site/index.html
@@ -6,7 +6,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.1.7/css/fork-awesome.min.css" integrity="sha256-gsmEoJAws/Kd3CjuOQzLie5Q3yshhvmo7YNtBG7aaEY=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tonsky/FiraCode@1.207/distr/fira_code.css">
<link rel="stylesheet" href="https://edwardtufte.github.io/et-book/et-book.css">
- <link rel="stylesheet" href="/style/main.css">
+ <link rel="stylesheet" href="https://soap.coffee/~lthms/style/main.css">
<title></title>
</head>
<body id="vcard">
@@ -38,7 +38,7 @@
</dd>
</dl>
<dl>
- <dt><a href="https://mastodon.social/@lthms"><i class="fa fa-mastodon" aria-hidden="true"></i> @lthms@mastodon.social</a></dt>
+ <dt><a rel="me" href="https://mastodon.social/@lthms"><i class="fa fa-mastodon" aria-hidden="true"></i> @lthms@mastodon.social</a></dt>
<dd>
My personal account on the fediverse. I mostly toot about functional
programming languages, formal methods, and my Emacs configuration.
diff --git a/site/posts/lisp-journey-getting-started.org b/site/posts/lisp-journey-getting-started.org
index b354034..3d8a6c1 100644
--- a/site/posts/lisp-journey-getting-started.org
+++ b/site/posts/lisp-journey-getting-started.org
@@ -219,7 +219,9 @@ file:
To bundle the game, we can use ~sbcl~ from our command line interface.
#+BEGIN_SRC bash
-sbcl --eval "(ql:quickload :lysk/bundle)" --eval "(lysk.bundle:deliver)" --quit
+sbcl --eval "(ql:quickload :lysk/bundle)" \
+ --eval "(lysk.bundle:deliver)" \
+ --quit
#+END_SRC
* Conclusion
diff --git a/site/style/main.css b/site/style/main.css
index 39b41c0..f997fd2 100644
--- a/site/style/main.css
+++ b/site/style/main.css
@@ -55,8 +55,8 @@ body#default .paragraph {
/* org-mode output */
.footpara {
- display: inline-block;
- margin-left: .4em;
+ display: inline;
+ margin-left: .2em;
}
/* index */
diff --git a/soupault.conf b/soupault.conf
index a4d55c0..52f9fee 100644
--- a/soupault.conf
+++ b/soupault.conf
@@ -6,7 +6,7 @@
build_dir = "build"
page_file_extensions = ["html"]
- ignore_extensions = ["draft"]
+ ignore_extensions = ["draft", "vo", "vok", "vos", "glob", "html~", "org", "aux"]
generator_mode = true
complete_page_selector = "html"
@@ -37,4 +37,11 @@
selector = "div#generate-toc"
action = "replace_element"
min_level = 2
- numbered_list = true \ No newline at end of file
+ numbered_list = true
+
+[plugins.site-prefix]
+ file = "plugins/site-prefix.lua"
+
+[widgets.set-site-prefix]
+ widget = "site-prefix"
+ site_url = "/~lthms" \ No newline at end of file
diff --git a/templates/main.html b/templates/main.html
index 1e5ae50..0a6e3f8 100644
--- a/templates/main.html
+++ b/templates/main.html
@@ -9,7 +9,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.1.7/css/fork-awesome.min.css" integrity="sha256-gsmEoJAws/Kd3CjuOQzLie5Q3yshhvmo7YNtBG7aaEY=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tonsky/FiraCode@1.207/distr/fira_code.css">
<link rel="stylesheet" href="https://edwardtufte.github.io/et-book/et-book.css">
- <link rel="stylesheet" href="/style/main.css">
+ <link rel="stylesheet" href="https://soap.coffee/~lthms/style/main.css">
</head>
<body id="default">
<!-- your page content will be inserted here,