Giter Site home page Giter Site logo

Add async scripts about kirby3-htmlhead HOT 3 CLOSED

seehat avatar seehat commented on June 5, 2024
Add async scripts

from kirby3-htmlhead.

Comments (3)

bnomei avatar bnomei commented on June 5, 2024

the build in snippet has no support for that yet.
https://github.com/bnomei/kirby3-htmlhead/blob/master/snippets/htmlhead/script-js.php

but you could create your own snippet and just add its filename with to the plugins config array. like here but indead of htmlhead/script-js you could use your snippets filename.

TIP: thats how you can basically add anything to this plugin. snippets ftw. :D

from kirby3-htmlhead.

seehat avatar seehat commented on June 5, 2024

Ok thank you for your tip! I know this and thought that it would make sense in core, but it's ok for me, when it stays like this.

from kirby3-htmlhead.

bnomei avatar bnomei commented on June 5, 2024

@seehat new in https://github.com/bnomei/kirby3-htmlhead/releases/tag/v2.1.9

'htmlhead/script-js' => function ($kirby, $site, $page) {
            return ['files' => [
                // NEW !! ARRAY
                [
                    'src' => 'somescript.js', 
                    'async' => true,
                ],
                '/assets/app.js', // STRING
                'https://cdn.jsdelivr.net/npm/[email protected]/webfontloader.min.js|sha256-4O4pS1SH31ZqrSO2A/2QJTVjTPqVe+jnYgOWUVr7EEc=', // STRING|INTEGRIY
            ]];
        },

from kirby3-htmlhead.

Related Issues (16)

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.