mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-26 22:20:21 +00:00
feat: Add specific logic for archive_org icon
This commit is contained in:
parent
e594e6a75a
commit
8cfad64271
1 changed files with 9 additions and 1 deletions
|
@ -23,7 +23,7 @@ def get_icons(snapshot: Snapshot) -> str:
|
||||||
"mercury": "🅼",
|
"mercury": "🅼",
|
||||||
"warc": "📦"
|
"warc": "📦"
|
||||||
}
|
}
|
||||||
exclude = ["favicon"]
|
exclude = ["favicon", "archive_org"]
|
||||||
# Missing specific entry for WARC
|
# Missing specific entry for WARC
|
||||||
|
|
||||||
for extractor, _ in EXTRACTORS:
|
for extractor, _ in EXTRACTORS:
|
||||||
|
@ -40,6 +40,14 @@ def get_icons(snapshot: Snapshot) -> str:
|
||||||
output += output_template.format(exists[0], "",
|
output += output_template.format(exists[0], "",
|
||||||
True, "warc", icons.get("warc", "?"))
|
True, "warc", icons.get("warc", "?"))
|
||||||
|
|
||||||
|
if extractor == "archive_org" and exists:
|
||||||
|
# The check for archive_org is different, so it has to be handled separately
|
||||||
|
target_path = Path(path) / "archive.org.txt"
|
||||||
|
exists = target_path.exists()
|
||||||
|
if exists:
|
||||||
|
output += '<a href="{}" class="exists-{}" title="{}">{} </a>'.format(canon["archive_org_path"],
|
||||||
|
True, "archive_org", icons.get("archive_org", "?"))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue