quarto-ext / lightbox

Create lightbox treatments for images in your HTML documents.
https://quarto-ext.github.io/lightbox/
MIT License
76 stars 4 forks source link

Help with running GitHub actions? #16

Closed rsenft1 closed 2 years ago

rsenft1 commented 2 years ago

I'm getting this error when trying to deploy my website that uses lightbox via GitHub action:

Error running filter _extensions/quarto-ext/lightbox/lightbox.lua:
_extensions/quarto-ext/lightbox/lightbox.lua:113: attempt to call a nil value (field 'is_format')

Any suggestions? I can seen lightbox if I run quarto list extensions in the action, but something appears to be wrong. Do I have to activate the extensions somehow?

rsenft1 commented 2 years ago

It seems like locally, my document does have an is_format method, but not when using the GH action. I also had this problem when I first installed the extension, though reinstalling and updating quarto seemed to fix it. The page I'm using lightbox on does have a format:

format: 
  html:
    page-layout: full
    smooth-scroll: true

So I'm unsure why it's complaining.

rsenft1 commented 2 years ago

I believe this might have to do with quarto version used. On my local machine, I have 1.2.256, but the action will install quarto-1.1.251 even if I try to specify 1.2.256 (probably because it's a release candidate?). Potentially the problem will be fixed once quarto is updated. Unsure of if there's anything I can do on my end to be more explicit about doc format in the meantime.

dragonstyle commented 2 years ago

The issue is related to the Quarto version (your observations are correct) - you need to be using Quarto 1.2 builds (as this extension is calling APIs that are only supported starting in 1.2). Using the Github Action, you can control what version of Quarto is setup, including using a specific version or the latest pre-release build like so:

  steps:
    - uses: quarto-dev/quarto-actions/setup@v2
      with:
        version: pre-release

More here https://github.com/quarto-dev/quarto-actions/tree/main/setup#inputs-available

rsenft1 commented 2 years ago

Perfect, thanks! I had the right idea but was putting version in the wrong step (checkout vs. setup quarto). Works great now!