From b0bf7775069dfe1785dcbc3f3570293ec5acb260 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Sat, 24 Feb 2024 14:25:05 -0500 Subject: [PATCH] Ugh, tabs vs spaces --- src/frontmatter/coverImage.js | 2 +- src/frontmatter/example.js | 24 ++++++++++++------------ src/frontmatter/title.js | 2 +- src/settings.js | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/frontmatter/coverImage.js b/src/frontmatter/coverImage.js index e293312..a3a6f29 100644 --- a/src/frontmatter/coverImage.js +++ b/src/frontmatter/coverImage.js @@ -1,5 +1,5 @@ // get cover image filename, previously set on post.meta // this one is unique as it relies on logic executed by the parser module.exports = (post) => { - return post.meta.coverImage; + return post.meta.coverImage; }; diff --git a/src/frontmatter/example.js b/src/frontmatter/example.js index 9ecaf8e..2159d87 100644 --- a/src/frontmatter/example.js +++ b/src/frontmatter/example.js @@ -1,19 +1,19 @@ /* - 1. Copy this file, rename to the frontmatter field name you want, camelcased - 2. Edit frontmatter_fields in settings.js to include your new field name - 3. Run the script to see post data dumps, to see what you can work with - 4. Write your code to get and return what you want - 5. Update "get whatever" comment to describe what you're getting - 6. Remove your field name from frontmatter_fields in settings.js - 7. Remove this comment block and the debug console code - 8. Make that pull request! + 1. Copy this file, rename to the frontmatter field name you want, camelcased + 2. Edit frontmatter_fields in settings.js to include your new field name + 3. Run the script to see post data dumps, to see what you can work with + 4. Write your code to get and return what you want + 5. Update "get whatever" comment to describe what you're getting + 6. Remove your field name from frontmatter_fields in settings.js + 7. Remove this comment block and the debug console code + 8. Make that pull request! */ // get whatever module.exports = (post) => { - console.log('\nBEGIN POST DATA DUMP ===========================================================\n'); - console.dir(post, { depth: null }); - console.log('\nEND POST DATA DUMP =============================================================\n'); + console.log('\nBEGIN POST DATA DUMP ===========================================================\n'); + console.dir(post, { depth: null }); + console.log('\nEND POST DATA DUMP =============================================================\n'); - return 'EXAMPLE: ' + post.data.title[0]; + return 'EXAMPLE: ' + post.data.title[0]; }; diff --git a/src/frontmatter/title.js b/src/frontmatter/title.js index d9bdb45..d33e515 100644 --- a/src/frontmatter/title.js +++ b/src/frontmatter/title.js @@ -1,4 +1,4 @@ // get simple post title module.exports = (post) => { - return post.data.title[0]; + return post.data.title[0]; }; diff --git a/src/settings.js b/src/settings.js index b6a21e7..2088ecd 100644 --- a/src/settings.js +++ b/src/settings.js @@ -3,11 +3,11 @@ // field by providing an alias after a ':'. For example, 'date:created' will include 'date' in // frontmatter, but renamed to 'created'. exports.frontmatter_fields = [ - 'title', - 'date', - 'categories', - 'tags', - 'coverImage' + 'title', + 'date', + 'categories', + 'tags', + 'coverImage' ]; // Time in ms to wait between requesting image files. Increase this if you see timeouts or