Add library feature #1

Merged
aaron merged 6 commits from feature/library into main 2025-03-29 11:44:02 +00:00
6 changed files with 12 additions and 12 deletions
Showing only changes of commit 01381d158d - Show all commits

View file

@ -3,7 +3,7 @@ import { NextSeo } from 'next-seo'
import Image from 'next/image'
import Link from 'next/link'
import React from 'react'
import style from "./Book.module.css";
import style from './Book.module.css'
import ExternalLink from '../ExternalLink/ExternalLink'
function Book ({ attributes, html }) {

View file

@ -66,7 +66,7 @@ export function getContentTags (contentPath) {
for (const entry of entries) {
if (!entry.attributes.tags) { continue }
const tags = entry.attributes.tags;
const tags = entry.attributes.tags
for (const tag of tags) {
allTags[tag] = !allTags[tag] ? 1 : allTags[tag] + 1
}

View file

@ -15,5 +15,5 @@ export function formatDate (date) {
* @returns
*/
export function stringifyAndParse (obj) {
return JSON.parse(JSON.stringify(obj));
return JSON.parse(JSON.stringify(obj))
}

View file

@ -6,7 +6,7 @@ import { stringifyAndParse } from '@/lib/helpers'
export const getStaticPaths = () => getStaticEntryPaths('./content/books')
export const getStaticProps = (ctx) =>
stringifyAndParse(getStaticEntryProps('./content/books', ctx));
stringifyAndParse(getStaticEntryProps('./content/books', ctx))
export default function LibrarySingle ({ attributes, html }) {
return (

View file

@ -17,7 +17,7 @@ export const getStaticProps = () => {
props: {
bookEntries: stringifyAndParse(bookEntries)
}
};
}
}
export default function Library ({ bookEntries }) {