Skip to content

Ontotext-AD/shared-assets-presentations

Repository files navigation

shared-assets-presentations

Shared CSS, JavaScript, SCSS theme, and Quarto/Reveal.js HTML fragments for Ontotext-style presentations.

Pinned CDN base (tag v1.0.0):

https://cdn.jsdelivr.net/gh/Ontotext-AD/shared-assets-presentations@v1.0.0

Sample background image: bkg-blue.jpg

Repository contents

File Purpose
ontotext.scss Reveal.js theme (must be used locally at render time)
quarto-revealjs-defaults.html Header fragment: CSS/JS with Subresource Integrity
quarto-revealjs-title-slide.html Footer fragment: title-slide behaviour
default.min.css, onto-hljs.css Code highlighting styles
graphql.js, ttl.js, sparql.js, pie.js, trySparql.js Language highlighters
bkg-blue.jpg Sample title-slide / background image

Using frontmatter in a Quarto + Reveal.js .qmd

Quarto has two different requirements:

  1. At render timetheme: and include-in-header: file: must point to local files (Quarto cannot fetch remote files for these keys).
  2. At view time — URLs inside the HTML fragments and in YAML metadata can point to this CDN.

Minimal project layout

my-talk/
  Slides.qmd
  ontotext.scss              # copy from this repo
  quarto-revealjs-defaults.html
  quarto-revealjs-title-slide.html

Recommended _metadata.yml (project or directory level)

from: gfm+autolink_bare_uris
format:
  revealjs:
    slide-number: c/t
    # SCSS must stay local — Quarto compiles it at render time
    theme: ontotext.scss
    embed-resources: false
    margin: 0
    width: 1600
    height: 900
    code-copy: true
    code-line-numbers: true
    scrollable: true
    auto-stretch: true
    # Remote CDN URLs are fine in YAML metadata (images, logo)
    background-image: https://cdn.jsdelivr.net/gh/Ontotext-AD/shared-assets-presentations@v1.0.0/bkg-blue.jpg
    background-size: cover
    background-opacity: 0.1
    # Local HTML fragments — content inside them references the CDN
    include-in-header:
      - file: quarto-revealjs-defaults.html
    include-after-body:
      - file: quarto-revealjs-title-slide.html
    title-slide-attributes:
      data-background-image: https://cdn.jsdelivr.net/gh/Ontotext-AD/shared-assets-presentations@v1.0.0/bkg-blue.jpg

Per-presentation overrides in Slides.qmd

YAML frontmatter at the top of a .qmd merges with _metadata.yml:

---
title: "My presentation"
author: "Your Name"
date: today
format:
  revealjs:
    width: 1920
    height: 1080
    title-slide-attributes:
      data-background-image: https://cdn.jsdelivr.net/gh/Ontotext-AD/shared-assets-presentations@v1.0.0/bkg-blue.jpg
---

Render

quarto render Slides.qmd --to revealjs

What each frontmatter block does

Key Local or remote Role
theme: Local Compiles ontotext.scss into Reveal.js theme CSS
include-in-header: file: Local file, remote URLs inside Injects shared CSS/JS (with SRI) into <head>
include-after-body: file: Local file Runs title-slide JavaScript after Reveal.js loads
background-image: Remote OK Deck background (parallax)
title-slide-attributes.data-background-image Remote OK Title slide background
logo: Remote OK Slide logo image URL

Pinning a CDN version

Prefer an immutable git tag or commit SHA instead of a moving branch:

https://cdn.jsdelivr.net/gh/Ontotext-AD/shared-assets-presentations@v1.0.0/onto-hljs.css
https://cdn.jsdelivr.net/gh/Ontotext-AD/shared-assets-presentations@<commit-sha>/onto-hljs.css

After upgrading assets, update:

  • URLs in quarto-revealjs-defaults.html
  • Subresource Integrity (integrity="sha384-…") hashes
  • Any background-image / logo URLs in your _metadata.yml

Regenerating SRI hashes

From this repository after changing a CSS/JS file:

python3 -c "
import base64, hashlib
from pathlib import Path
for name in ['default.min.css','onto-hljs.css','graphql.js','ttl.js','sparql.js','pie.js']:
    d = hashlib.sha384((Path(name)).read_bytes()).digest()
    print(name, 'sha384-' + base64.b64encode(d).decode())
"

License

Apache License 2.0 — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors