Conditionally display maps and app store tiles

This commit is contained in:
John Hess 2025-02-18 14:04:48 -06:00
parent 7b3fe45880
commit 3246b44a86
5 changed files with 42 additions and 22 deletions

View file

@ -11,6 +11,10 @@ const supported_extensions = ["apk", "deb", "dmg", "pdf", "exe", "jpg", "png", "
const usbRoot = "usb-butter/";
const inferredBaseURL = window.location.pathname.split("/" + usbRoot)[0] + "/";
// Don't display these in the dirlisting; they get first-class treatment
// on the homepage.
const foldersToHide = ["appstore", "osm-map-files"];
const getFolderDivHTML = (directory_name, number_of_items, href) => {
return `
<a class="filerow" href="${href}">
@ -91,7 +95,7 @@ function extractDirectoryListing(doc) {
// Determine if it's a file or folder based on the class of the row or type
if (type === 'Directory') {
if (name !== '..') {
if (name !== '..' && !foldersToHide.includes(name)) {
folders.push({
name: name.replace('/', ''), // Remove the trailing slash
lastModified: lastModified,