aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--publish.el13
-rw-r--r--scripts/cssa-webring.js20
2 files changed, 24 insertions, 9 deletions
diff --git a/publish.el b/publish.el
index 1ac2613..b39047e 100644
--- a/publish.el
+++ b/publish.el
@@ -24,14 +24,6 @@
(require 'ox-html)
(require 'plz)
-(setq webring (json-parse-string (plz 'get "https://aidang.cc/webring/https://jjanzen.ca")))
-(defun create-webring-html (plist)
- (format "<div class='footer'><div class='footer-top'><span><a href='%s'>« %s</a></span><span>CSSA Web Ring</span><span><a href='%s'>%s »</a></span></div><div class='footer-bottom'>Copyright (C) jjanzen 2024</div></div>"
- (gethash "url" (gethash "left" webring))
- (gethash "name" (gethash "left" webring))
- (gethash "url" (gethash "right" webring))
- (gethash "name" (gethash "right" webring))))
-
(defun my/org-publish-org-sitemap-format (entry style project)
(cond ((not (directory-name-p entry))
(format "(%s) [[file:blog/%s][%s]]\n"
@@ -73,6 +65,9 @@
(if (equal "rss.org" (file-name-nondirectory filename))
(org-rss-publish-to-rss plist filename dir)))
+(defvar jj/html-head "\
+<link rel='stylesheet' href='/css/stylesheet.css' type='text/css'/>\
+<script src='/script/cssa-webring.js'></script>")
(defvar jj/html-preamble "\
<div class='topnav'>\
<a href='/'>Home</a>\
@@ -85,7 +80,7 @@
</div>")
(defvar jj/html-postamble "\
<footer>\
- <aside class='cssa-webring-container'>\
+ <aside id='cssa-webring-container' class='cssa-webring-container'>\
<section class='cssa-webring-description'>\
\"Official\" CSSA Webring\
</section>\
diff --git a/scripts/cssa-webring.js b/scripts/cssa-webring.js
new file mode 100644
index 0000000..0a5679d
--- /dev/null
+++ b/scripts/cssa-webring.js
@@ -0,0 +1,20 @@
+function load_webring() {
+ const webring_url = "https://aidang.cc/webring/https://jjanzen.ca";
+
+ const webring_container = document.getElementById("cssa-webring-container");
+
+ fetch(webring_url)
+ .then((response) => response.json())
+ .then((obj) => {
+ const webring_html = `
+<section class='cssa-webring-description'>
+ "Official" CSSA Webring
+</section>
+<ul class='cssa-webring-site-links'>
+ <li class='cssa-webring-prev-site'><a href='${obj.left.url}'>${obj.left.name}</a></li>
+ <li class='cssa-webring-curr-site'><a href='https://jjanzen.ca'>jjanzen</a></li>
+ <li class='cssa-webring-next-site'><a href='${obj.right.url}'>${obj.right.name}</a></li>
+</ul>`;
+ webring_container.innerHTML = webring_html;
+ });
+}