Asset Plugin for Fansoro CMS
The plugin to automatically connect CSS and JS files in the site template.
- Easy use.
- Small size.
- Add
?v=XXXfor links to files. - The ability to add files with their attributes (For example async).
See this instruction
# Prefix of files to exclude
excludes:
- '-'
- '_'
# The folder relative to the root of the current template,
# which will be connected files (uncomment if necessary)
# folders:
# - '/assets/js/'
# - '/assets/css/- Uncomment folders config
# folders:
# - '/assets/css/'
# - '/assets/js/'<!-- In Template: -->
{Action::run('asset_folder')}
<!-- In Browser: -->
<link rel="stylesheet" href="/themes/default/assets/css/bootstrap.min.css?v=1447304405">
<link rel="stylesheet" href="/themes/default/assets/css/theme.css?v=1447304405">
<script src="/themes/default/assets/js/jquery.min.js?v=1447306322"></script>
<script src="/themes/default/assets/js/bootstrap.min.js?v=1447306322"></script>
<!-- css -->
{Action::run('asset_folder', [['/assets/css/']])}
{Action::run('asset_file', ['/assets/css/hljs/zenburn.css'])}
<!-- /css -->
...
<!-- js -->
{Action::run('asset_folder', [['/assets/js/'], ['main']])}
{Action::run('asset_file', ['/assets/js/myasyncfile.js', 'async defer class="async-file"'])}
{Action::run('asset_file', ['/assets/js/main.js'])}
<!-- /js --><!-- css -->
<link rel="stylesheet" href="/themes/mytheme/assets/css/base.css?v=1447304405">
<link rel="stylesheet" href="/themes/mytheme/assets/css/main.css?v=1447306321">
<link rel="stylesheet" href="/themes/mytheme/assets/css/hljs/zenburn.css?v=1447306328">
<!-- /css -->
...
<!-- js -->
<script src="/themes/mytheme/assets/js/highlight.pack.js?v=1447306322"></script>
<script src="/themes/mytheme/assets/js/jquery.formstyler.min.js?v=1447306322"></script>
<script src="/themes/mytheme/assets/js/jquery.matchHeight-min.js?v=1447306322"></script>
<script src="/themes/mytheme/assets/js/myasyncfile.js?v=1447306322" async defer class="async-file"></script>
<script src="/themes/mytheme/assets/js/main.js?v=1447306523"></script>
<!-- /js -->