Giter Club home page Giter Club logo

Comments (8)

LilaRest avatar LilaRest commented on June 2, 2024 1

I will try another time on the project on which I'm currently working. I'll let you know

from head-plugin.

LilaRest avatar LilaRest commented on June 2, 2024

I've created a fork to implement this functionality : https://github.com/LilianCruanes/head-plugin
And also send a pull request.
See you.

from head-plugin.

gmrchk avatar gmrchk commented on June 2, 2024

Hey, thanks for the PR!

Can you explain a use case for this? If the tag is in the head tag of the page source, why wouldn't it be replaced by the head plugin? This would introduce an inconsistency from the actual page source, where I don't see reason, but maybe I'm missing something.

from head-plugin.

LilaRest avatar LilaRest commented on June 2, 2024

Hi ! Let me explain one of my use cases :
Jinja style templates (like Django's templates for example), allow users to create base pages from which others pages can inherit.
In the project on which I actually work there is a nav bar and only the content bellow the nav bar is replaced.
If the style of the nav bar isn't fixed we can observe a 'flash' effect during page's transition cause the navbar style is removed then re-applied.

It is also nice to have a 'general' style in which all common content is inserted, it reduces request's number as well as files' sizes and so increases speed of the website.

from head-plugin.

gmrchk avatar gmrchk commented on June 2, 2024

In case an HTML tag is present in both, current and future head tag, the plugin will compare the two, and won't replace it at all, so the blinking shouldn't occur. If some blinking is present, there is a bug in a plugin, or the HTML tags are not identical. I would need a demo to check what's the issue.

I'm guessing if we make it work as expected, this change in the plugin is not necessary.

from head-plugin.

LilaRest avatar LilaRest commented on June 2, 2024

Don't have time to deploy a demo, sorry... But I can say to you : Yes it is blinking and yes scripts was the same !

from head-plugin.

gmrchk avatar gmrchk commented on June 2, 2024

Double checked and the plugin seems to work as expected for me - if the style tag (like below) is present in both pages, the plugin doesn't replace it and no blinking is present, so I can't reproduce the problem.

<link rel="stylesheet" href="/assets/frontend/css/main.css">

Unfortunately, I can't help if I can't see the problem.

from head-plugin.

gmrchk avatar gmrchk commented on June 2, 2024

Please, feel free to open new issue if you happen to have a demo we could check.

from head-plugin.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.