-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
converts everything to ESM and fixes downstream issues
filters, shortcodes, and transform fixes come with this update updates layouts for collections
- Loading branch information
Showing
33 changed files
with
309 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
const { DateTime } = require("luxon"); //bundled with 11ty | ||
import { DateTime } from 'luxon'; //bundled with 11ty | ||
|
||
/** | ||
* Human readable date format for date | ||
* @param {string} postDate | ||
* @returns {string} May 20, 1982 | ||
* @example {{ page.date | postDate }} | ||
* Format a date using Luxon's DateTime | ||
* @param {Date} date - The date to format | ||
* @returns {string} Formatted date string | ||
*/ | ||
const postDate = (date) => { | ||
return DateTime.fromJSDate(date).toLocaleString(DateTime.DATE_MED); | ||
export const postDate = (date) => { | ||
return DateTime.fromJSDate(date).toLocaleString(DateTime.DATE_FULL); | ||
}; | ||
|
||
/** | ||
* Human readable format for date with time | ||
* @param {string} postDateTime | ||
* @returns {string} May 20, 1982, 5:30 PM EDT | ||
* @example {{ page.date | postDateTime }} | ||
* Format a date for use in HTML datetime attributes | ||
* @param {Date} date - The date to format | ||
* @returns {string} ISO date string | ||
*/ | ||
const postDateTime = (date) => { | ||
return DateTime.fromJSDate(date).toLocaleString(DateTime.DATETIME_MED); | ||
export const postDateTime = (date) => { | ||
return DateTime.fromJSDate(date).toFormat('yyyy-LL-dd'); | ||
}; | ||
|
||
module.exports = { postDate, postDateTime }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/** | ||
* Get the current year - copyright | ||
* @returns {string} HTML copyright symbol with current year | ||
* @usage {% year %} | ||
*/ | ||
module.exports = (copyright) => { | ||
export default () => { | ||
return `© ${new Date().getFullYear()}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
/** | ||
* Get the current package version - version | ||
* @returns {string} Current package version prefixed with 'v' | ||
* @example {% version %} | ||
*/ | ||
const fdVersion = require("../../../package.json").version; | ||
import { readFileSync } from 'node:fs'; | ||
import { resolve, dirname } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
module.exports = (version) => { | ||
return `v${fdVersion}`; | ||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
const packagePath = resolve(__dirname, '../../../package.json'); | ||
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8')); | ||
|
||
export default () => { | ||
return `v${packageJson.version}`; | ||
}; |
Oops, something went wrong.