aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLich <author@lch361.net>2026-02-21 02:53:16 +0300
committerLich <author@lch361.net>2026-02-21 02:53:16 +0300
commit832662fb12327e825d29f4d4846e12d8c1af8b8d (patch)
tree7d23f302646fc286acc7ea7469ab24c2fac71f99
parentRewrote home page (diff)
Substituted bibliography by footnotes via shortcodes
-rw-r--r--config.toml1
-rw-r--r--content/articles/dynamic-array-vs-gap-buffer/index.md42
-rw-r--r--content/projects/fcdl/index.md40
-rw-r--r--content/projects/lch361.net/index.md77
-rw-r--r--content/projects/spiral/index.md13
-rw-r--r--static/style.css23
-rw-r--r--templates/shortcodes/bibliography.html19
-rw-r--r--templates/shortcodes/cite.html4
8 files changed, 142 insertions, 77 deletions
diff --git a/config.toml b/config.toml
index 34bb314..24eb6d2 100644
--- a/config.toml
+++ b/config.toml
@@ -25,7 +25,6 @@ feed_filenames = ["rss.xml"]
highlight_code = true
highlight_theme = "css"
smart_punctuation = true
-bottom_footnotes = true
external_links_class = "external icon"
insert_anchor_links = "right"
diff --git a/content/articles/dynamic-array-vs-gap-buffer/index.md b/content/articles/dynamic-array-vs-gap-buffer/index.md
index 5a6efe4..f9ab5d1 100644
--- a/content/articles/dynamic-array-vs-gap-buffer/index.md
+++ b/content/articles/dynamic-array-vs-gap-buffer/index.md
@@ -14,6 +14,30 @@ template = "article.html"
[taxonomies]
articles = ["Data structures", "Performance", "Low-level", "Research"]
+
+[extra.bibliography.memmove]
+title = "memmove, The Open Group Technical Standard Base Specifications"
+url = "https://pubs.opengroup.org/onlinepubs/9799919799/functions/memmove.html"
+date = 2024
+volume = "3. Shell and Utilities"
+volumes = 4
+edition = "issue 8"
+accessed = 2025-06-11
+
+[extra.bibliography.optimizing-software-in-cxx]
+authors = "Agner Fog"
+organization = "Technical University of Denmark"
+title = "Optimizing software in C++"
+url = "https://www.agner.org/optimize/optimizing_cpp.pdf"
+date = 2024-03-15
+accessed = 2025-06-10
+
+[extra.bibliography.hardware-aware-coding]
+authors = "Abhinav Upadhyay"
+title = "Hardware-Aware Coding: CPU Architecture Concepts Every Developer Should Know"
+url = "https://blog.codingconfessions.com/p/hardware-aware-coding"
+date = 2025-03-21
+accessed = 2025-06-10
+++
## Problem overview
@@ -121,7 +145,7 @@ and **best**.
Theoretically thinking, every element needs to be both read from old position,
and then written to a new position. In POSIX programming, this operation is
-represented by a `memmove` function[^1].
+represented by a `memmove` function{{ cite(key="memmove") }}.
That's why the time complexity of moving <var>k</var> elements is:
{% math(block=true) %} "memmove"(k) = k * 2m {% end %}
@@ -291,7 +315,7 @@ From our theoretical analysis, we can conclude the following:
{% math() %}m > c{% end %}, because
retrieving values from memory is always slower than calculating registers on
any CPU. If the memory is cached, we could also say that
- {% math() %}m >= 4c{% end %}[^2]. But there are
+ {% math() %}m >= 4c{% end %}{{ cite(key="optimizing-software-in-cxx") }}. But there are
also vector instructions, like SIMD, which can significanty speed up the
**dynamic array**, *potentially making it a better option*.
@@ -372,7 +396,7 @@ the standard library][std.atomic.cache_line].
> memory from forcing cache invalidations on near, but non-atomic, memory.
Data structures will perform at their best if they have amount of elements
-divisible by `std.atomic.cache_line`[^3]. Otherwise, we will get not very smooth
+divisible by `std.atomic.cache_line`{{ cite(key="hardware-aware-coding") }}. Otherwise, we will get not very smooth
results and a jagged plot from benchmarking.
### Benchmark execution
@@ -557,14 +581,4 @@ choice for my library.
## References
-[^1]: [memmove, Shell and Utilities,
- The Open Group Technical Standard Base Specifications](https://pubs.opengroup.org/onlinepubs/9799919799/functions/memmove.html),
- (2024), vol. 3, 4 vols.,
- Issue 8.
- Accessed: 2025-06-11.
-[^2]: Agner Fog, Technical University of Denmark.
- [Optimizing software in C++](https://www.agner.org/optimize/optimizing_cpp.pdf)
- (2024-03-15). Accessed: 2025-06-10.
-[^3]: Abhinav Upadhyay, [Hardware-Aware Coding: CPU Architecture Concepts Every
- Developer Should Know](https://blog.codingconfessions.com/p/hardware-aware-coding)
- (2025-03-21). Accessed: 2025-06-10.
+{{ bibliography() }}
diff --git a/content/projects/fcdl/index.md b/content/projects/fcdl/index.md
index 61f97b2..f79d1c3 100644
--- a/content/projects/fcdl/index.md
+++ b/content/projects/fcdl/index.md
@@ -20,6 +20,26 @@ version = "2.0.0-x86_64"
license = "GPL-2.0"
repository = "https://codeberg.org/lch361/fcdl"
+
+[extra.bibliography.lkmpg]
+authors = "P. J. Salzman, M. Burian, O. Pomerantz, B. Mottram, J. Huang"
+title = "The Linux Kernel Module Programming Guide"
+date = 2025-06-09
+pages = 139
+url = "https://github.com/sysprog21/lkmpg/releases/download/latest/lkmpg.pdf"
+accessed = 2025-06-13
+
+[extra.bibliography.system-calls-manual]
+title = "System Calls Manual, Linux man-pages"
+edition = "ver. 6.10"
+section = 2
+
+[extra.bibliography.kprobes]
+authors = "J. Keniston, P. S Panchamukhi, M. Hiramatsu"
+title = "Kernel Probes (Kprobes), The Linux Kernel Documentation"
+edition = "ver. 6.15"
+url = "https://www.kernel.org/doc/html/v6.15/trace/kprobes.html"
+accessed = 2025-06-22
+++
> **Note:**
@@ -31,7 +51,7 @@ repository = "https://codeberg.org/lch361/fcdl"
The development began in 2023, back in the high school, when I was actively
exploring [Linux] and free software written around it. Eventually, I discovered
-the Linux Kernel Module Programming Guide[^lkmpg]. I always thought of OS
+the Linux Kernel Module Programming Guide{{ cite(key="lkmpg") }}. I always thought of OS
development as an extremely hard, but possible work, but this book was a soft
introduction into the world of kernel programming. That's when I decided to
seriously learn how to write Linux Kernel modules.
@@ -75,15 +95,15 @@ Next sections describe each entity with more details.
### Intercepting system calls
-FCDL uses following system calls[^system-calls-manual]:
+FCDL uses following system calls{{ cite(key="system-calls-manual") }}:
- **openat** --- opens a file at specific path;
- **unlinkat** --- deletes a file at specific path;
- **renameat2** --- moves file from one path to another;
For intercepting kernel functions, and thus, syscalls, Kprobes were
-used[^kprobes].
+used{{ cite(key="kprobes") }}.
-According to the **syscall(2)** man page[^system-calls-manual], for x86_64:
+According to the **syscall(2)** man page{{ cite(key="system-calls-manual") }}, for x86_64:
- System calls put their arguments into the following registers:
`rdi`, `rsi`, `rdx`, `r10`, `r8`, `r9`.
- System calls put their return code into `rax`.
@@ -265,22 +285,12 @@ repository. Thank you for reading!
## References
-[^lkmpg]:
- P. J. Salzman, M. Burian, O. Pomerantz, B. Mottram, J. Huang,
- [The Linux Kernel Module Programming Guide].
- 2025-06-09, 139 pages. Accessed: 2025-06-13.
-[^system-calls-manual]:
- System Calls Manual, Linux man--pages, ver. 6.10. Section 2.
-[^kprobes]: J. Keniston, P. S Panchamukhi, M. Hiramatsu.
- [Kernel Probes (Kprobes), The Linux Kernel
- Documentation](https://www.kernel.org/doc/html/v6.15/trace/kprobes.html),
- ver. 6.15. Accessed: 2025-06-22.
+{{ bibliography() }}
[Linux]: https://www.kernel.org
[QEMU]: https://qemu.org
[Gentoo]: https://gentoo.org
[README.md]: https://codeberg.org/lch361/fcdl/src/commit/a91f55c10bc2f90b7073176f4f392d183ae956c4/README.md
-[The Linux Kernel Module Programming Guide]: https://github.com/sysprog21/lkmpg/releases/download/latest/lkmpg.pdf
[system calls]: https://en.wikipedia.org/wiki/System_call
[character device]: https://en.wikipedia.org/wiki/Device_file#Character_devices
[circular buffer]: https://en.wikipedia.org/wiki/Circular_buffer
diff --git a/content/projects/lch361.net/index.md b/content/projects/lch361.net/index.md
index 6b29d71..c811483 100644
--- a/content/projects/lch361.net/index.md
+++ b/content/projects/lch361.net/index.md
@@ -18,6 +18,48 @@ license = "CC-BY-ND-4.0"
homepage = "https://lch361.net"
repository = "https://codeberg.org/lch361/www.lch361.net"
+
+[extra.bibliography.zola-doc]
+authors = "V. Prouillet"
+title = "Zola documentation"
+date = 2025
+edition = "ver. 0.20.0"
+url = "https://getzola.org/documentation"
+accessed = 2025-06-27
+
+[extra.bibliography.hugo-doc]
+authors = "B. E. Pedersen, S. Francia and contributors"
+title = "Hugo documentation"
+date = 2024
+url = "https://gohugo.io/documentation"
+accessed = 2024-06-14
+
+[extra.bibliography.mdn]
+organization = "Mozilla"
+title = "MDN Web Docs"
+date = 2025
+url = "https://developer.mozilla.org"
+accessed = 2025-06-27
+
+[extra.bibliography.typst-doc]
+authors = "M. Haug, L. Mädje"
+title = "Typst documentation"
+edition = "ver. 0.13.1"
+url = "https://typst.app/docs/reference"
+accessed = 2025-06-27
+
+[extra.bibliography.rfc-4648]
+organization = "The Internet Society"
+title = "The Base16, Base32, and Base64 Data Encodings"
+date = "2006-10"
+issue = "RFC 4648"
+
+[extra.bibliography.tera-doc]
+authors = "V. Prouillet"
+title = "Tera documentation"
+date = 2023
+url = "https://keats.github.io/tera/docs"
+accessed = 2025-06-28
+++
## History of development
@@ -135,7 +177,7 @@ First of all, Hugo and Zola are pretty similar:
However, there are also some crucial differences between these.
Feel free to check Hugo and Zola documentation to see the differences and choose
-your favourite flavor of SSG[^hugo doc][^zola doc]. You can also look into the
+your favourite flavor of SSG{{ cite(key="zola-doc") }}{{ cite(key="hugo-doc") }}. You can also look into the
[new][source code] and [old source code] of my website to see practical
differences in implementing the website with both SSGs.
The table below is based on the documentation of SSGs paired with my experience
@@ -245,7 +287,7 @@ next subsections are all about.
### Collecting Git information
Zola doesn't have, for example, `GitInfo` like in Hugo --- an object that has an
-information about last Git commit that modified a certain page[^hugo doc].
+information about last Git commit that modified a certain page{{ cite(key="hugo-doc") }}.
Unfortunate, because it would make implementation of Git commits for all pages
on my website straightforward.
@@ -294,7 +336,7 @@ The bad part is:
JavaScript is forbidden in my website, so I didn't want to use MathJax and
similar technologies anymore.
-Reading the web documentation, I found [MathML][^mdn]. Now this was a very
+Reading the web documentation, I found [MathML]{{ cite(key="mdn") }}. Now this was a very
promising feature of the web. MathML is also an XML--based markup language, and
in this regard, you can compare it to [SVG]: MathML to mathematical formulas is
the same as SVG to images.
@@ -324,7 +366,7 @@ The HTML markup above will be rendered in the following formula:
language.
When I was looking for alternative markup languages for math notation, my first
-choice was [Typst's math mode][^typst-doc]. At that time I was writing a lot of
+choice was [Typst's math mode]{{ cite(key="typst-doc") }}. At that time I was writing a lot of
documents in Typst, and it was my favourite technology for typography ever.
Particularly, I enjoyed how easy and intuitive it was to write formulas in
Typst, so I immediately got an idea to try to implement that part of Typst in my
@@ -369,12 +411,12 @@ evaluating Zola templates.
function.
1. Sending arbitrary content taken from Markdown pages via URL paths was deemed
- unsafe, so [URL--safe base64] is used for transferring the data[^rfc-4648].
+ unsafe, so [URL--safe base64] is used for transferring the data{{ cite(key="rfc-4648") }}.
**Solution**: Zola actually has [`base64_encode`] function that will help
- us in this task[^zola-doc]. I didn't see any notes in the documentation
+ us in this task{{ cite(key="zola-doc") }}. I didn't see any notes in the documentation
stating that it is a URL--safe base64, but in any case, we can always
- [`replace`] `+` with `-`, and `/` with `_`[^tera-doc].
+ [`replace`] `+` with `-`, and `/` with `_`{{ cite(key="tera-doc") }}.
All problems have been solved, so the server and `zola build` just need to be
launched in the following fashion:
@@ -425,24 +467,7 @@ and composable programs.
## References
-[^zola-doc]:
- V. Prouillet, [Zola documentation] (2025), ver. 0.20.0.
- Accessed: 2025-06-27.
-[^hugo-doc]:
- B. E. Pedersen, S. Francia and contributors, [Hugo documentation] (2024).
- Accessed: 2024-06-14.
-[^mdn]:
- Mozilla, [MDN Web Docs](https://developer.mozilla.org/) (2025).
- Accessed: 2025-06-27.
-[^typst-doc]:
- M. Haug, L. Mädje. Berlin, Germany. [Typst documentation], ver. 0.13.1.
- Accessed: 2025-06-27.
-[^rfc-4648]:
- The Base16, Base32, and Base64 Data Encodings, RFC 4648,
- The Internet Society, Oct. 2006.
-[^tera-doc]:
- V. Prouillet, [Tera documentation] (2023).
- Accessed: 2025-06-28.
+{{ bibliography() }}
[lch361.net]: @/_index.md
[lcalc]: @/projects/lcalc.md
@@ -453,7 +478,6 @@ and composable programs.
[Hugo]: https://gohugo.io
[Zola]: https://getzola.org
[Hugo documentation]: https://gohugo.io/documentation
-[Zola documentation]: https://getzola.org/documentation
[SSG]: https://en.wikipedia.org/wiki/Static_site_generator
[Markdown]: https://www.markdownguide.org/
[shortcodes]: https://www.getzola.org/documentation/content/shortcodes/
@@ -473,7 +497,6 @@ and composable programs.
[Pandoc]: https://pandoc.org
[`base64_encode`]: https://www.getzola.org/documentation/templates/overview/#base64-encode
[`replace`]: https://keats.github.io/tera/docs/#replace
-[Tera documentation]: https://keats.github.io/tera/docs
[URL--safe base64]: https://datatracker.ietf.org/doc/html/rfc4648#section-5
[Python wrapper]: https://codeberg.org/lch361/www.lch361.net/src/commit/ef8f37b3dc4af3f85bb8368ceecc19c6063521ca/scripts/run-zola
[Tera]: https://keats.github.io/tera/
diff --git a/content/projects/spiral/index.md b/content/projects/spiral/index.md
index e9c2fc7..3915c01 100644
--- a/content/projects/spiral/index.md
+++ b/content/projects/spiral/index.md
@@ -27,6 +27,13 @@ license = "GPL-3.0"
repository = "https://codeberg.org/lch361/spiral"
releases = "https://codeberg.org/lch361/spiral/releases"
documentation = "https://codeberg.org/lch361/spiral#documentation"
+
+[extra.bibliography.helix-doc]
+title = "Helix editor documentation"
+edition = "ver. 25.01.1"
+section = "2.6"
+url = "https://docs.helix-editor.com/keymap.html"
+accessed = 2025-06-24
+++
## History of development
@@ -63,7 +70,7 @@ So that's when I got an idea.
And so, the development of [spiral] began. I want it to:
- have full UTF-8 support for all characters;
- be portable across programs;
-- implement Helix[^helix] editor keybindings;
+- implement Helix{{ cite(key="helix-doc") }} editor keybindings;
- have a comprehensible, but at the same time composable API, so it could
suit more users.
@@ -200,9 +207,7 @@ Let's try to answer it by looking at practical applications:
## References
-[^helix]:
- [Helix editor documentation](https://docs.helix-editor.com/keymap.html),
- ver. 25.01.1, section 2.6. Accessed: 2025-06-24.
+{{ bibliography() }}
[spiral]: .
[lcalc]: @/projects/lcalc.md
diff --git a/static/style.css b/static/style.css
index 5eb4d48..44bc6bf 100644
--- a/static/style.css
+++ b/static/style.css
@@ -595,26 +595,17 @@ main.page-wide li::marker {
color: var(--color-light-main);
}
-sup.footnote-reference > a,
-sup.footnote-reference > a:visited,
-ol.footnotes-list a[href^="#fr-"] {
- color: var(--color-main);
-}
-
-sup.footnote-reference > a:hover, ol.footnotes-list a[href^="#fr-"]:hover {
- color: var(--color-light-main);
-}
-
-sup.footnote-reference > a::before {
- content: '[';
+.bibliography li::marker {
+ content: "[" counter(list-item) "] ";
}
-sup.footnote-reference > a::after {
- content: ']';
+a.citation {
+ text-decoration: none;
+ color: var(--color-main) !important;
}
-ol.footnotes-list li::marker {
- content: "[" counter(list-item) "] ";
+a.citation:hover {
+ color: var(--color-light-main) !important;
}
/* Style for footer */
diff --git a/templates/shortcodes/bibliography.html b/templates/shortcodes/bibliography.html
new file mode 100644
index 0000000..d256137
--- /dev/null
+++ b/templates/shortcodes/bibliography.html
@@ -0,0 +1,19 @@
+<ol class="bibliography">
+{%- for key, bibliography in page.extra.bibliography -%}
+ <li id="cite-{{ loop.index }}"><p>
+ {% if bibliography.authors %}{{ bibliography.authors }}. {% endif -%}
+ {% if bibliography.organization %}{{ bibliography.organization }}. {% endif -%}
+ {% if bibliography.url %}<a class="external icon" href="{{ bibliography.url }}">{% endif -%}
+ {{- bibliography.title -}}
+ {%- if bibliography.url %}</a>{% endif -%}
+ {% if bibliography.date %} ({{ bibliography.date }}){% endif -%}
+ {% if bibliography.volume %}, vol. {{ bibliography.volume }}{% endif -%}
+ {% if bibliography.volumes %}, {{ bibliography.volumes }} vols.{% endif -%}
+ {% if bibliography.edition %}, {{ bibliography.edition }}{% endif -%}
+ {% if bibliography.pages %}, {{ bibliography.pages }} pages{% endif -%}
+ {% if bibliography.section %}, section {{ bibliography.section }}{% endif -%}.
+
+ {% if bibliography.accessed %}Accessed: {{ bibliography.accessed }}.{% endif %}
+ </li></p>
+{%- endfor -%}
+</ol>
diff --git a/templates/shortcodes/cite.html b/templates/shortcodes/cite.html
new file mode 100644
index 0000000..beeaaf5
--- /dev/null
+++ b/templates/shortcodes/cite.html
@@ -0,0 +1,4 @@
+{%- for bibkey, _ in page.extra.bibliography -%}
+ {%- if bibkey != key -%}{%- continue -%}{%- endif -%}
+ <a class="citation" href="#cite-{{ loop.index }}"><sup>[{{ loop.index }}]</sup></a>
+{%- endfor -%}