# ------------------------------------------------------------------------------ # ~/_data/resources/resources.yml # Configuration data to specify ALL the resources used by a site|layout # # Product/Info: # https://jekyll.one # # Copyright (C) 2023 Juergen Adams # # J1 Theme is licensed under the MIT License. # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md # ------------------------------------------------------------------------------ # NOTE: # By J1 Theme, "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 # See: https://javascript.info/script-async-defer # ------------------------------------------------------------------------------ # GLOBALS # ------------------------------------------------------------------------------ # # THE GLOBALS sequence (array) contains general parameters used for # ALL resource definitions # # base_url # ------------------------------------------------------------------------------ # For J1 Theme, 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 Theme, 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: async|defer|empty # default: defer # # 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: cmments on YOUR_RESOURCE_NAME # region: head|body-footer # layout: [ layout_name(s)|all ] # required: always|ondemand # preload: false|true # 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 dependency_check_cycle: 25 dependency_check_timeout: 50 extensions: css_dev: css css_prod: min.css js_dev: js js_prod: min.js # ------------------------------------------------------------------------------ # RESOURCE configuration settings # resources: # ============================================================================ # J1 Resources loaded ALWAYS, script_load set to CLASSIC (empty) # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # J1 Core, Main CSS styles and JS API for J1 Theme # # NOTE Theme CSS loaded via module 'themer' # NOTE: load always 'unolight' as a 'bese' (e.g. for unodark, but should be removed) # - name: J1 Theme Core resource: enabled: true id: core comment: Module J1 Theme Core region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: true data: css: [ core/css/themes/unolight/bootstrap, core/css/icon-fonts/mdib, core/css/vendor ] files: [ adapter/js/j1.js ] js: [ modules/jquery/js/jquery, modules/jquery/js/extensions/hasClass, modules/jquery/js/extensions/removeClass, modules/popper/js/popper, core/js/template ] init_function: [ j1.init ] # ---------------------------------------------------------------------------- # Speak2Me # Speech synthesis (TTS) # - name: speak2me resource: enabled: true id: speak2me comment: Module speak2me region: head layout: [ all ] required: always preload: false script_load: defer dependencies: false pass_init_data: true data: css: [] files: [ adapter/js/speak2me.js ] js: [] init_function: [ j1.adapter.speak2me.init ] # ---------------------------------------------------------------------------- # Bootstrap JS v5.3.0 # # See: https://getbootstrap.com/docs/5.0/getting-started/introduction/ # - name: Bootstrap JS resource: enabled: true id: bs5 comment: Module Bootstrap JS region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [] js: [ modules/bootstrap/js/bootstrap ] init_function: [] # ---------------------------------------------------------------------------- # Bootstrap Material Design (BMD), responsive UI framework for Bootstrap # # See: https://github.com/mdbootstrap/bootstrap-material-design/tree/4.1.3 # - name: BMD resource: enabled: true id: bmd comment: Module BMD region: head layout: [ all ] required: ondemand preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/bmd.js ] js: [ modules/bmd/js/bmd ] init_function: [ j1.adapter.bmd.init ] # ---------------------------------------------------------------------------- # Google Analytics OptIn, a browser library to opt-in in Google Analytics # # See: https://github.com/luciomartinez/gtag-opt-in # - name: GA OptIn resource: enabled: true id: ga-opt-in comment: Module GA OptIn region: head layout: [ all ] required: always preload: false script_load: defer dependencies: false pass_init_data: false data: css: [] files: [] js: [ modules/gtag-opt-in/js/gtag-opt-in ] init_function: [] # ---------------------------------------------------------------------------- # J1 Logger, JS API for all logs used by J1 Theme based on the # log4j implementation for JS (log4javascript) # # See: http://log4javascript.org # - name: J1 Logger resource: enabled: true id: logger comment: Module J1 Logger region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/logger.js ] js: [ modules/log4javascript/js/log4javascript ] init_function: [ j1.adapter.logger.init ] # ---------------------------------------------------------------------------- # Backstretch, JS API to add responsive image|video content # to J1 Top Headers # # See: https://github.com/jquery-backstretch/jquery-backstretch # - name: Backstretch resource: enabled: true id: backstretch comment: Module Backstretch region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [] js: [ modules/backstretch/js/backstretch ] init_function: [] # ---------------------------------------------------------------------------- # Top Header, JS implementaion to create top headers for J1 Theme # based on the JS API jQuery Backstretch # # See: https://github.com/jquery-backstretch/jquery-backstretch # - name: J1 Attic resource: enabled: true id: attic comment: Module Attic region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: true data: css: [] files: [ adapter/js/attic.js ] js: [] init_function: [ j1.adapter.attic.init ] # ---------------------------------------------------------------------------- # Navigator, JS API to create the naviagtion for J1 Theme # based on the (BS3) JS implementaion of Bootsnav. # # See: https://github.com/adamnurdin01/bootsnav # - name: J1 Navigator resource: enabled: true id: navigator comment: Module Navigator region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/navigator.js ] js: [] init_function: [ j1.adapter.navigator.init ] # ---------------------------------------------------------------------------- # Mobile Menu (Light), JS API to create TOCs for mobile devices # # See: https://github.com/FrDH/mmenu-light # - name: MMenu resource: enabled: true id: mmenu comment: Module MMenu region: head layout: [ all ] required: always preload: false script_load: defer dependencies: false pass_init_data: false data: css: [ modules/mmenuLight/css/mmenu-light, modules/mmenuLight/css/theme/uno/mmenu ] files: [ adapter/js/mmenu.js ] js: [ modules/mmenuLight/js/mmenu ] init_function: [ j1.adapter.mmenu.init ] # ---------------------------------------------------------------------------- # Themer, JS implementation to integrate themes from Bootswatch # based on the bootstrapThemeSwitcher API # # See: https://github.com/jguadagno/bootstrapThemeSwitcher # - name: J1 Themer resource: enabled: true id: themer comment: Module Themer region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/themer.js ] js: [] init_function: [ j1.adapter.themer.init ] # ---------------------------------------------------------------------------- # Toccer, JS implementation to create TOCs from HTML headline elements # based on Tocbot API # # See: https://github.com/tscanlin/tocbot # - name: J1 Toccer resource: enabled: true id: toccer comment: Module Toccer layout: [ page, post, collection, blog_archive ] region: head required: always preload: false script_load: dependencies: false pass_init_data: true data: css: [] files: [ adapter/js/toccer.js ] js: [] init_function: [ j1.adapter.toccer.init ] # ---------------------------------------------------------------------------- # CookieConsent, JS API to create GDPR compatible cookie consent based # on bootstrap-cookie-banner JS API # # See: https://github.com/shaack/bootstrap-cookie-banner # - name: J1 CookieConsent resource: enabled: true id: cookieConsent comment: Module J1 CookieConsent region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/cookieConsent.js ] js: [ modules/cookieConsent/js/cookieConsent ] init_function: [ j1.adapter.cookieConsent.init ] # ---------------------------------------------------------------------------- # lunr search engine, JS API used for the QuickSearch feature # of J1 Theme based on the Lunr JS API # # See: https://lunrjs.com/ # - name: Lunr resource: enabled: true id: lunr comment: Module Lunr region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [ modules/lunr/css/j1 ] files: [ adapter/js/lunr.js ] js: [ modules/lunr/js/lunr, modules/lunr/js/mustache, modules/lunr/js/dateformat, modules/lunr/js/uri, modules/lunr/js/j1 ] init_function: [ j1.adapter.lunr.init ] # ---------------------------------------------------------------------------- # Floating Action Buttons, JS API to create FABs # - name: J1 Floating Action Buttons resource: enabled: true id: fab comment: Module J1 Floating Action Buttons region: head layout: [ all ] required: always preload: false script_load: defer dependencies: false pass_init_data: true data: css: [] # styles moved to Template CSS files: [ adapter/js/fab.js ] js: [ modules/fab/js/cash, # adapted|old (1.3.5) version from Materialize modules/fab/js/fab # modified version for J1 (former: button.js) ] init_function: [ j1.adapter.fab.init ] # ---------------------------------------------------------------------------- # jQueryUI, curated set of user interface interactions, effects, widgets, # and themes built on top of jQuery # # See: https://jqueryui.com/ # - name: jQueryUI resource: enabled: false id: jquery-ui comment: Module jQueryUI region: head layout: [ all ] required: ondemand preload: false script_load: dependencies: false pass_init_data: false data: css: [ modules/jquery/css/jquery-ui/jquery-ui, modules/jquery/css/jquery-ui/jquery-ui.theme ] files: [] js: [ modules/jquery/js/jquery-ui ] init_function: [] # ---------------------------------------------------------------------------- # Theme Switcher, JS API for switching Bootstrap Themes (Bootswatch) # # See: https://bootswatch.com/ # - name: themeSwitcher resource: enabled: true id: theme_switcher comment: Module Theme Switcher region: head layout: [ all ] required: always preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [] js: [ modules/themeSwitcher/js/switcher ] init_function: [] # ---------------------------------------------------------------------------- # Responsive Tables, JS implementation to create responsive HTML tables # based on the JS API Tablesaw # # See: https://github.com/filamentgroup/tablesaw # - name: J1 Responsive Tables resource: enabled: true id: rtable comment: Module J1 Responsive Tables region: head layout: [ all ] required: always script_load: defer script_load: dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/rtable.js ] js: [ modules/rtable/js/rtable ] init_function: [ j1.adapter.rtable.init ] # ---------------------------------------------------------------------------- # J1 Asciidoctor, JS functions to (dynamically) modify Asciidoctor HTML elements # - name: J1 Asciidoctor resource: enabled: true id: asciidoctor comment: Module J1 Asciidoctor region: head layout: [ home, page, post, collection, blog_archive, app ] required: always preload: false script_load: defer dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/asciidoctor.js ] js: [] init_function: [ j1.adapter.asciidoctor.init ] # ---------------------------------------------------------------------------- # rtextResizer (currently NOT used) # - name: J1 RText Resizer resource: enabled: false id: rtextresizer comment: Module J1 RText Resizer region: head layout: [ home, page, post, collection, blog_archive ] required: always # always | ondemand preload: false script_load: dependencies: false pass_init_data: false data: css: [] files: [ adapter/js/rtextResizer.js ] js: [] init_function: [ j1.adapter.rtextResizer.init ] # ---------------------------------------------------------------------------- # MsDropdowns, JS implementation to create themeable HTML