diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-07-11 23:37:24 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-07-11 23:37:24 +0300 |
| commit | e0f98cddc7a9b2fc984f208551e82477161eac45 (patch) | |
| tree | ed0485a5e6225c9e79ed3fe3f2f8029156161546 /build.js | |
| parent | a1e6e600d0a2e1bda0776db2346bc8bf1e3ddb0f (diff) | |
Attempt #3
Diffstat (limited to 'build.js')
| -rw-r--r-- | build.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -43,6 +43,10 @@ const galleryViews = galleryJsonList .map((fileName) => fs.readFileSync(path.join(GALLERY_DIR, fileName), "utf-8"))
.map(JSON.parse)
.map((gallery) => {
+ // If display_title is "-", do not render a title. Netlify CMS doesn't support optionals well.
+ const display_title = gallery["display_title"].trim() !== "-"
+ ? gallery["display_title"]
+ : undefined;
const rows = sliceIntoChunks(gallery["images"], gallery["column_count"]);
const columns = transpose(rows);
return {
|
