From 942b9feefac36ec2006ae44bb904c32634561457 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Sat, 25 Apr 2026 11:21:40 +0200 Subject: [PATCH] feat(files-block): icons for tsv/json/xml/py/js/ts/rs/sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iconForExt now matches the backend's expanded ALLOWED_EXTENSIONS: - tsv routes to the excel-box icon (alongside csv). - json → mdi:code-json, xml/html → mdi:xml. - py → mdi:language-python; js/ts/jsx/tsx → language-javascript; rs → language-rust; sh/bash → console. Visitors who download a CMS-hosted dataset, source dump or archive now see a meaningful icon instead of the generic file-outline fallback. --- src/lib/components/blocks/FilesBlock.svelte | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/lib/components/blocks/FilesBlock.svelte b/src/lib/components/blocks/FilesBlock.svelte index 52722e3..0419815 100644 --- a/src/lib/components/blocks/FilesBlock.svelte +++ b/src/lib/components/blocks/FilesBlock.svelte @@ -38,6 +38,7 @@ case "xlsx": case "ods": case "csv": + case "tsv": return "mdi:file-excel-box"; case "ppt": case "pptx": @@ -57,6 +58,24 @@ case "txt": case "md": return "mdi:file-document-outline"; + case "json": + return "mdi:code-json"; + case "xml": + case "html": + case "htm": + return "mdi:xml"; + case "py": + return "mdi:language-python"; + case "js": + case "ts": + case "tsx": + case "jsx": + return "mdi:language-javascript"; + case "rs": + return "mdi:language-rust"; + case "sh": + case "bash": + return "mdi:console"; default: return "mdi:file-outline"; }