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 document(date: none)
|
||||||
|
set text(lang: lang)
|
||||||
|
set text(hyphenate: true)
|
||||||
|
|
||||||
// format lists
|
// format lists
|
||||||
set list(marker: ([•], [--]))
|
set list(marker: ([•], [--]))
|
||||||
|
@ -101,25 +103,38 @@
|
||||||
outline(indent: 20pt, depth: 2)
|
outline(indent: 20pt, depth: 2)
|
||||||
|
|
||||||
// format links
|
// format links
|
||||||
|
#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>])
|
let glossaryFootnote = state("x", [#footnote[anarsec.guide/glossary]<glossary-footnote>])
|
||||||
show link: it => {
|
show link: it => {
|
||||||
it.body
|
it.body
|
||||||
if type(it.dest) == "string" {
|
if type(it.dest) == "string" {
|
||||||
if it.dest == "https://anarsec.guide/recommendations" or it.dest == "/recommendations" {
|
if it.dest == ("https://anarsec.guide/" + after + "recommendations") or it.dest == (before + "/recommendations") {
|
||||||
text[ (#emph()[Appendix: 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 {
|
context {
|
||||||
let elements = query(label(it.dest.trim("/recommendations#", at: start).trim("/recommendations/#", at: start)))
|
let elements = query(label(it.dest.trim(before + "/recommendations#", at: start).trim(before + "/recommendations/#", at: start)))
|
||||||
text[ (#emph()[Appendix: Recommendations])]
|
text[ (#emph()[rec])]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if it.dest.starts-with("https://") or it.dest.starts-with("http://") {
|
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)]
|
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 {
|
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 {
|
if elements.len() != 0 {
|
||||||
text[#super[†]]
|
text[#super[†]]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue