diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1377554..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.swp diff --git a/CHANGELOG.gmi b/CHANGELOG.gmi index 2e75c38..da269f5 100644 --- a/CHANGELOG.gmi +++ b/CHANGELOG.gmi @@ -1,8 +1,8 @@ # Changelog All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https:/​/keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https:/​/semver.org/spec/v2.0.0.html). +=> https://keepachangelog.com/en/1.0.0/ The format is based on keep a Changelog. +=> https://semver.org/spec/v2.0.0.html And this project adheres to Semantic Versioning. ## [Unreleased] v3 * cgi-bin? Handle user input @@ -32,6 +32,15 @@ and this project adheres to [Semantic Versioning](https:/​/semver.org/spec/v2. * Proxy: https:/​/thewebsite.tld/htmgem/proxy/[gemini:/​/]capsule.tld/path/file.gmi * Search for {pages}.css from the current directory to the root. Empty css file means don’t search and go to default. +## [1.1.0] - 2021-03-14 +* File download when using "source" as a style. +* Improves the regex. +* Fixes 404 page text decoration, adds reload message. +* Links to download htmgem-master.zip. +* Links CHANGELOG and COPYING into index.gmi. +* Styles improvement, creation of raw.css. +* Rewording of texts. + ## [1.0.0] - 2021-03-10 * Improves presentation and installation page. * Adds stylesheets and download of pages source code. diff --git a/COPYING b/COPYING.gmi similarity index 99% rename from COPYING rename to COPYING.gmi index be3f7b2..e10ac3e 100644 --- a/COPYING +++ b/COPYING.gmi @@ -1,3 +1,4 @@ +^^^ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 @@ -51,7 +52,8 @@ code of the modified version. published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under -this license. +t//his license. + The precise terms and conditions for copying, distribution and modification follow. diff --git a/css/htmgem.css b/css/htmgem.css index 5306393..9486fdf 100644 --- a/css/htmgem.css +++ b/css/htmgem.css @@ -38,7 +38,7 @@ h1, h2, h3 { } h1 { font-size: 2rem; } -h2 { font-size: 1.8rem; } +h2 { font-size: 1.6rem; } h3 { font-size: 1.2rem; } blockquote { @@ -95,9 +95,7 @@ a.mailto:before { } pre { - background-color: #eee; margin: 0 -1rem; - padding: 1rem; overflow-x: auto; } diff --git a/css/index.gmi b/css/index.gmi index 1169988..d5b4741 100644 --- a/css/index.gmi +++ b/css/index.gmi @@ -7,7 +7,7 @@ => index.gmi|simple simple.css => index.gmi|htmgem htmgem.css => index.gmi|terminal terminal.css -=> index.gmi|pre pre.css +=> index.gmi|pre code source préformaté Simple ligne de texte diff --git a/index.gmi b/index.gmi index 20a8074..ba08644 100644 --- a/index.gmi +++ b/index.gmi @@ -15,10 +15,15 @@ Gemini est un nouveau protocole internet qui : ``` => https://gemini.circumlunar.space/ -=> https://framagit.org/Sbgodin/htmgem Page du projet de HtmGem : code source, rapports de bug, commentaires… +=> https://framagit.org/Sbgodin/htmgem/-/archive/master/htmgem-master.zip Téléchargez htmgem-master.zip pour l’installer +=> https://framagit.org/Sbgodin/htmgem Code source, rapports de bug, commentaires… + => https://gmi.sbgodin.fr/htmgem Page principale de HtmGem via le web => gemini://gmi.sbgodin.fr/htmgem Page principale de HtmGem via Gemini +=> CHANGELOG.gmi Journal des modifications (//changelog//) +=> COPYING.gmi GNU Affero General Public License (AGPLv3) + ———————————————————— ———————————————————— # Installation @@ -72,7 +77,7 @@ L’installation est terminée 🥳 La suite du texte donne des informations com Par défaut, le style est incorporé dans chaque page récupérée par le navigateur web. Le même style est utilisé pour toutes les pages, //htmgem/css/htmgem.css//, sauf lorsqu’un fichier ayant le même nom que la page mais avec l’extension **.css** existe dans le même répertoire. Dans ce cas, il est utilisé. -Lorsque l’option css est activé dans la configuration (voir //rewrite// plus haut) d’autres comportements sont possibles : +Lorsque l’option css est activé dans la configuration (voir //rewrite// plus haut) d’autres comportements sont possibles. **Attention**, cela ne fonctionnera pas avec un client Gemini puisque HtmGem n’est accessible que via un navigateur web. * &style=**htmgem** : Utilise le style par défaut, mais en tant que fichier externe. * &style=**none** : La page HTML est envoyée sans style. * &style=**** : Le fichier htmgem/css/.css est utilisé en tant que style externe. diff --git a/index.php b/index.php index 1a05672..e30f66c 100644 --- a/index.php +++ b/index.php @@ -69,9 +69,9 @@ if (empty($fileContents)) { $text404 = << $url 🔄 +=> $url Recharger 🔄 => / EOF; @@ -301,7 +301,14 @@ $page_title = @$matches[1]; **/ if ("source" == $style) { - echo $fileContents; + $basename = basename($filePath); + header("Cache-Control: public"); + header("Content-Disposition: attachment; filename=$basename"); + header("Content-Type: text/plain"); + header("Content-Transfer-Encoding: binary"); + header('Content-Length: ' . filesize($filePath)); + readfile($filePath); + exit(); } elseif ("pre" == $style) { $fileContents = htmlspecialchars($fileContents, ENT_HTML5|ENT_NOQUOTES, "UTF-8", false); echo << gemini://gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini -=> gemini://gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini +​=> gemini:/​/gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini +=> gemini:/​/gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini -^=​> https://gemini.circumlunar.space/docs/specification.gmi +​=> https:/​/gemini.circumlunar.space/docs/specification.gmi => https://gemini.circumlunar.space/docs/specification.gmi # Décoration du texte