Allow changing CDN provider by user to solve problem where default CDN is blocked countrywise

Open
#12,120 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Domain
frontend, web-dev

Research direction

Start by reading src/command/render/template.ts and src/project/types/website/website-search.ts, where the issue identifies CDN URLs and existing MathJax customization. Check the OJS runtime reference separately, since the issue notes it is inherited from ObservableHQ. Done means the feasible default CDN usages can be configured by users without post-processing.

Written by the indexing model from the issue text.

Description

enhancement html ojs-engine search

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/12109

Originally posted by skyfroger February 18, 2025

Description

I have issues reaching cdn.jsdelivr.net in my country. So I am getting errors while trying to render MathJax formulast and inster OJS interactive elements. Is there are an option to change default CDN provider?


Context

I believe Quarto should try to be friendly as possible with users wherever they are. Currently, cdn.jsdelivr.net is used by default in several places

Mathjax / KaTeX

https://github.com/quarto-dev/quarto-cli/blob/ec8cd58685a4906f708c5d009117d1cb2e96e6f8/src/command/render/template.ts#L225-L235

This one can already be customized through html-math-method configuration by providing a full new URL

Search with Algolia

It is using cdn.jsdelivr.net by default with no customization

https://github.com/quarto-dev/quarto-cli/blob/ec8cd58685a4906f708c5d009117d1cb2e96e6f8/src/project/types/website/website-search.ts#L695-L718

OJS

[!NOTE]
EDIT: For OJS this is not possible as we inherit from ObservableHQ directly (https://github.com/quarto-dev/quarto-cli/issues/12120#issuecomment-2668719212)

I see
https://github.com/quarto-dev/quarto-cli/blob/ec8cd58685a4906f708c5d009117d1cb2e96e6f8/src/resources/formats/html/ojs/quarto-ojs-runtime.js#L256-L257

which probably is related to how NPM package are served: https://quarto.org/docs/interactive/ojs/libraries.html#npm

This is the real problem encountered in #12109

This would be another part to make it configurable if possible 🤷‍♂

Current workaround

Currently doing a post processing to replace the CDN used in quarto-os-runtime.js or other file

Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.