summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-10-06 14:12:12 +0500
committerilotterytea <iltsu@alright.party>2025-10-06 14:12:12 +0500
commit866a6930e141ae2c56acb0aade801440f19180c5 (patch)
tree6f72ebf601c65f36451e6214498fd91223d029e4
parent512783782f87fef2be2d70bbd301e1b73c361fff (diff)
feat: description tag + robots tag
-rw-r--r--public/catalogue.php2
-rw-r--r--public/index.php19
-rw-r--r--public/mod.php2
-rw-r--r--public/report.php2
-rw-r--r--public/stats.php2
-rw-r--r--public/uploaders.php2
6 files changed, 26 insertions, 3 deletions
diff --git a/public/catalogue.php b/public/catalogue.php
index a580996..407eedb 100644
--- a/public/catalogue.php
+++ b/public/catalogue.php
@@ -63,10 +63,12 @@ unset($f);
<head>
<title>File Catalogue &lpar;Page <?= $page + 1 ?>/<?= $max_pages ?>&rpar; - <?= INSTANCE_NAME ?></title>
+ <meta name="description" content="Library of <?= INSTANCE_NAME ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <meta name="robots" content="noindex, nofollow">
<meta name="theme-color" content="#ffe1d4">
</head>
diff --git a/public/index.php b/public/index.php
index 7aeff6e..dd92e66 100644
--- a/public/index.php
+++ b/public/index.php
@@ -159,6 +159,17 @@ if (FILE_CATALOG_FANCY_VIEW && $file_id) {
}
$file['resolution'] = implode(' ', $file['resolution']) ?: null;
+
+ $file['html_description'] = $file['mime'] . ' - ' . $file['extension'];
+ if (isset($file['views'])) {
+ $file['html_description'] .= " - {$file['views']} views";
+ }
+ if (isset($file['uploaded_at'])) {
+ $file['html_description'] .= ' - Uploaded ' . format_timestamp(strtotime($file['uploaded_at'])) . ' ago';
+ }
+ if (isset($file['resolution'])) {
+ $file['html_description'] .= " - {$file['resolution']}";
+ }
}
$tos_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/TOS.txt');
@@ -170,17 +181,19 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt');
<?php if ($file): ?>
<title><?= $file['name'] ?> - <?= INSTANCE_NAME ?></title>
<meta property="og:title" content="<?= $file['name'] ?> - <?= INSTANCE_NAME ?>" />
- <meta property="og:description" content="<?= $file['size_formatted'] ?> - <?= $file['mime'] ?> &#40;<?= $file['extension'] ?>&#41;
- <?php if (isset($file['resolution'])): ?>
- - <?= $file['resolution'] ?><?php endif; ?>" />
+ <meta property="og:description" content="<?= $file['html_description'] ?>" />
<meta property="og:url" content="<?= sprintf("%s/%s.%s", INSTANCE_URL, $file['id'], $file['extension']) ?>" />
<meta property="og:type" content="website" />
<?php if (FILE_THUMBNAILS): ?>
<meta property="og:image"
content="<?= sprintf('%s%s/%s.webp', INSTANCE_URL, FILE_THUMBNAIL_DIRECTORY_PREFIX, $file['id']) ?>" />
<?php endif; ?>
+ <meta name="robots" content="noindex, nofollow">
<?php else: ?>
<title><?= INSTANCE_NAME ?></title>
+ <meta name="description"
+ content="<?= INSTANCE_NAME ?> is a simple, free and anonymous file sharing site. We do not store anything other than the files you upload.">
+ <meta name="robots" content="nofollow">
<?php endif; ?>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css">
diff --git a/public/mod.php b/public/mod.php
index a1d91b8..25d4754 100644
--- a/public/mod.php
+++ b/public/mod.php
@@ -45,11 +45,13 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
<head>
<title>Moderation - <?= INSTANCE_NAME ?></title>
+ <meta name="description" content="The moderation panel of <?= INSTANCE_NAME ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="theme-color" content="#ffe1d4">
+ <meta name="robots" content="noindex, nofollow">
</head>
<body>
diff --git a/public/report.php b/public/report.php
index 9ede7b4..c25c0b7 100644
--- a/public/report.php
+++ b/public/report.php
@@ -116,11 +116,13 @@ if (!is_file(FILE_UPLOAD_DIRECTORY . "/{$file_id}")) {
<head>
<title>Report - <?= INSTANCE_NAME ?></title>
+ <meta name="description" content="Report a file that needs to be deleted from the <?= INSTANCE_NAME ?> servers">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="theme-color" content="#ffe1d4">
+ <meta name="robots" content="noindex, nofollow">
</head>
<body>
diff --git a/public/stats.php b/public/stats.php
index 56a2acd..cd1b571 100644
--- a/public/stats.php
+++ b/public/stats.php
@@ -86,11 +86,13 @@ $file_stats['approx_filesize'] = format_filesize($file_stats['approx_filesize'])
<head>
<title>Statistics - <?= INSTANCE_NAME ?></title>
+ <meta name="description" content="The statistics of <?= INSTANCE_NAME ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="theme-color" content="#ffe1d4">
+ <meta name="robots" content="noindex, nofollow">
</head>
<body>
diff --git a/public/uploaders.php b/public/uploaders.php
index e60195b..95652a4 100644
--- a/public/uploaders.php
+++ b/public/uploaders.php
@@ -21,11 +21,13 @@ foreach (FILE_ACCEPTED_MIME_TYPES as $k => $v) {
<head>
<title>Uploaders - <?= INSTANCE_NAME ?></title>
+ <meta name="description" content="<?= INSTANCE_NAME ?> configuration for custom file uploader software">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="theme-color" content="#ffe1d4">
+ <meta name="robots" content="noindex, nofollow">
</head>
<body>