Skip to content

Commit

Permalink
Issue #38: Add optional description to sites
Browse files Browse the repository at this point in the history
  • Loading branch information
daledavies committed Jun 30, 2022
1 parent 6790438 commit 3477c05
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions jumpapp/classes/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function __construct(private Config $config, array $sitearray, private ar
$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'];
}

/**
Expand Down
2 changes: 2 additions & 0 deletions jumpapp/sites/sites.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{
"name": "Github",
"url" : "https://github.com/daledavies/jump",
"description": "This is a test",
"nofollow": false,
"newtab": true
},
Expand All @@ -18,6 +19,7 @@
{
"name": "Bitwarden",
"url" : "https://bitwarden.example.com",
"description": "This is another test",
"icon": "bitwarden.png",
"tags": ["stuff"]
},
Expand Down
2 changes: 1 addition & 1 deletion jumpapp/templates/sites.mustache
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit 3477c05

Please sign in to comment.