Skip to content

JavaScript used to insert UKYL website headers and footers into 3rd party sites.

Notifications You must be signed in to change notification settings

uklibraries/UKL_HeaderFooter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UKL_HeaderFooter

A configurable header and footer for use across University of Kentucky Libraries web properties

Usage

More details about how to structure the HTML for your website as well as more detailed explanations can be found here.

Implementation Overview

The current implementation works by taking in a number of configuration files found in /js/config/[...] and passing them as objects to the universalheader.js file. For customization, it's recommended to use CSS prefixes to avoid naming conflicts on host websites. There is also a system for fallback versions of the script, configurations for which can be found on branch cdn-fallback. Inline JavaScript is included for fallback behavior.

Section Naming

The header has 5 sections, that we've named from top to bottom.

  1. Emergency Messaging
  2. University Level Header
  3. Website Navigation
  4. Disruption Messaging
  5. Survey

CDN Usage

The CDN we've chosen is jsDelivr, an open source CDN with backing from Fastly and CloudFlare. We've chosen jsDelivr as a cost-saving measure, but its integrations with GitHub are also useful for our team. One additional note about usage, browser caching from jsDelivr is set to be a week from user usage. This was the primary reason the CDN was chosen as a fallback and not the primary provider. In case of changes to the backup, vendors must purge relevant links from the Purge Cache Tool if they wish changes to be reflected within 12 hours. A hard refresh from users is also required.

Production Script Locations

(https://lib.uky.edu/webparts/ukhdr/2024/js/universalHeader.js) (https://lib.uky.edu/webparts/ukhdr/2024/js/comboFooterShared.js) (https://lib.uky.edu/webparts/ukhdr/2024/css/global_header_footer.css)

Fallback CDN Links

https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@main/js/universalHeader.js https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@main/js/comboFooterShared.js https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@main/css/global_header_footer.css

Special Server Settings

lib.uky.edu is currently administered (current as of 07/25/24) by Jay Baker. Jay has set the http response headers for the ukhdr directory and subdirectories so that they have an immediate expiration to avoid browser caching.

Questions?

Please contact any of those listed on attributions below.

Attribution

Code co-authored by Eric Weig and Neal Powers with contributions by MLE Slone.

About

JavaScript used to insert UKYL website headers and footers into 3rd party sites.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •