commit e2dcfb7465ec912dfbc0d99b51a3aa73bf0e1489
parent 459edcc0016f69fcb1e0afd009545bc2eb9e660a
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Fri, 18 Oct 2024 11:46:47 +0200
feat: add category descriptions
Diffstat:
2 files changed, 55 insertions(+), 27 deletions(-)
diff --git a/config/config.php b/config/config.php
@@ -569,67 +569,88 @@ $searches = array(
/* Categories */
$categories = array(
"android" => array(
- "name" => "Android"
+ "name" => "Android",
+ "description" => "Android operating system"
),
"archive" => array(
- "name" => "Archives"
+ "name" => "Archives",
+ "description" => "Archiving platforms"
),
"audio" => array(
- "name" => "Audio"
+ "name" => "Audio",
+ "description" => "Audio and sound"
),
"code" => array(
- "name" => "Coding"
+ "name" => "Coding",
+ "description" => "Code repositories and coding platforms"
),
"community" => array(
- "name" => "Community"
+ "name" => "Community",
+ "description" => "Community driven or operated"
),
"docu" => array(
- "name" => "Manuals"
+ "name" => "Documentation",
+ "description" => "Documentation and manuals"
),
"edu" => array(
- "name" => "Educational"
+ "name" => "Educational",
+ "description" => "Educational and learning platform"
),
"fedi" => array(
- "name" => "Fediverse"
+ "name" => "Fediverse",
+ "description" => "ActivityPub and Fediverse"
),
"foss" => array(
- "name" => "FOSS"
+ "name" => "FOSS",
+ "description" => "Free and Open Source"
),
"img" => array(
- "name" => "Images"
+ "name" => "Images",
+ "description" => "Photography, Images and other visual content"
),
"lang" => array(
- "name" => "Languages"
+ "name" => "Languages",
+ "description" => "Dictionaries and translation platforms"
),
"linux" => array(
- "name" => "Linux"
+ "name" => "Linux",
+ "description" => "GNU+Linux related"
),
"map" => array(
- "name" => "Maps"
+ "name" => "Maps",
+ "description" => "Mapping, navigation and traveling"
),
"meta" => array(
"name" => "Meta",
+ "description" => "Meta search engine"
),
"misc" => array(
- "name" => "Other"
+ "name" => "Other",
+ "description" => "Other"
),
"news" => array(
- "name" => "News"
+ "name" => "News",
+ "description" => "News and journalist outlets"
),
"sci" => array(
- "name" => "Science"
+ "name" => "Science",
+ "description" => "Scientific databases and literature"
),
"software" => array(
- "name" => "Software"
+ "name" => "Software",
+ "description" => "Software and program repositories"
),
"wiki" => array(
- "name" => "Wikis"
+ "name" => "Wikis",
+ "description" => "Collaboratiely edited knowledge platform"
),
"web" => array(
- "name" => "General",
+ "name" => "Websearch",
+ "description" => "General websearch"
),
"vid" => array(
- "name" => "Videos"
+ "name" => "Videos",
+ "description" => "Videos, series and movies"
)
);
diff --git a/index.php b/index.php
@@ -205,16 +205,22 @@
<div class="row">
<!-- Always insert a "Default" category button -->
- <button onclick="filter_category('Default');">
+ <button
+ onclick="filter_category('Default');"
+ title="Search Engine that is choosen as fallback"
+ >
#Default
</button>
<!-- List all configured categories -->
<?php
- foreach (array_keys($categories) as $catid) {
- $cat_name = $categories[$catid]["name"];
+ foreach (array_keys($categories) as $cid) {
+ $cat_name = $categories[$cid]["name"];
?>
- <button onclick="filter_category('<?php echo $cat_name; ?>');">
+ <button
+ onclick="filter_category('<?php echo $cat_name; ?>');"
+ title="<?php echo $categories[$cid]["description"]; ?>"
+ >
<?php echo "#" . $cat_name; ?>
</button>
<?php
@@ -258,10 +264,11 @@
<?php
/* List all categories of current entry */
- foreach ($search["categories"] as $catid) {
- $cat_name = $categories[$catid]["name"];
+ foreach ($search["categories"] as $cid) {
?>
- <mark><?php echo "#" . $categories[$catid]["name"]; ?></mark>
+ <mark title="<?php echo $categories[$cid]["description"];?>">
+ <?php echo "#" . $categories[$cid]["name"]; ?>
+ </mark>
<?php
}
?>