-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add lazy loading to md image #337
base: master
Are you sure you want to change the base?
Add lazy loading to md image #337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not make it work locally, markdown-viewer does not seem to get mounted.
The issue I see with this approach is that before vue app can be loaded (can take up some time), description will be empty. I think it may degrade user experience?
@@ -103,8 +103,9 @@ <h1 class="fr-mb-5v fr-h3"> | |||
</h1> | |||
<h2 id="description" class="subtitle fr-mb-1w">{{ _('Description') }}</h2> | |||
<read-more max-height="description" class="fr-mb-n1w"> | |||
{{ dataset.description|markdown }} | |||
<markdown-viewer data-content="{{dataset.description|to_json}}"></markdown-viewer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we keep this idea, we should apply the same logic for other markdown contents? In particular, I'm thinking of pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed the idea to have a unified viewer for all contents. This could allow us to use DSFR tables everywhere for example instead of our custom ones.
I'll look into it.
Vue loading shouldn't be longer here than on other pages but I agree that nothing was done currently regarding performance and we should start working on it or at least planning some work like Sentry Performance Monitoring. |
My bad, I had not build the correct udata-front assets. After rebuilding, it works correctly! |
This PR will be replaced due to datagouv/data.gouv.fr#1194 |
Closes datagouv/data.gouv.fr#1188
This PR also introduces a unified
<markdown-viewer>
.