quartz-research-note/quartz
Nate Silva 707124cbd6
fix: allow publish property to be a string (ExplicitPublish) (#667)
* fix: allow publish property to be a string (ExplicitPublish)

Previously, the ExplicitPublish filter would publish if the `publish`
property was truthy.

The filter expects the `publish` property to be a boolean:

```
---
publish: true
---
```

However, Obsidian only shows the above if you are viewing a page in
“Source” mode.

If you are not in Source view, and you choose Three Dots Menu (...),
“Add file property”, you will get a string, not a boolean. It seems
likely that many users will do this and get:

```
publish: "true"
```

Notice that `"true"` is a string, not the boolean value `true`. If the
user changes this to `"false"`, the page will still be published:

```
publish: "false"
```

That is because the string value `"false"` is truthy.

This PR does the following:

- Allows the `publish` property to be either a boolean or a string.
- If it’s a string, it’s considered `true` if the string is `"true"`
  (not case-sensitive; it will also work if it is `"True"`, `"TRUE"`,
  etc.)
- Guarantees that the returned value from `shouldPublish` is a `boolean`
  -- previously it could be any truthy value even though it was cast to
  `boolean`

* style: use double-quotes everywhere

* style: format according to project style guide
2024-01-02 15:19:19 -08:00
..
cli fix: Continue setup even if a file to delete is not found (#663) 2024-01-01 14:14:37 -08:00
components fix: dont show last page if folder 2024-01-01 14:20:34 -08:00
plugins fix: allow publish property to be a string (ExplicitPublish) (#667) 2024-01-02 15:19:19 -08:00
processors fix: use slugs instead of title as basis for explorer (#652) 2023-12-27 16:44:14 -08:00
static Revert "feat: Making Quartz available offline by making it a PWA (#465)" 2023-09-20 13:52:45 -07:00
styles style: relative back on pre 2023-12-28 15:07:59 -08:00
util fix: use slugs instead of title as basis for explorer (#652) 2023-12-27 16:44:14 -08:00
bootstrap-cli.mjs cleanup: rework cli to allow invoking create and build outside of cli (#428) 2023-08-27 15:59:51 -07:00
bootstrap-worker.mjs run prettier 2023-07-22 17:27:41 -07:00
build.ts feat: -v flag should log exact error on parse failure 2023-12-19 09:07:52 -08:00
cfg.ts feat: Self-hosted Plausible support (#656) 2023-12-28 08:49:35 -08:00
worker.ts base path refactor to better support subpath hosting 2023-08-19 15:52:25 -07:00