Fix: Protect theme JS file from front matter default for layout (#1447)

Fix #1445

Front matter defaults with unrestricted `scope` (`path: ""`) can affect theme code files. [Jekyll](https://jekyllrb.com/docs/front-matter/#predefined-global-variables) supports using `null` to "produce a file without using a layout file".

This PR adds `layout: null` to `just-the-docs.js`, to avoid this file being affected by the following front matter defaults:

```yaml
defaults:
  -
    scope:
      path: ""
    values:
      layout: "default"
```
This commit is contained in:
Peter Mosses 2024-04-01 19:59:07 +02:00 committed by GitHub
parent 7de5f7abe5
commit 328893dd30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -17,12 +17,14 @@ This website is built from the `HEAD` of the `main` branch of the theme reposito
Code changes to `main` that are *not* in the latest release:
- N/A
- Fixed: Protect theme JS file from front matter default for layout by [@pdmosses] in [#1447]
Docs changes made since the latest release:
- N/A
[#1447]: https://github.com/just-the-docs/just-the-docs/pull/1447
## Release v0.8.1
Hi folks! This patch release fixes a bug introduced in `0.8.0` that affects users who build their sites in strict mode. It is a straightforward upgrade that should require no manual migration changes. Thank you to [@Zarthus] for quickly catching and fixing this bug!

View File

@ -1,4 +1,5 @@
---
layout: null
---
(function (jtd, undefined) {