From c9993bddeb1ba3f252756f4ab9d072203a284bba Mon Sep 17 00:00:00 2001 From: dongdigua Date: Sat, 11 Feb 2023 13:50:46 +0800 Subject: [PATCH] change internal link to relative try highlight rm remote Source Serif --- .github/workflows/site.yml | 1 + css/main.css | 13 ---- org/fix_tty.org | 2 +- org/publish_config.el | 31 ++++---- org/whatif_openbsd.org | 4 +- patches/bbs_gbk_utf8-highlight-adwaita.patch | 79 ++++++++++++++++++++ 6 files changed, 100 insertions(+), 30 deletions(-) create mode 100644 patches/bbs_gbk_utf8-highlight-adwaita.patch diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index 4fad3af..62adb13 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -52,6 +52,7 @@ jobs: cd _site && tree sudo ./patches/icons.sh sudo ./patches/color.sh + sudo patch -p1 < ./patches/bbs_gbk_utf8-highlight-adwaita.patch - name: Upload artifact uses: actions/upload-pages-artifact@v1 diff --git a/css/main.css b/css/main.css index 8e1f8db..be4c7d3 100644 --- a/css/main.css +++ b/css/main.css @@ -9,19 +9,6 @@ https://github.com/rgb-24bit/org-html-theme-list org-joshua font-style: normal; } -@font-face{ /* FROM https://tlakh.xyz */ - font-family: Source Serif; - font-display: auto; - src: url(https://cdn.jsdelivr.net/npm/@fontsource/source-serif-4@4.5.16/files/source-serif-4-all-400-normal.woff) format('woff'); - font-style: normal; -} -@font-face{ - font-family: Source Serif; - font-display: auto; - src: url(https://cdn.jsdelivr.net/npm/@fontsource/source-serif-4@4.5.16/files/source-serif-4-all-400-italic.woff) format('woff'); - font-style: italic; -} - @media all { body { diff --git a/org/fix_tty.org b/org/fix_tty.org index eacbac9..7da1f97 100644 --- a/org/fix_tty.org +++ b/org/fix_tty.org @@ -4,7 +4,7 @@ * What Happened After switching to f37, something changed: -- [[https://dongdigua.github.io/wayland#dm][sddm]] don't work +- [[./wayland.org::#dm][sddm]] don't work - sway don't have environment variables - v2rayA don't start automatically diff --git a/org/publish_config.el b/org/publish_config.el index d500bf4..fe4b79c 100644 --- a/org/publish_config.el +++ b/org/publish_config.el @@ -17,20 +17,6 @@ (require 'ox) (require 'webfeeder)) -;; https://emacs.stackexchange.com/questions/36366/disable-auto-id-generation-in-org-mode-html-export -;; BUG: will cause toc not working, but I don't use much, so just add id manually -(defun html-body-id-filter (output backend info) - "Remove random ID attributes generated by Org." - (when (eq backend 'html) - (replace-regexp-in-string - " href=\"#org[[:alnum:]]\\{7\\}\"" - "" - (replace-regexp-in-string - " id=\"[[:alpha:]-]*org[[:alnum:]]\\{7\\}\"" - "" - output t) - t))) -(add-to-list 'org-export-filter-final-output-functions 'html-body-id-filter) (setq org-html-validation-link nil org-export-with-toc 1 @@ -63,6 +49,7 @@ :html-postamble t ))) + ;; from .emacs (defun my/orgurl (proto) (defvar proto proto) ;; important @@ -74,6 +61,22 @@ (my/orgurl "gopher") (my/orgurl "gemini") +;; https://emacs.stackexchange.com/questions/36366/disable-auto-id-generation-in-org-mode-html-export +;; BUG: will cause toc not working, but I don't use much, so just add id manually +(defun html-body-id-filter (output backend info) + "Remove random ID attributes generated by Org." + (when (eq backend 'html) + (replace-regexp-in-string + " href=\"#org[[:alnum:]]\\{7\\}\"" + "" + (replace-regexp-in-string + " id=\"[[:alpha:]-]*org[[:alnum:]]\\{7\\}\"" + "" + output t) + t))) +(add-to-list 'org-export-filter-final-output-functions 'html-body-id-filter) + + (defun myweb-publish () "Publish myweb." (interactive) diff --git a/org/whatif_openbsd.org b/org/whatif_openbsd.org index d95b850..866f36e 100644 --- a/org/whatif_openbsd.org +++ b/org/whatif_openbsd.org @@ -231,7 +231,7 @@ kern.utc_offset=480 * Daily? 弄了那么多, 现在可以算是日常使用了 -** [[https://dongdigua.github.io/mailinglist][mail]] +** [[./mailinglist.org][mail]] ** 性能调优 :PROPERTIES: @@ -283,7 +283,7 @@ iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x20, msix 我有时候会想访问 Linux 上的文件, 但是似乎不支持 btrfs... -** [[https://dongdigua.github.io/bbs_gbk_utf8][支线任务: 中文 BBS GBK 转 UTF8]] +** [[./bbs_gbk_utf8.org][支线任务: 中文 BBS GBK 转 UTF8]] * Footnotes diff --git a/patches/bbs_gbk_utf8-highlight-adwaita.patch b/patches/bbs_gbk_utf8-highlight-adwaita.patch new file mode 100644 index 0000000..c1fb42e --- /dev/null +++ b/patches/bbs_gbk_utf8-highlight-adwaita.patch @@ -0,0 +1,79 @@ +--- ../bbs_gbk_utf8.html 2023-02-11 13:09:55.659432422 +0800 ++++ bbs_gbk_utf8.html 2023-02-11 13:29:23.784185878 +0800 +@@ -236,49 +236,49 @@ +
+-
#include <stdio.h>
+-#include <iconv.h>
++
#include <stdio.h>
++#include <iconv.h>
+ 
+-#define UTF8_SIZE 4
++#define UTF8_SIZE 4
+ 
+-int
+-convert_one(iconv_t cd)
++int
++convert_one(iconv_t cd)
+ {
+-    char inbuf[2] = {0};
+-    char outbuf[UTF8_SIZE] = {0};
+-    size_t insize = 1;
+-    size_t outsize = UTF8_SIZE;
+-
+-    char c = getchar();
+-    if (c == EOF)
+-        return 1;
++    char inbuf[2] = {0};
++    char outbuf[UTF8_SIZE] = {0};
++    size_t insize = 1;
++    size_t outsize = UTF8_SIZE;
++
++    char c = getchar();
++    if (c == EOF)
++        return 1;
+     inbuf[0] = c;
+ 
+-    char * pIn = inbuf;
+-    char * pOut = (char*) outbuf;
++    char * pIn = inbuf;
++    char * pOut = (char*) outbuf;
+ 
+-    size_t iconv_result = iconv(cd, &pIn, &insize, &pOut, &outsize);
+-    if (iconv_result == (size_t) -1) {
++    size_t iconv_result = iconv(cd, &pIn, &insize, &pOut, &outsize);
++    if (iconv_result == (size_t) -1) {
+         inbuf[1] = getchar();
+         insize = 2;
+         iconv(cd, &pIn, &insize, &pOut, &outsize);
+     }
+ 
+-    for (int i = 0; i < UTF8_SIZE; i++) {
+-        if (outbuf[i] != 0)
++    for (int i = 0; i < UTF8_SIZE; i++) {
++        if (outbuf[i] != 0)
+             putchar(outbuf[i]);
+         fflush(stdout);
+     }
+-    return 0;
++    return 0;
+ }
+ 
+-int
+-main(void)
++int
++main(void)
+ {
+-    iconv_t cd = iconv_open("UTF8", "GBK");
+-    while (1)
+-        if (convert_one(cd) == 1) break;
++    iconv_t cd = iconv_open("UTF8", "GBK");
++    while (1)
++        if (convert_one(cd) == 1) break;
+ 
+     iconv_close(cd);
+-    return 0;
++    return 0;
+ }
+ 
+
+\ No newline at end of file