Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Broken link to lib/plugins/icalevents/ics.png when using Doku's internal "Nice URL" engine #13

Closed
gsurrel opened this issue Nov 14, 2016 · 5 comments

Comments

@gsurrel
Copy link

gsurrel commented Nov 14, 2016

When using DokuWiki's internal "Nice URL" engine, the path of the "Add to calendar" image is broken as it's a relative link:

.../doku.php?id=page turns to .../doku.php/page/ which changes the path to a virtual subdirectory (and more, when using namespaces). This breaks the path of the image in this file, this line.

Maybe there is a function to get the base directory to build the link on that, or simply use an inline base64 as used for the other native links?

@gsurrel gsurrel changed the title Broken linl to lib/plugins/icalevents/ics.png when using Doku's internal "Nice URL" engine Broken link to lib/plugins/icalevents/ics.png when using Doku's internal "Nice URL" engine Nov 14, 2016
@real-or-random
Copy link
Owner

Indeed. Seems that DOKU_BASE is the way to fix this, see for instance https://github.com/matzekuh/dokuwiki-plugin-doodle3/blob/master/syntax.php#L294 . PR welcome. ;)

@gsurrel
Copy link
Author

gsurrel commented Nov 14, 2016

Do you prefer it as an embedded base64 to follow Doku's behavior for the other inline icons? It would be just like the following:

$link['style']  = 'background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJlSURBVDjLpZNbaM9hGMc/v8NsTqF2yMhZKIexmpFyRZIiblwouZDauLYoTVEryg2uXIoIOUU5zJkh4e9QDmtJbWxrbUzz/72/9/m6+P3HLslbT9/3ufm+n/f7Pm8gif9ZMcDxe717JLZ62UQzwxukZnhveBOptyHl8anwZk/3b5pZEwOYtGNDzejSfzm58dTH+b8JvFkpwMizdSCBT8E8OJftkzy4BPIOnONHQzPO+eIhBoM5CCrLwNKslBZM8uDykCbwtgMAl/o/GXhvBYMA2rtAlpGYZSR+UIGKCgCSggGSOHy1Q/0DTifufZUknbr/RZJ0+mHWn3mU9edbMu3qG9DmQ08lKSNw3jCJOIKzjzqJopBzLZ3EEVx40smDr/u4e96QGUXPGpkzYQSJywjCwSsIiKOADUvKiUNYX1tOUQhra8oJg4hZ02cQhhGrqyuyp03tTwbOGzKIQ7j8rIsn3Qd4fEVIIn6+kzAMaH35Fn37wbZD68gnCUl+EbAkI3CpIYmiCNZUlwEwbfIUgiBg1cIyJqbzGFPiWbl8GXUb66mqnkrJ2IvUbq88GEI2dQBRGHDjZTcAbZ8+ERDQnOvm+fszVM1egA89C8avwAeO2nlLAeqRxK7j79TzPa/mXJck6darTG8XdM3uhbry+piGrou5I1pcP17h7wwk5k4aRUfPANMrhtP2pZ8J44bx7nMfff29vGl/SNP1LQA0XdtCa2cO4GdhkPRg78kPVYm3kS71uNTjU8N5I/UpxSWracndZOn8ZVx6dZRhQcz9F3cAjgR/+51rt1c2AXXAaOA7cLTlcHvDL6y6kIpO9lqsAAAAAElFTkSuQmCC');';

It's 964 bytes, VS 723 bytes when not encoded, but saving a round-trip request where the headers and cookie might be bigger :)

@real-or-random
Copy link
Owner

Thanks! Sounds nice if this is the standard way in Dokuwiki. However, then I think it's more efficient to define the image only once in CSS, see https://www.dokuwiki.org/devel:css#plugins_styles

@glensc
Copy link
Collaborator

glensc commented Nov 14, 2016

also dokuwiki core will inline small images to css itself

https://www.dokuwiki.org/config:cssdatauri

@real-or-random
Copy link
Owner

Oh good point. Then it makes sense to put it in a proper CSS file and let DokuWiki decide if it should be inlined, I think.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants