jlumbroso/Hugo Canvas Sync

Scan a Hugo site for canvas-file shortcodes, upload new/changed files to Canvas LMS, commit canvas_urls.json, and optionally run a second Hugo build so authenticated Canvas URLs are baked into the deployment.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
canvas_api_urlCanvas API base URL (e.g. https://canvas.upenn.edu). Store as a GitHub secret.yes
canvas_api_keyCanvas API token. Create one in Canvas → Account → Settings → Approved Integrations → New Access Token. Store as a GitHub secret. yes
canvas_course_idInteger ID of the Canvas course (from the Canvas course URL: /courses/<id>).yes
hugo_rootPath to the Hugo site root (relative to the repo root).no.
data_filePath to canvas_urls.json relative to hugo_root. This file is committed so Canvas URLs persist between builds. nodata/canvas_urls.json
persistence_strategyHow canvas_urls.json is persisted between CI runs. "main" — commit the file to the current branch (simplest; O(1) git noise) "branch" — commit to a dedicated branch (clean main history; sparse-checkout required) "cache" — GitHub Actions cache only (no git noise; lost on cache eviction → safe re-upload) Recommendation: start with "main". Use "branch" if you want zero commits on your primary branch. nomain
canvas_data_branchBranch name for the "branch" persistence strategy.nocanvas-data
auto_commitAutomatically commit and push canvas_urls.json after sync. Requires permissions: contents: write in the calling workflow. notrue
run_hugo_rebuildRun a second `hugo` build after the sync so Canvas URLs are injected into the final site. Set to "false" if you want to run hugo yourself. notrue
hugo_build_flagsFlags passed to `hugo` for the second build.no--gc --minify
hugo_environmentHugo environment for the second build (sets hugo.Environment).noproduction
install_hugoInstall Hugo automatically using peaceiris/actions-hugo before the rebuild. Set to "true" for zero-config; leave "false" if you install Hugo yourself. nofalse
hugo_versionHugo version to install when install_hugo is "true".nolatest
hugo_binaryAbsolute path to the hugo binary. Overrides PATH lookup and install_hugo. Useful in monorepos or custom environments. no""
dry_runScan and log what would be uploaded without actually uploading.nofalse
python_versionPython version to use (minimum 3.9).no3.11
package_versionOverride the version of hugo-canvas-sync to install. Defaults to latest stable from PyPI. no""
namedescription
files_uploadedNumber of files uploaded in this run.
files_skippedNumber of files skipped (hash unchanged).
files_failedNumber of files that failed to upload.