GithubHelp home page GithubHelp logo

emilianobruni / mojolicious-plugin-linkedcontent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yko/mojolicious-plugin-linkedcontent

0.0 3.0 0.0 31 KB

Plugin to manage css and js

Perl 78.85% Turing 21.15%

mojolicious-plugin-linkedcontent's Introduction

NAME

Mojolicious::Plugin::LinkedContent - manage linked css and js

SYNOPSIS

    use base 'Mojolicious';
    sub statup {
        my $self = shift;
        $self->plugin( 'linked_content' );
    }

Somewhere in template:

    % require_css 'mypage.css';
    % require_js 'myscript.js';
    % require_reg 'bootstrap';

And in <HEAD> of your layout:

    %== include_css;
    %== include_js;

DESCRIPTION

Helps to manage scripts and styles included in document.

INTERFACE

HELPERS

require_js

Add one or more js files to load queue.

require_css

Add one or more css files to load queue.

require_reg

Add a library and its dependences based on reg_config file

register

Render the plugin. Internal

include_js =item include_css

Render queue to template

ITEMS

store_items

Internal method

CONFIGURATION AND ENVIRONMENT

Mojolicious::Plugin::LinkedContent can recieve parameters when loaded from Mojolicious like this:

    $self->plugin(
        'linked_content',
        'js_base'  => '/jsdir',
        'css_base' => '/cssdir'
        'reg_config' => '/linked_content.cfg',
    );

If no basedirs provided, '/js' and '/css' used by default. If no reg_config is provided a cloud example file is used. Default reg_config URL: https://raw.githubusercontent.com/EmilianoBruni/MPLConfig/main/linked_content.cfg

AUTHOR

Yaroslav Korshak <[email protected]>, Emiliano Bruni <[email protected]

CREDITS

    Oliver Günther

LICENCE AND COPYRIGHT

Copyright (C) 2010 - 2013, Yaroslav Korshak Copyright (C) 2019 - 2021, Emiliano Bruni

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

mojolicious-plugin-linkedcontent's People

Contributors

emilianobruni avatar oliverguenther avatar yko avatar

Watchers

 avatar  avatar  avatar

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.