diff --git a/CHANGELOG.md b/CHANGELOG.md index 2068ba8..b42223f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# v1.0.7 +## 15/10/2022 + +1. [](#new) + * Use revision for astrobin link URL + +2. [](#bugfix) + * Fix astrobin link URL + + # v1.0.6 ## 11/10/2022 diff --git a/blueprints.yaml b/blueprints.yaml index 2c60195..461b482 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Astrobin -version: 1.0.6 +version: 1.0.7 description: "This plugin provides astrobin shortcodes for images and galleries" icon: picture-o author: diff --git a/classes/Image.php b/classes/Image.php index 407e7ff..e746b9f 100644 --- a/classes/Image.php +++ b/classes/Image.php @@ -20,6 +20,7 @@ public function __construct($info, $api) $revision_obj = $api->request($revision, [], false); array_push($this->revisions, $revision_obj); } + // dump($this); } public function id() { @@ -69,8 +70,12 @@ public function url($format, $revision_type="final", $animated=false) { return $url; } - public function astrobinPage() { - return 'https://www.astrobin.com/' . $this->info->id; + public function astrobinPage($revision) { + $url = 'https://www.astrobin.com/' . ($this->info->hash ? $this->info->hash : $this->info->id); + if(!is_null($revision)) { + $url = $url . "#r" . $revision; + } + return $url; } public function description() { diff --git a/templates/partials/astrobin-image-lightbox.html.twig b/templates/partials/astrobin-image-lightbox.html.twig index 504ffdc..3232304 100644 --- a/templates/partials/astrobin-image-lightbox.html.twig +++ b/templates/partials/astrobin-image-lightbox.html.twig @@ -3,7 +3,7 @@