Issue #38: Add optional description to sites

This commit is contained in:
Dale Davies
2022-06-30 10:43:41 +01:00
parent 6790438508
commit 3477c05c48
3 changed files with 4 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ class Site {
$this->newtab = isset($sitearray['newtab']) ? $sitearray['newtab'] : (isset($this->defaults['newtab']) ? $this->defaults['newtab'] : false);
$this->iconname = $sitearray['icon'] ?? null;
$this->tags = $sitearray['tags'] ?? $this->tags;
$this->description = isset($sitearray['description']) ? $sitearray['description'] : $sitearray['name'];
}
/**

View File

@@ -8,6 +8,7 @@
{
"name": "Github",
"url" : "https://github.com/daledavies/jump",
"description": "This is a test",
"nofollow": false,
"newtab": true
},
@@ -18,6 +19,7 @@
{
"name": "Bitwarden",
"url" : "https://bitwarden.example.com",
"description": "This is another test",
"icon": "bitwarden.png",
"tags": ["stuff"]
},

View File

@@ -1,6 +1,6 @@
{{# hassites}}
<ul class="sites {{# altlayout}}alternate{{/ altlayout}}">
{{# sites}}<li><a {{# newtab}}target="_blank"{{/ newtab}} rel="{{# nofollow}}nofollow {{/ nofollow}}{{# newtab}}noopener{{/ newtab}}" title="{{name}}" href="{{url}}">
{{# sites}}<li><a {{# newtab}}target="_blank"{{/ newtab}} rel="{{# nofollow}}nofollow {{/ nofollow}}{{# newtab}}noopener{{/ newtab}}" title="{{description}}" href="{{url}}">
<span class="icon">
<img src="/api/icon.php?siteurl={{#urlencode}}{{url}}{{/urlencode}}">
</span>