Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how plugins can add a custom favicon #152

Merged
merged 6 commits into from Jul 20, 2021

Conversation

create-issue-branch[bot]
Copy link
Contributor

@create-issue-branch create-issue-branch bot commented Jul 15, 2021

closes #140

@nhoening nhoening marked this pull request as ready for review Jul 15, 2021
@nhoening
Copy link
Contributor

@nhoening nhoening commented Jul 15, 2021

I tested this locally with our current customer's plugin.

Before merging, lets' wait for #151 to land, so we can check if the generated documentation looks nice.

@nhoening nhoening changed the title Allow plugins to add a custom favicon Document how plugins can add a custom favicon Jul 15, 2021
@nhoening nhoening requested a review from Flix6x Jul 15, 2021
Flix6x
Flix6x approved these changes Jul 16, 2021
Copy link
Contributor

@Flix6x Flix6x left a comment

Looks clear to me.

@Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jul 16, 2021

Actually, I may have run into a problem: I noticed that by overriding the static folder, any plugin logic that uses content from the original flexmeasures static folder flexmeasures/ui/static no longer has access to that content (in my case, the app failed to retrieve daterange-utils.js and flexmeasures.js). Copying what you need to the plugin's static folder is one way to resolve that, but maybe there is a more elegant way that let's the app access both static folders?

@nhoening
Copy link
Contributor

@nhoening nhoening commented Jul 16, 2021

Good catch, this needs a little tinkering with an own static path and/or url for the blueprint: https://www.siparker.net/python/how-to-use-blueprint-static-folders-correctly-in-python-flask/

@Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jul 19, 2021

If we leave this one line out (see 61a0b08), both static folders (of the app and of the plugin) seem to be served on the app's static url path. Then there is no need anymore to copy over static content from the app to the plugin.

@nhoening
Copy link
Contributor

@nhoening nhoening commented Jul 19, 2021

@Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jul 19, 2021

Indeed the favicon is still being served (I checked with a fresh favicon).

@Flix6x Flix6x merged commit 5a9a649 into main Jul 20, 2021
2 checks passed
@Flix6x Flix6x deleted the issue-140-Allow_plugins_to_add_a_custom_favicon branch Jul 20, 2021
@Flix6x Flix6x added this to the 0.6.0 milestone Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants