feat: upgrade to 11ty 3.0.0@alpha

This commit is contained in:
Cory Dransfeldt 2023-12-21 13:31:57 -08:00
parent 2cd8e4a380
commit e16633653a
No known key found for this signature in database
43 changed files with 578 additions and 5039 deletions

View file

@ -1,8 +1,8 @@
const { DateTime } = require('luxon')
const tagAliases = require('../data/tag-aliases.json')
const { makeYearStats, processPostFile } = require('./utils')
import { DateTime } from 'luxon'
import tagAliases from '../data/tag-aliases.js'
import { makeYearStats, processPostFile } from './utils.js'
const tagList = (collection) => {
export const tagList = (collection) => {
const tagsSet = new Set()
collection.getAll().forEach((item) => {
if (!item.data.tags) return
@ -13,7 +13,7 @@ const tagList = (collection) => {
return Array.from(tagsSet).sort()
}
const tagMap = (collection) => {
export const tagMap = (collection) => {
const tags = {}
collection.getAll().forEach((item) => {
if (item.data.collections.posts) {
@ -38,7 +38,7 @@ const tagMap = (collection) => {
return tags
}
const postStats = (collectionApi) => {
export const postStats = (collectionApi) => {
const oneDayMilliseconds = 1000 * 60 * 60 * 24
const statsObject = {
avgDays: 0,
@ -164,9 +164,3 @@ const postStats = (collectionApi) => {
statsObject.highPostCount = highPostCount
return statsObject
}
module.exports = {
tagList,
tagMap,
postStats,
}