matt-j-m / grav-plugin-aura

The Aura Plugin for Grav CMS adds meta tags and structured data to your pages for visually appealing and informative search results and social media shared links.
MIT License
26 stars 7 forks source link

Fix image URL and double encoded HTML entities #19

Closed Karmalakas closed 3 years ago

Karmalakas commented 3 years ago

As develop branch is behind master, so creating PR to master - change if needed

Karmalakas commented 3 years ago

In og:image now the root of web project is added twice, for example: https://localhost/transportopaslaugos/transportopaslaugos/user/pages/01.home/pervezimas.jpg

@01Kuzma, how does your frontmatter of /home look like? Because it used to parse image based on path and now I've doe so it would take ImageMedium object and call url() method ($image->url()). But it also prepends $this->grav['base_url_absolute'], so I wonder what this one is also. Could you try debugging this? I don't experience this :/

01Kuzma commented 3 years ago

Hm, I've just moved a random image from desktop to Content's Page Media, then selected that image in Aura's tab. Somehow the image path is spoiled...

metadata:
  'og:url': 'https://localhost/transportopaslaugos/'
  'og:image': 'https://localhost/transportopaslaugos/transportopaslaugos/user/pages/01.home/pervezimas.jpg'

If I delete the second path transportopaslaugos in Frontmatter and save, it still reloads with double path. I've downloaded whole archive from your repo and replaced existing plugin with yours

I'm checking it on localhost. but don't think that this could be an issue :/

Karmalakas commented 3 years ago

Just reproduced this on test page when Grav is not in root.

Absolute base URL and provided Image URL overlaps :/ Not sure yet how to solve it

^ "http://playground.local/test"
^ "/test/user/pages/01.home/logo.jpg?g-5fd44dff$"

Hopefully will fix this a bit later

01Kuzma commented 3 years ago

I'm glad that you are able to reproduce it

Karmalakas commented 3 years ago

@01Kuzma, just pushed /classes/aura.php. Please check if it works

01Kuzma commented 3 years ago

Seems working fine 👍 I had to remove previous image and re-upload it. Thank you!

01Kuzma commented 3 years ago

@matt-j-m can you merge it?