diff --git a/content/Biokemi/Plasmidlabb/Rekombinant DNA-teknik Anteckningar.md b/content/Biokemi/Plasmidlabb/Anteckningar I.md
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Rekombinant DNA-teknik Anteckningar.md
rename to content/Biokemi/Plasmidlabb/Anteckningar I.md
diff --git a/content/Biokemi/Plasmidlabb/Rekombinant del II.md b/content/Biokemi/Plasmidlabb/Anteckningar II.md
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Rekombinant del II.md
rename to content/Biokemi/Plasmidlabb/Anteckningar II.md
diff --git a/content/Biokemi/Plasmidlabb/1-s2.0-0378111982900154-main.pdf b/content/Biokemi/Plasmidlabb/Articles/Article pUC plasmids.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/1-s2.0-0378111982900154-main.pdf
rename to content/Biokemi/Plasmidlabb/Articles/Article pUC plasmids.pdf
diff --git a/content/Biokemi/Plasmidlabb/Frontiers in bioprocessing _ Conference _ Papers -- Subhas K Sikdar; Milan Bier; Paul Todd; United States; -- Boca Raton, Fla, Florida, 1990 -- Boca -- 9780849358395 -- 2ff258ed45a8b32746ad7f174203e086 -- Anna’s Archive (2).pdf b/content/Biokemi/Plasmidlabb/Articles/Frontiers in bioprocessing _ Conference _ Papers -- Subhas K Sikdar; Milan Bier; Paul Todd; United States; -- Boca Raton, Fla, Florida, 1990 -- Boca -- 9780849358395 -- 2ff258ed45a8b32746ad7f174203e086 -- Anna’s Archive (2).pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Frontiers in bioprocessing _ Conference _ Papers -- Subhas K Sikdar; Milan Bier; Paul Todd; United States; -- Boca Raton, Fla, Florida, 1990 -- Boca -- 9780849358395 -- 2ff258ed45a8b32746ad7f174203e086 -- Anna’s Archive (2).pdf
rename to content/Biokemi/Plasmidlabb/Articles/Frontiers in bioprocessing _ Conference _ Papers -- Subhas K Sikdar; Milan Bier; Paul Todd; United States; -- Boca Raton, Fla, Florida, 1990 -- Boca -- 9780849358395 -- 2ff258ed45a8b32746ad7f174203e086 -- Anna’s Archive (2).pdf
diff --git a/content/Biokemi/Plasmidlabb/Molecular Cloning_ A Laboratory Manual 1-3 -- Joseph Sambrook, David W_ Russell -- 1-3, 3rd, 2001 -- Cold Spring Harbor Laboratory Press -- 9780879693091 -- 8e587a7655cc59b61671a6e24583457e -- Anna’s Archive.pdf b/content/Biokemi/Plasmidlabb/Articles/Molecular Cloning.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Molecular Cloning_ A Laboratory Manual 1-3 -- Joseph Sambrook, David W_ Russell -- 1-3, 3rd, 2001 -- Cold Spring Harbor Laboratory Press -- 9780879693091 -- 8e587a7655cc59b61671a6e24583457e -- Anna’s Archive.pdf
rename to content/Biokemi/Plasmidlabb/Articles/Molecular Cloning.pdf
diff --git a/content/Biokemi/Plasmidlabb/Report guidelines 2025.pdf b/content/Biokemi/Plasmidlabb/Articles/Report guidelines 2025.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Report guidelines 2025.pdf
rename to content/Biokemi/Plasmidlabb/Articles/Report guidelines 2025.pdf
diff --git a/content/Biokemi/Plasmidlabb/International Journal of Genomics - 2016 - Khan - Role of Recombinant DNA Technology to Improve Life.pdf b/content/Biokemi/Plasmidlabb/Articles/Role of Recombinant DNA.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/International Journal of Genomics - 2016 - Khan - Role of Recombinant DNA Technology to Improve Life.pdf
rename to content/Biokemi/Plasmidlabb/Articles/Role of Recombinant DNA.pdf
diff --git a/content/Biokemi/Plasmidlabb/21711.pdf b/content/Biokemi/Plasmidlabb/Articles/Screening of Bac. recombinants.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/21711.pdf
rename to content/Biokemi/Plasmidlabb/Articles/Screening of Bac. recombinants.pdf
diff --git a/content/Biokemi/Plasmidlabb/jackson-et-al-1972-biochemical-method-for-inserting-new-genetic-information-into-dna-of-simian-virus-40-circular-sv40.pdf b/content/Biokemi/Plasmidlabb/Articles/jackson-et-al-1972-biochemical-method-for-inserting-new-genetic-information-into-dna-of-simian-virus-40-circular-sv40.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/jackson-et-al-1972-biochemical-method-for-inserting-new-genetic-information-into-dna-of-simian-virus-40-circular-sv40.pdf
rename to content/Biokemi/Plasmidlabb/Articles/jackson-et-al-1972-biochemical-method-for-inserting-new-genetic-information-into-dna-of-simian-virus-40-circular-sv40.pdf
diff --git a/content/Biokemi/Plasmidlabb/IMG_0843.JPG b/content/Biokemi/Plasmidlabb/Bilder/IMG_0843.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_0843.JPG
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_0843.jpg
diff --git a/content/Biokemi/Plasmidlabb/IMG_0844.JPG b/content/Biokemi/Plasmidlabb/Bilder/IMG_0844.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_0844.JPG
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_0844.jpg
diff --git a/content/Biokemi/Plasmidlabb/IMG_0845.JPG b/content/Biokemi/Plasmidlabb/Bilder/IMG_0845.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_0845.JPG
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_0845.jpg
diff --git a/content/Biokemi/Plasmidlabb/IMG_0846.JPG b/content/Biokemi/Plasmidlabb/Bilder/IMG_0846.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_0846.JPG
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_0846.jpg
diff --git a/content/Biokemi/Plasmidlabb/IMG_0847.JPG b/content/Biokemi/Plasmidlabb/Bilder/IMG_0847.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_0847.JPG
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_0847.jpg
diff --git a/content/Biokemi/Plasmidlabb/IMG_0848.JPG b/content/Biokemi/Plasmidlabb/Bilder/IMG_0848.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_0848.JPG
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_0848.jpg
diff --git a/content/Biokemi/Plasmidlabb/IMG_1974.jpg b/content/Biokemi/Plasmidlabb/Bilder/IMG_1974.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_1974.jpg
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_1974.jpg
diff --git a/content/Biokemi/Plasmidlabb/IMG_1976.jpg b/content/Biokemi/Plasmidlabb/Bilder/IMG_1976.jpg
similarity index 100%
rename from content/Biokemi/Plasmidlabb/IMG_1976.jpg
rename to content/Biokemi/Plasmidlabb/Bilder/IMG_1976.jpg
diff --git a/content/Biokemi/Plasmidlabb/Plasmid DNA Lab Protocol November 2025.pdf b/content/Biokemi/Plasmidlabb/Protokoll.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Plasmid DNA Lab Protocol November 2025.pdf
rename to content/Biokemi/Plasmidlabb/Protokoll.pdf
diff --git a/content/Biokemi/Plasmidlabb/Rapport.md b/content/Biokemi/Plasmidlabb/Rapport.md
index 73a9092..5cdf265 100644
--- a/content/Biokemi/Plasmidlabb/Rapport.md
+++ b/content/Biokemi/Plasmidlabb/Rapport.md
@@ -35,12 +35,4 @@ PNAS 1972.
PMCID: PMC389671
PMID: 4342968
-→ Nobelpriset 1980 till Paul Berg
-
-
-
-
-
-
-
-𝛼-sl
\ No newline at end of file
+→ Nobelpriset 1980 till Paul Berg
\ No newline at end of file
diff --git a/content/Biokemi/Plasmidlabb/Plasmid Lab Part 1 November 2025.pdf b/content/Biokemi/Plasmidlabb/Slides I.pdf.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Plasmid Lab Part 1 November 2025.pdf
rename to content/Biokemi/Plasmidlabb/Slides I.pdf.pdf
diff --git a/content/Biokemi/Plasmidlabb/Plasmid Lab Part 2 OCR.md b/content/Biokemi/Plasmidlabb/Slides II.md
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Plasmid Lab Part 2 OCR.md
rename to content/Biokemi/Plasmidlabb/Slides II.md
diff --git a/content/Biokemi/Plasmidlabb/Plasmid Lab Part 2 November 25.pdf b/content/Biokemi/Plasmidlabb/Slides II.pdf.pdf
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Plasmid Lab Part 2 November 25.pdf
rename to content/Biokemi/Plasmidlabb/Slides II.pdf.pdf
diff --git a/content/Biokemi/Plasmidlabb/Plasmid Lab Part 1 OCR.md b/content/Biokemi/Plasmidlabb/Slides.md
similarity index 100%
rename from content/Biokemi/Plasmidlabb/Plasmid Lab Part 1 OCR.md
rename to content/Biokemi/Plasmidlabb/Slides.md
diff --git a/wip/static.py b/wip/static.py
index d1a3f5a..2919048 100644
--- a/wip/static.py
+++ b/wip/static.py
@@ -68,8 +68,6 @@ def markdown_filter(text):
return md.convert(text)
env.filters["markdown"] = markdown_filter
-
-template = env.get_template("base.html")
output_dir = root_dir / "output"
@@ -96,62 +94,75 @@ def build_tree(vault: Vault):
if note:
item["title"] = note.title
# TODO: for search add tags, modified time, content etc
-
cur[filename] = item
return tree
-def write_note(item, tree_json):
+def write_note(item):
if "children" in item:
for child in item["children"].values():
- write_note(child, tree_json)
+ write_note(child)
else:
path = pathlib.Path(item["folder"]) / item["filename"]
- note = vault.get_note(path)
- if note:
- out_path = output_dir / item["folder"] / (item["title"] + ".html")
- out_path.parent.mkdir(parents=True, exist_ok=True)
+ context = {
+ "filename": item["filename"],
+ "folder": item["folder"],
+ "path": path,
+ }
- # Calculate relative base_path based on folder depth
- folder = item["folder"]
- if folder == ".":
- base_path = ""
- else:
- depth = len(pathlib.Path(folder).parts)
- base_path = "../" * depth
-
- with out_path.open("w", encoding="utf-8") as f:
- data = template.render(note=note, vault=vault, base_path=base_path, index_json=tree_json)
- f.write(data)
+ folder = output_dir / item["folder"]
+ folder.mkdir(parents=True, exist_ok=True)
+ link = False
+ if note := vault.get_note(path):
+ template_name = "note.jinja2"
+ context["note"] = note
+ context["title"] = note.title
+ elif item["filename"].endswith(".pdf"):
+ template_name = "pdf.jinja2"
+ context["title"] = item["filename"]
+ link = True
+ elif item["filename"].lower().endswith((".png", ".jpg", ".jpeg", ".gif", ".webp")):
+ template_name = "image.jinja2"
+ context["title"] = item["filename"]
+ link = True
else:
print(f"Note not found for {path}")
+ return
+
+ if link:
+ os.link(
+ vault.path / item["folder"] / item["filename"],
+ output_dir / item["folder"] / item["filename"],
+ )
+
+ out_path = folder / (context["title"] + ".html")
+ with out_path.open("w", encoding="utf-8") as f:
+ template = env.get_template(template_name)
+ data = template.render(**context)
+ f.write(data)
def build():
"""Build the static site."""
print("Building...")
- # 1. Create output dir
shutil.rmtree(output_dir, ignore_errors=True)
output_dir.mkdir(exist_ok=True)
- # 1b. Symlink CSS/JS to output root
(output_dir / "style.css").symlink_to(root_dir / "style.css")
(output_dir / "script.js").symlink_to(root_dir / "script.js")
- # 1c. Symlink attachments directory
attachments_src = root_dir.parent / "content" / "attachments"
attachments_dst = output_dir / "attachments"
attachments_dst.symlink_to(attachments_src)
- # 2. Build tree and write index json
tree = build_tree(vault)
tree_json = json.dumps(tree)
with (output_dir / "index.json").open("w") as f:
f.write(tree_json)
# 3. Write out each note as html
- write_note({"children": tree}, tree_json)
+ write_note({"children": tree})
print(f"Built to {output_dir}")
diff --git a/wip/templates/base.jinja2 b/wip/templates/base.jinja2
index a456831..15964d7 100644
--- a/wip/templates/base.jinja2
+++ b/wip/templates/base.jinja2
@@ -3,7 +3,7 @@