Browse Source

include author_link for additional linkage

remotes/origin/HEAD v3.2.0
René Wagner 9 months ago
parent
commit
52074ce260
  1. 1
      README.md
  2. 7
      data/config.json.example
  3. 9
      index.php

1
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`

7
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",
}
}

9
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">&copy; 2020 <?php echo $config_content["settings"]["author"]; ?> and <a href="https://sr.ht/~rwa/devShort/" target="_blank">devShort</a></span>
<span class="text-light">&copy; 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>

Loading…
Cancel
Save