mirror of
https://0xacab.org/anarsec/anarsec.guide.git
synced 2025-07-22 14:20:47 -04:00
layout more
This commit is contained in:
parent
05a1171289
commit
4854035341
1 changed files with 23 additions and 8 deletions
|
@ -12,6 +12,8 @@
|
|||
) = {
|
||||
|
||||
set document(date: none)
|
||||
set text(lang: lang)
|
||||
set text(hyphenate: true)
|
||||
|
||||
// format lists
|
||||
set list(marker: ([•], [--]))
|
||||
|
@ -101,25 +103,38 @@
|
|||
outline(indent: 20pt, depth: 2)
|
||||
|
||||
// format links
|
||||
let glossaryFootnote = state("x", [#footnote[anarsec.guide/glossary]<glossary-footnote>])
|
||||
#if lang == "en" [
|
||||
#let before = ""
|
||||
#let after = ""
|
||||
] else [
|
||||
#let before = "/" + lang
|
||||
#let after = lang + "/"
|
||||
]
|
||||
#if lang == "en" [
|
||||
#let rec = "Appendix: Recommendations"
|
||||
]
|
||||
#if lang == "fr" [
|
||||
#let rec = "Annexe: Recommendations"
|
||||
]
|
||||
let glossaryFootnote = state("x", [#footnote[anarsec.guide/glossary]<glossary-footnote>])
|
||||
show link: it => {
|
||||
it.body
|
||||
if type(it.dest) == "string" {
|
||||
if it.dest == "https://anarsec.guide/recommendations" or it.dest == "/recommendations" {
|
||||
text[ (#emph()[Appendix: Recommendations])]
|
||||
if it.dest == ("https://anarsec.guide/" + after + "recommendations") or it.dest == (before + "/recommendations") {
|
||||
text[ (#emph()[rec])]
|
||||
}
|
||||
else if it.dest.starts-with("/recommendations#") or it.dest.starts-with("/recommendations/#") {
|
||||
else if it.dest.starts-with(before + "/recommendations#") or it.dest.starts-with(before + "/recommendations/#") {
|
||||
context {
|
||||
let elements = query(label(it.dest.trim("/recommendations#", at: start).trim("/recommendations/#", at: start)))
|
||||
text[ (#emph()[Appendix: Recommendations])]
|
||||
let elements = query(label(it.dest.trim(before + "/recommendations#", at: start).trim(before + "/recommendations/#", at: start)))
|
||||
text[ (#emph()[rec])]
|
||||
}
|
||||
}
|
||||
else if it.dest.starts-with("https://") or it.dest.starts-with("http://") {
|
||||
footnote[#it.dest.trim("https://", at: start).trim("http://", at: start).trim("www.", at: start)]
|
||||
}
|
||||
else if it.dest.starts-with("/glossary#") or it.dest.starts-with("/glossary/#") {
|
||||
else if it.dest.starts-with(before + "/glossary#") or it.dest.starts-with(before + "/glossary/#") {
|
||||
context {
|
||||
let elements = query(heading.where(label: label(it.dest.trim("/glossary#", at: start).trim("/glossary/#", at: start))))
|
||||
let elements = query(heading.where(label: label(it.dest.trim(before + "/glossary#", at: start).trim(before + "/glossary/#", at: start))))
|
||||
if elements.len() != 0 {
|
||||
text[#super[†]]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue