{"id":23473027,"url":"https://github.com/caltechlibrary/libguine","last_synced_at":"2025-04-13T05:49:56.349Z","repository":{"id":41149039,"uuid":"466222180","full_name":"caltechlibrary/libguine","owner":"caltechlibrary","description":"Caltech Library customizations for LibGuides CMS","archived":false,"fork":false,"pushed_at":"2025-04-09T23:43:26.000Z","size":577,"stargazers_count":3,"open_issues_count":8,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-13T05:49:51.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caltechlibrary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-03-04T17:59:56.000Z","updated_at":"2025-04-09T23:43:30.000Z","dependencies_parsed_at":"2023-11-21T19:27:50.970Z","dependency_job_id":"7ea2c033-d26c-44e3-bfc7-c85973d4349b","html_url":"https://github.com/caltechlibrary/libguine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Flibguine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Flibguine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Flibguine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Flibguine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caltechlibrary","download_url":"https://codeload.github.com/caltechlibrary/libguine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670501,"owners_count":21142901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-24T17:14:48.424Z","updated_at":"2025-04-13T05:49:56.326Z","avatar_url":"https://github.com/caltechlibrary.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caltech Library Customizations for LibGuides CMS\n\nWithin LibGuides CMS we can customize things like HTML headers and templates, CSS files, and jQuery/JavaScript code at the system, group, and guide level.\n\nWhile we cannot directly use the code from this repository with LibGuides, we still want to track our changes here to have a canonical version of the customizations for our site. The code stored here and/or any generated assets must be copied and pasted into various places within LibGuides that are appropriate for the specific snippets. This README file along with other inline comments will be the source for instructions on where to add code for our customizations.\n\n## Table of Contents\n\n- [GitHub Actions](#github-actions)\n- [CSS/SCSS](#cssscss)\n- [HTML](#html)\n  - [Templates \u0026 `\u003chead\u003e` Code](#templates--head-code)\n  - [Header \u0026 Footer Code](#header--footer-code)\n  - [Widget Code](#widget-code)\n- [JavaScript](#javascript)\n- [bootstrap/config.json](#bootstrapconfigjson)\n- [LibCal-based Notices](#libcal-based-notices)\n\n## GitHub Actions\n\nWe are using [GitHub Actions](https://docs.github.com/en/actions) to automate the compilation of CSS, HTML, and JavaScript artifacts and their deployment to LibGuides CMS.\n\nMost commonly, the workflow is triggered when a relevant source file is committed and pushed to this repository. Additionally, an individual file may be recompiled and redeployed by manually running the [Deploy Components workflow](https://github.com/caltechlibrary/libguine/actions/workflows/deploy.yml) with the filename specified as an input parameter.\n\nSee [`ACTIONS.md`](https://github.com/caltechlibrary/libguine/blob/main/ACTIONS.md) for details.\n\n## CSS/SCSS\n\nThe CSS for the site is written with the [SCSS syntax of Sass](https://sass-lang.com/documentation/syntax#scss). It cannot be directly pasted anywhere that CSS is expected. When an `scss` file is modified, committed, and pushed to this repositiory, the compiled `libguides.css` file will be downloadable as part of the artifacts produced during the GitHub Actions workflow run. Additionally, the updated `libguides.css` file will be uploaded to LibGuides automatically.\n\n## HTML\n\nNote: Most HTML files have a comment header which includes a Last Modified date/time that can be updated automatically with the [Auto Time Stamp](https://github.com/lpubsppop01/vscode-auto-timestamp) extension for Visual Studio Code.\n\n### Templates \u0026 `\u003chead\u003e` Code\n\nThe contents of any of the template files in this repository can be pasted directly into LibGuides. The GitHub Actions workflow will automatically update any existing templates within LibGuides, provided they already exist. Automatic creation of new templates has not been implemented.\n\nThe contents of the [`head--system.html`](https://github.com/caltechlibrary/libguine/blob/main/head--system.html) file can be pasted directly into LibGuides, as well. The GitHub Actions workflow will automatically update modified systemwide `\u003chead\u003e` code within LibGuides. Currently, the workflow will not support custom `\u003chead\u003e` code for a specific Group.\n\n### Header \u0026 Footer Code\n\nHTML code for the header and footer sections of the site is compiled from multiple snippets in an attempt to adhere to [the DRY principle](https://en.wikipedia.org/wiki/Don't_repeat_yourself).\n\nCurrently, we enter code into the systemwide header and footer sections, as well as the group header and footer sections for Archives \u0026 Special Collections.\n\nThe GitHub Action workflow scripts identify which header and/or footer files have been modified and paste the correct compiled HTML into the appropriate places in LibGuides.\n\n### Widget Code\n\nCode for widgets can be created and updated through this repository and GitHub Actions.\n\nName the widget code file starting with `widget--` followed by a unique name and the `.html` extension. See [`widget--notices-library-4hoj8pnB.html`](https://github.com/caltechlibrary/libguine/blob/main/widget--notices-library-4hoj8pnB.html) as an example. Appending a [randomly generated string](https://www.random.org/strings/?num=1\u0026len=8\u0026digits=on\u0026upperalpha=on\u0026loweralpha=on\u0026unique=on\u0026format=html\u0026rnd=new) to the end of the name will help ensure uniqueness.\n\nSee [`.github/workflows/compile.py`](https://github.com/caltechlibrary/libguine/blob/main/.github/workflows/compile.py) and [`.github/workflows/deploy.py`](https://github.com/caltechlibrary/libguine/blob/main/.github/workflows/deploy.py) and the conditions related to widgets.\n\n## JavaScript\n\nThe [`libguides.js`](https://github.com/caltechlibrary/libguine/blob/main/libguides.js) file can be uploaded directly into LibGuides. The GitHub Actions workflow will automatically upload a modified custom JavaScript file to LibGuides.\n\n## [bootstrap/config.json](https://github.com/caltechlibrary/libguine/blob/main/bootstrap/config.json)\n\nCustom Bootstrap 3 configuration file that can be uploaded on their [Customize and download](https://getbootstrap.com/docs/3.4/customize/) page to generate a full build of Bootstrap 3 with custom global settings.\n\nSome of the overrides for our site are much more easily accomplished if we change the default settings at the Bootstrap level.\n\nThe `bootstrap.min.css` and `bootstrap.min.js` that are downloaded from the custom build site should be uploaded on the “Custom JS/CSS” tab of the Admin ➜ Look \u0026 Feel section of LibGuides in the “Upload Customization Files” section.\n\n**NOTE:** There is a namespace conflict between the Bootstrap `tooltip()` function and the jQuery UI `tooltip()` function. Paste the following code that renames the Bootstrap function (and enables tooltips) at the end of the `bootstrap.min.js` file before uploading to LibGuides.\n\n```javascript\nvar bsTooltip = $.fn.tooltip.noConflict();\n$.fn.bs_tooltip = bsTooltip;\n$(function() {\n  $('[data-toggle=\"tooltip\"]').bs_tooltip()\n});\n```\n\n## LibCal-based Notices\n\nIn order to display temporal alert notices on the homepage we use a LibCal calendar and transform its RSS feed into HTML fragments that are pulled onto the page via a custom JavaScript widget. We needed to use this workflow to both overcome LibGuides aggressive caching of RSS feeds and to avoid CORS issues when trying to manipulate the feed directly with JavaScript.\n\nA `LIBCAL_RSS_NOTICES_TODAY_URL` repository secret is required to store the URL for the calendar *day* feed. The URL is typically in the form of `https://libcal.caltech.edu/rss.php?cid=#️⃣\u0026m=day` where the #️⃣ symbol stands for the numeric calendar ID.\n\nWe have created both a [Library notices widget](https://github.com/caltechlibrary/libguine/blob/main/widget--notices-library-4hoj8pnB.html) and an [Archives notices widget](https://github.com/caltechlibrary/libguine/blob/main/widget--notices-archives-YwAWE98Z.html) that will insert the fragments where needed. (To add these widgets in a LibGuides box, select Media / Widget, then the Reuse Existing Widget tab, and finally search for the unique widget name.)\n\nThe [Widget Code deployment workflow](#widget-code) can create and update this code in the site.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechlibrary%2Flibguine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaltechlibrary%2Flibguine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechlibrary%2Flibguine/lists"}