From fb8134d3e0558ce9d7c9d42204e23ce23ef0f8b9 Mon Sep 17 00:00:00 2001 From: Christophe HENRY Date: Thu, 27 Oct 2022 23:13:43 +0200 Subject: [PATCH 1/5] Fix typo in the English documentation about Apache --- docs/installation-en.gmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation-en.gmi b/docs/installation-en.gmi index 2f2f8b8..9d59b5d 100644 --- a/docs/installation-en.gmi +++ b/docs/installation-en.gmi @@ -28,7 +28,7 @@ location = /favicon.ico { alias /var/www/dev/htmgem/favicon.ico; } ``` DirectoryIndex index.gmi index.php index.html RewriteEngine on -rewriteRule ^(.+\.gmi)$ htmgem/index.php?rw=1&url=$1&style=default,htmgem.css +RewriteRule ^(.+\.gmi)$ htmgem/index.php?rw=1&url=$1&style=default,htmgem.css ``` Other available styles: From 6ba8cceb3d2276714dcdd222890e5a120b05a426 Mon Sep 17 00:00:00 2001 From: Lazarus Date: Tue, 1 Aug 2023 17:26:26 +0000 Subject: [PATCH 2/5] Fix getCss() calls Make ->getCss a method call instead of a property access so that it won't return null always. --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index c0b9a8b..6f3eea3 100644 --- a/index.php +++ b/index.php @@ -26,7 +26,7 @@ if (empty($url)) { http_response_code(403); } else { $gt_html = new \htmgem\GemTextTranslate_html(file_get_contents("index.gmi"), true, "$php_self?url=", $php_self_dir); - if (empty($gt_html->getCss)) $gt_html->addCss($php_self_dir.DEFAULT_CSS); + if (empty($gt_html->getCss())) $gt_html->addCss($php_self_dir.DEFAULT_CSS); // No URL Rewritting assumed echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $php_self, "$php_self?url="); @@ -66,7 +66,7 @@ if ($go404) { http_response_code(404); $page404 = \htmgem\html\get404GmiPage($url); $gt_html = new \htmgem\GemTextTranslate_html($page404); - if (empty($gt_html->getCss)) $gt_html->addCss($php_self_dir."/css/htmgem.css"); + if (empty($gt_html->getCss())) $gt_html->addCss($php_self_dir."/css/htmgem.css"); if ($urlRewriting) echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url); else From fa8538cd922e682b74243ef67d32d6e7deafdb5c Mon Sep 17 00:00:00 2001 From: Lazarus Date: Tue, 1 Aug 2023 17:48:52 +0000 Subject: [PATCH 3/5] Add style from Omar Polo's site --- css/default/omarpolo.css | 119 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 css/default/omarpolo.css diff --git a/css/default/omarpolo.css b/css/default/omarpolo.css new file mode 100644 index 0000000..2ec68c0 --- /dev/null +++ b/css/default/omarpolo.css @@ -0,0 +1,119 @@ +@import "base.css"; + +/* style from Omar Polo: https://gmid.omarpolo.com/style.css */ +body { + font-family: monospace; + font-size: 14px; + max-width: 780px; + margin: 0 auto; + padding: 10px; + padding-bottom: 80px; +} + +h1::before { + content: "# "; +} + +h2 { + margin-top: 40px; +} + +h2::before { + content: "## "; +} + +h3::before { + content: "### "; +} + +blockquote { + margin: 0; + padding: 0; +} + +blockquote::before { + content: "> "; +} + +blockquote p { + font-style: italic; + display: inline; +} + +p.link::before { + content: "→ "; +} + +strong::before { content: "*" } +strong::after { content: "*" } + +hr { + border: 0; + height: 1px; + background-color: #222; + width: 100%; + display: block; + margin: 2em auto; +} + +ul.link-list { + list-style: disclosure-closed; +} + +img { + border-radius: 5px; +} + +pre { + overflow: auto; + padding: 1rem; + background-color: #f0f0f0; + border-radius: 3px; +} + +pre.banner { + display: flex; + flex-direction: row; + justify-content: center; +} + +code, kbd { + color: #9d109d; +} + +img { + display: block; + margin: 0 auto; + max-width: 100%; +} + +@media (prefers-color-scheme: dark) { + body { +background-color: #222; +color: white; + } + + a { +color: aqua; + } + + hr { +background-color: #ddd; + } + + pre { +background-color: #353535; + } + + code, kbd { +color: #ff4cff; + } +} + +@media (max-width: 400px) { + pre.banner { font-size: 9px; } +} + +@media (max-width: 500px) { + pre.banner { font-size: 10px; } +} \ No newline at end of file From 8626aaf3e583ac52f7f6052f922802b0a4ba9ce0 Mon Sep 17 00:00:00 2001 From: Christophe HENRY Date: Tue, 1 Aug 2023 22:02:03 +0200 Subject: [PATCH 4/5] Moves omarpolo.css into Lazarus' directory --- css/{default => lazarus}/omarpolo.css | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename css/{default => lazarus}/omarpolo.css (100%) diff --git a/css/default/omarpolo.css b/css/lazarus/omarpolo.css similarity index 100% rename from css/default/omarpolo.css rename to css/lazarus/omarpolo.css From 4eb97465a0a4cb79cbfe2c888192dbb9609d309a Mon Sep 17 00:00:00 2001 From: Lazarus Date: Tue, 1 Aug 2023 19:47:15 +0000 Subject: [PATCH 5/5] Add a cool arrow to gmi links! --- css/lazarus/omarpolo.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/lazarus/omarpolo.css b/css/lazarus/omarpolo.css index 2ec68c0..c4e9072 100644 --- a/css/lazarus/omarpolo.css +++ b/css/lazarus/omarpolo.css @@ -26,6 +26,10 @@ h3::before { content: "### "; } +#gmi a::before { + content: "=> "; +} + blockquote { margin: 0; padding: 0;