]> git.wh0rd.org - nano-editor.git/commitdiff
add a <meta> description tag in the <head> section of the main page
authorBenno Schulenberg <bensberg@telfort.nl>
Wed, 5 May 2021 10:38:55 +0000 (12:38 +0200)
committerBenno Schulenberg <bensberg@telfort.nl>
Wed, 5 May 2021 10:38:55 +0000 (12:38 +0200)
Otherwise search engines will show the garbage of the ASCII art.

Thanks to Peter Liscovius for suggesting how to do this in PHP.

This fixes https://savannah.gnu.org/bugs/?60511.

index.php
top.php

index bff9a4b70e3b81f8c78a527b944c35fa83e62cab..5b64d34ea598ccd4fdbf90c21f89cf4f287a4fdd 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,4 +1,4 @@
-<?php $title="Text Editor";  include "top.php"; ?>
+<?php $title="Text Editor";  $mainpage="true";  include "top.php"; ?>
 
 <table BORDER=0 CELLSPACING=40 WIDTH="100%">
 <tr>
diff --git a/top.php b/top.php
index e65903563aa0e070cb6b995447db70b95f55fb6e..bdea83853a7f6755486f86a34fb918c78d2cd860 100644 (file)
--- a/top.php
+++ b/top.php
@@ -4,6 +4,9 @@
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title><?= $title ?></title>
+   <?php if (isset($mainpage)): ?>
+   <meta name="description" content="GNU nano is a small editor for on the terminal. It supports syntax highlighting, spell checking, justifying, completion, undo/redo...">
+   <?php endif; ?>
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="style-dark.css" media="(prefers-color-scheme: dark)"/>
    <link rel="stylesheet" href="style-light.css" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"/>