# ------------------------------------------------------------------------------ # ~/_data/resources/resources.yml # Configuration data to specify ALL the resources used by a site|layout # # Product/Info: # https://jekyll-one.com # # Copyright (C) 2019 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one/j1_template_mde/blob/master/LICENSE # ------------------------------------------------------------------------------ # NOTE: # By J1 template, "Liquid Procedures" are being used intensively. To load # HTML data for a layout, the loader procedure places the data based this # YAML data file into the REGION specified with a LANE. # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ # RESOURCE configuration settings for SYNCHRONOUS (sync) and # ASYNCHRONOUS (async|defer) LOAD for all LAYOUTS and (content) PAGES # ------------------------------------------------------------------------------ # GLOBALS # ------------------------------------------------------------------------------ # # THE GLOBALS sequence (array) contains general parameters used for # ALL resource definitions # # base_url # ------------------------------------------------------------------------------ # For J1 template, all CSS and JS resources are stored as ASSETS # under ~/assets/themes/j1. To shorten the filenames to be configured, # base_url points to the (base) asset path. # # type: string # default: /assets/themes/j1 # # extensions # ------------------------------------------------------------------------------ # For CSS and JS resources, >>NO<< extention (.css|.js) are given # for CSS and JS files configured with a RESOURCE. EXTENSIONS for # CSS|JS resources are calculated AUTOMATICALLY based on the MODE # (development|production) detected for a BUILD. # # defaults # ------------------------------------------------------------------------------ # css_dev: css # css_prod: min.css # js_dev: js # js_prod: min.js # # location # ------------------------------------------------------------------------------ # For J1 template, resources can be loaded from LOCAL assets folder # (~/assets/themes/j1) OR from REMOTE using e.g. a CDN. Resources # are written as LOCATORS, simple JSON objects consists in two # key|value pairs. The keys are "local" or "remote" to indicate # from which SOURCE a resource should be loaded from. The value # each key specifies the respective source. # # The PARAMETER location specifies the PREFERRED method to load a # resource. If the location is set to (preferred) REMOTE but NO # key|value pair is given for REMOTE, the VALUE from key LOCAL is # taken as a FALLBACK. If NO key LOCAL is available, loading the # resource will FAIL. # # Example: # # [ # { local: "framework/jquery/base/jquery-3.2.1", # remote: "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery" # }, # { local: "framework/jquery/cookie/js/cookie-1.4.1", # remote: "https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie" # }, # ... # ] # # # NOTE: # The key|value pair for LOCAL should ALWAYS specified, respectively # ALL resources should be available locally at least. This allows to # run a website from local with NO internet access e.g for home or privat # use. # # NOTE: # To load resources from REMOTE, access to the INTERNET is needed. # # type: string (local|remote) # default: local # # ------------------------------------------------------------------------------ # RESOURCES # ------------------------------------------------------------------------------ # # THE RESOURCES sequence (array) contains collections of configuration # parameters EACH resource for a specific LAYOUT and|or PAGE. # # resource # ------------------------------------------------------------------------------ # The resource collection (data group) contains multiple sequences # (arrays) and mappings (hashes) that DEFINES a SET of HTML # components to be loaded. # # enabled # ------------------------------------------------------------------------------ # Enables|Disables the use of a resource # # type: boolean # values: true|false # default: true # # id # ------------------------------------------------------------------------------ # Specifies the ID of a ressoure. # # type: string # default: "" # # comment # ------------------------------------------------------------------------------ # Specifies a comment TEXT displayed with the browser console # if a resource has been loaded. ADDITIONALY the comment is # used for commenting the generated HTML markup for easier # (post mortem) code analysis. # # type: string # default: "" # # region # ------------------------------------------------------------------------------ # Specifies the REGION the resources is being loaded # # For LOAD optimization (or suppport of older BROWSERS that # does NOT support async|defer load strategies) MODULES # (resources that defines css AND js|initializer) can be # loaded at the END of the BODY section (REGION body-footer). # # For resources loaded DEFER, placing that code with the # REGION "body-footer" might be an option for load OPTIMIZATION. # # By default, ALL resources are loaded with the HEAD section # (REGION head) assuming modern browsers managing script # loading strategies for SYNC and DEFER. # # type: string # values: head|body-footer # default: head # # layout # ------------------------------------------------------------------------------ # Specifies the LAYOUT the resources is loaded # # type: sequence (array) # values: home|page|post|app|all # default: [] # # required # ------------------------------------------------------------------------------ # Specifies if a resource is REQUIRED (loaded) for EVERY page # (always) or loaded on ondemand only (ondemand). If a resource is # configured to be loaded on ondemand, the resource (load) needs # to be ENABLED with the FRONTMATTER of the (content) PAGE by # setting the resource ID with RESOURCES sequence (array): # # --- # ... # resources: [ ID, .. ,ID ] # ... # --- # # NOTE: # Resources like MODULES (e.g lightboxes, galleries) are NOT # needed for each and every (content) page. To reduce the amount # of data (CSS|JS files) loaded by a page, MODULES should loaded # (and initialized) on ondemand. # # type: string # values: always|ondemand # default: always # # script_load # ------------------------------------------------------------------------------ # Specifies HOW a js resource (script) is loaded by the # BROWSER # # type: string # values: sync|async|defer # default: sync # # NOTE: # Modern web browsers support the ASYNC and DEFER attributes # on JS|SCRIPTS. These attributes instructs the browser it # is safe to CONTINUE parsing (the HTML code) while the scripts # are being DOWNLOADED. # # Scripts with the ASYNC attribute are executed ASYCHRONOUSLY. # This means the script is EXECUTED as soon as it is DOWNLOADED # without BLOCKING the browser for processing in meantime. # # Scripts with the DEFER attribute are EXECUTED in ORDER (i.e. # first script 1, then script 2). This also does no BLOCKING # the browser. Unlike ASYNC scripts, DEFER scripts are only # executed AFTER the ENTIRE document has been loaded. # # pass_init_data # ------------------------------------------------------------------------------ # For default, init parameters are passed to J1 Adapters. This # may cause issues for some resources NOT using an J1 Adapter. # Set to false, if the (native) initializer of a resource should # NOT get any template specific parameters at startup. # # type: boolean # values: true|false # default: true # # data # ------------------------------------------------------------------------------ # Specifies FONT, CSS or JS resource files to be loaded # # NOTE: # >>NO<< .css or .js extention should be given with DATA for # CSS and JS files as they are calculated automatically based # on the mode (development|production) detected for a BUILD. # It is recommended to load Javascript and CSS files using data # type js and css if possible. # # files # ---------------------------------------------------------------------------- # Specifies general file resources the module depends on. # # Ressources for fonts js and css shoud be loaded as FILES # if NO extension is avaiable (e.g. fonts) or ONLY minified # versions (e.g. js files from commercial products) are # available. # # type: sequence (array) # values: JSON object for local|remote resources # default: [] # # css # ---------------------------------------------------------------------------- # Specifies CSS resources (NO .css extention) the module # depends on. # # type: sequence (array) # values: JSON object for local|remote CSS resources # default: [] # # js # ---------------------------------------------------------------------------- # Specifies JAVASCRIPT resources (NO .js extention) the # module depends on. # # type: sequence (array) # values: JSON object for local|remote JS resources # default: [] # # init_function # ---------------------------------------------------------------------------- # Specifies the name of the (J1|Module) initializer # function to be started on document-ready (event). # # type: string # values: name # default: "" # # ------------------------------------------------------------------------------ # Resource SKELETON # ------------------------------------------------------------------------------ # # # --------------------------------------------------------------------------- # # RESOURCE description # - resource: # enabled: true|false # id: resource_id # comment: Resources for YOUR_RESOURCE_NAME # region: head|body-footer # layout: [ layout_name(s)|all ] # required: always|ondemand # script_load: sync|defer|async # pass_init_data: true|false # data: # # css: [ # { local: "path/to/1/css_file", # remote: "URL 1st css_file" # }, # { local: "path/to/2/css_file", # remote: "URL 2nd css_file" # }, # ... # ] # files: [ # "path/to/1/file.ext", # "path/to/2/file.ext", # ... # ] # js: [ # { local: "path/to/1/js_file", # remote: "URL 1st js_file" # }, # { local: "path/to/2/js_file", # remote: "URL 2nd js_file" # }, # ... # ] # init_function: [ # INITIALIZER_NAME.INIT_METHOD_NAME, # INITIALIZER_NAME.INIT_METHOD_NAME, # ... # ] # # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ # GLOBAL configuration settings # globals: base_path: /assets/themes/j1 location: local extensions: css_dev: css css_prod: min.css js_dev: js js_prod: min.js # ------------------------------------------------------------------------------ # RESOURCE configuration settings # resources: # ============================================================================== # J1 Core Resources loaded SYCHRONOUSLY # ------------------------------------------------------------------------------ # ---------------------------------------------------------------------------- # J1 Template Core, integrated JS Resources # # no ressource id module_name@version # -------------------------------------------------------------------------- # 1 n/a jquery@3.2.1 # 2 n/a popper@1.12.9 # 3 n/a jquery-mousewheel@3.1.13 # 4 n/a nouislider@10.0.0 # 5 n/a js-cookie@2.2.0 # 6 n/a moment@2.19.2 # 7 log4javascript log4javascript@1.4.15 # 8 clipboard clipboard@1.7.1 # 9 smoothscroll smoothscroll-for-websites@1.4.6 # 10 bs_material_design bootstrap-material-design@4.0.0-beta.4 # 11 j1_template_4 j1_template_4@0.0.1 # 12 tocbot tocbot@3.0.2 # 13 jekyll_search simple_jekyll_search@1.1.5 # 14 back2top back2top@1.1 # 15 bs_theme_switcher bs_theme_switcher@1.1.5 # 16 backstretch backstretch@2.1.16 # 17 cookiebar cookiebar@2015-07-24 # 18 bootstrap_datepicker datepicker@1.7.1 # 19 bs_gallery bs_gallery@2017-12-27 # # ---------------------------------------------------------------------------- # J1 Template Core, integrated CSS Resources # See: _sass/readme.txt # ---------------------------------------------------------------------------- # - resource: id: core comment: Core Resources used by J1 Template region: head layout: all required: always script_load: sync data: css: [ { local: "core/css/vendor", remote: "" } ] files: [ core/js/adapter/template.js, core/js/adapter/back2top.js, core/js/adapter/cookiebar.js, core/js/adapter/logger.js, core/js/adapter/scroller.js, core/js/adapter/searcher.js, core/js/adapter/switcher.js ] js: [ { local: "core/js/template", remote: "" } ] init_function: [ j1.init, j1.Back2Top.init, j1.CookieBar.init, j1.Logger.init, j1.Scroller.init, j1.Searcher.init, j1.Switcher.init ] # ---------------------------------------------------------------------------- # J1 Master Header # - resource: enabled: true id: masthead comment: Resources used by Master Header region: head layout: all required: always script_load: sync data: files: core/js/adapter/master_header.js init_function: j1.MastHead.init # ---------------------------------------------------------------------------- # J1 Navigator # - resource: enabled: true id: navigator comment: Resources used by Navigator region: head layout: all required: always script_load: sync data: files: core/js/adapter/navigator.js init_function: j1.Navigator.init # ---------------------------------------------------------------------------- # J1 Toccer # - resource: enabled: true id: toccer comment: Resources used by Toccer layout: [ page, post, collection, blog_archive ] region: head required: always script_load: defer data: files: core/js/adapter/toccer.js init_function: j1.Toccer.init # ---------------------------------------------------------------------------- # J1 iFrame Resizer # - resource: enabled: true id: iframer comment: Resources used by iFramer layout: [ page, post, app ] region: head required: ondemand script_load: defer data: files: core/js/adapter/iframer.js init_function: j1.IFramer.init # ---------------------------------------------------------------------------- # J1 Bootstrap Gallery # - resource: enabled: true id: bs_gallery comment: Resources used by Bootstrap Gallery layout: [ page, post, app ] region: head required: ondemand script_load: defer data: files: core/js/adapter/bs_gallery.js init_function: j1.BsGallery.init # ---------------------------------------------------------------------------- # J1 Lightbox (Lightbox V2) # - resource: enabled: true id: lightbox comment: Resources used by Lightbox V2 layout: [ page, post, app ] region: head required: ondemand script_load: defer data: files: core/js/adapter/lightbox.js init_function: j1.Lightbox.init # ============================================================================== # Additional Apps and Modules - loaded SYCHRONOUSLY (sync) # ------------------------------------------------------------------------------ # ---------------------------------------------------------------------------- # Rouge (Highlighter) # - resource: enabled: true id: rouge comment: Theme CSS resources used by Rouge region: head layout: all required: always script_load: sync data: files: extensions/rouge/css/base16/theme.css # ---------------------------------------------------------------------------- # Stickyfill (CSS polyfill, https://github.com/wilddeer/stickyfill) # - resource: enabled: true id: stickyfill comment: Polyfill for CSS position sticky region: head layout: all required: always script_load: sync data: files: extensions/stickyfill/js/stickyfill.js # ---------------------------------------------------------------------------- # Alogolia # - resource: enabled: true id: algolia comment: Resources used by Algolia Instantsearch region: head layout: [ page, post, app ] required: ondemand script_load: sync data: files: [ core/js/adapter/algolia.js, "https://cdn.jsdelivr.net/npm/instantsearch.js@2.6.0/dist/instantsearch-theme-algolia.min.css", "https://cdn.jsdelivr.net/npm/instantsearch.js@2.6.0/dist/instantsearch.min.css", "https://cdn.jsdelivr.net/npm/instantsearch.js@2.6.0/dist/instantsearch.min.js" ] init_function: j1.Algolia.init # ---------------------------------------------------------------------------- # Livereload # - resource: enabled: false id: livereload comment: JS Client for livereload region: head layout: all required: always script_load: sync data: files: extensions/livereload/js/livereload.js # ============================================================================== # Additional Apps and Modules - loaded ASYCHRONOUSLY (defer) # ------------------------------------------------------------------------------ # ---------------------------------------------------------------------------- # J1 LightGallery (Lightbox used by Bootstrap Gallery|Justified Gallery) # - resource: enabled: true id: light_gallery comment: Resources used by LightGallery region: head layout: [ home, page, post, raw, collection ] required: ondemand script_load: defer data: files: [ extensions/light_gallery/css/lightgallery.css, extensions/light_gallery/css/theme/uno.css, extensions/light_gallery/css/lg-transitions.css, extensions/light_gallery/css/lg-fb-comment-box.css, extensions/light_gallery/js/lightgallery.js, extensions/light_gallery/js/lg-autoplay.js, extensions/light_gallery/js/lg-fullscreen.js, extensions/light_gallery/js/lg-hash.js, extensions/light_gallery/js/lg-pager.js, extensions/light_gallery/js/lg-share.js, extensions/light_gallery/js/lg-thumbnail.js, extensions/light_gallery/js/lg-video.js, extensions/light_gallery/js/lg-zoom.js, extensions/videojs/js/video.4.12.15.min.js, extensions/videojs/css/video-js.4.12.15.min.css, extensions/vimeo_player/js/froogaloop2.min.js ] # ---------------------------------------------------------------------------- # J1 Slider # - resource: enabled: true id: carousel comment: Resources used by J1 Carousel region: head layout: [ home, page, post, collection ] required: ondemand script_load: defer data: files: [ extensions/carousel/css/carousel.css, extensions/carousel/css/carousel_transitions.css, extensions/carousel/css/theme/uno.css, extensions/carousel/js/j1_adapter_carousel.js, extensions/carousel/js/carousel.js ] init_function: j1.Carousel.init # ---------------------------------------------------------------------------- # J1 Justified Gallery # - resource: enabled: true id: justified_gallery comment: Resources used by Justified Gallery region: head layout: [ home, page, post, raw, collection ] required: ondemand script_load: defer data: files: [ extensions/justified_gallery/css/justifiedGallery.css, extensions/justified_gallery/css/theme/uno.css, extensions/justified_gallery/js/justifiedGallery.js, extensions/justified_gallery/js/j1_adapter_justified_gallery.js ] init_function: j1.JustifiedGallery.init # ---------------------------------------------------------------------------- # DataTables # - resource: enabled: true id: data_tables comment: Resources used by DataTables layout: [ page, post, collections ] region: head required: ondemand script_load: defer data: css: [ { local: "extensions/datatables/css/datatables", remote: "https://cdn.datatables.net/v/jszip-3.1.3/pdfmake-0.1.27/dt-1.10.15/af-2.2.0/b-1.3.1/b-colvis-1.3.1/b-html5-1.3.1/b-print-1.3.1/cr-1.3.3/fc-3.2.2/fh-3.1.2/kt-2.2.1/r-2.1.1/rg-1.0.0/rr-1.2.0/sc-1.4.2/se-1.2.2/datatables" } ] files: "extensions/datatables/css/theme/uno.css" js: [ { local: "extensions/datatables/js/datatables", remote: "https://cdn.datatables.net/v/jszip-3.1.3/pdfmake-0.1.27/dt-1.10.15/af-2.2.0/b-1.3.1/b-colvis-1.3.1/b-html5-1.3.1/b-print-1.3.1/cr-1.3.3/fc-3.2.2/fh-3.1.2/kt-2.2.1/r-2.1.1/rg-1.0.0/rr-1.2.0/sc-1.4.2/se-1.2.2/datatables" } ]