commit 52074ce2603dd0844e9cf4f9f3087a03db16c95f
parent 8a94ed58f602b07bfc4bdefc538bc1c80905b97d
Author: René Wagner <rwagner@rw-net.de>
Date: Sun, 27 Sep 2020 19:18:15 +0200
include author_link for additional linkage
Diffstat:
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
@@ -50,6 +50,7 @@ All configuration is done in the file `data/config.json`. Below is a list of val
* `admin_password` -> password for the admin panel, is securely hashed after first login
* `name` -> name of your site
* `author` -> name of the author/admin
+* `author_link` -> link to your profile on a social network, keybase or similar, uses the "rel=me" flag
* `home_link` -> link to your homepage
* `favicon` -> relative path to your favicon, e.g. `assets/icon.png`
* `random_shortlink` -> show "explore" section on index page, `true` or `false`
diff --git a/data/config.json.example b/data/config.json.example
@@ -3,14 +3,15 @@
"settings": {
"name": "devShort shortlink service",
"author": "The admin",
- "home_link": "https://sr.ht/~rwa/devShort",
+ "author_link": "https:\/\/www.mysite.org",
+ "home_link": "https:\/\/sr.ht\/~rwa\/devShort",
"favicon": "assets/icon.png",
"random_shortlink": false,
"custom_links": {
- "sourcehut": "https://sourcehut.org",
+ "sourcehut": "https:\/\/sourcehut.org",
}
},
"shortlinks": {
- "repo": "https://git.sr.ht/~rwa/devShort",
+ "repo": "https:\/\/git.sr.ht\/~rwa\/devShort",
}
}
diff --git a/index.php b/index.php
@@ -30,6 +30,13 @@ if ($config_content["settings"]["custom_links"]) {
$links_string = substr($links_string, 0, -1);
}
+$author_string = "";
+if ($config_content["settings"]["author_link"]) {
+ $author_string = "<a rel=\"me\" target=\"_blank\" href=\"". $config_content["settings"]["author_link"] ."\">".$config_content["settings"]["author"]."</a>";
+} else {
+ $author_string = $config_content["settings"]["author"];
+}
+
function show_random_shortlink() {
global $config_content;
@@ -81,7 +88,7 @@ function show_random_shortlink() {
<footer class="footer mt-auto py-3 bg-dark">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
- <span class="text-light">© 2020 <?php echo $config_content["settings"]["author"]; ?> and <a href="https://sr.ht/~rwa/devShort/" target="_blank">devShort</a></span>
+ <span class="text-light">© 2020 <?php echo $author_string; ?> and <a href="https://sr.ht/~rwa/devShort/" target="_blank">devShort</a></span>
<?php if ($links_string) { echo "<span class=\"text-muted\">$links_string</span>"; } ?>
</div>
</div>