Fix lint problems
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
commit
40d37c4aea
|
@ -16,9 +16,12 @@ export async function getYears(): Promise<string[]> {
|
|||
}
|
||||
|
||||
export async function getTermsByYear(year: string): Promise<string[]> {
|
||||
return (await fs.readdir(path.join(EVENTS_PATH, year))).sort(
|
||||
(a, b) => TERMS.indexOf(a) - TERMS.indexOf(b)
|
||||
);
|
||||
return (
|
||||
await fs.readdir(path.join(EVENTS_PATH, year), { withFileTypes: true })
|
||||
)
|
||||
.filter((dirent) => dirent.isDirectory() && TERMS.includes(dirent.name))
|
||||
.map((dirent) => dirent.name)
|
||||
.sort((a, b) => TERMS.indexOf(a) - TERMS.indexOf(b));
|
||||
}
|
||||
|
||||
interface Metadata {
|
||||
|
@ -55,12 +58,7 @@ export async function getEventsByTerm(
|
|||
year: string,
|
||||
term: string
|
||||
): Promise<string[]> {
|
||||
return (
|
||||
await fs.readdir(path.join(EVENTS_PATH, year, term), {
|
||||
withFileTypes: true,
|
||||
})
|
||||
)
|
||||
.map((dirent) => dirent.name)
|
||||
return (await fs.readdir(path.join(EVENTS_PATH, year, term)))
|
||||
.filter((name) => name.endsWith(".md"))
|
||||
.map((name) => name.slice(0, -".md".length));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React from "react";
|
||||
import { getYears, getTermsByYear } from "../../../lib/events";
|
||||
import styles from "./year.module.css";
|
||||
|
||||
import { Link } from "../../../components/Link";
|
||||
import { getYears, getTermsByYear } from "../../../lib/events";
|
||||
|
||||
import styles from "./year.module.css";
|
||||
|
||||
export async function getStaticPaths(): Promise<{
|
||||
paths: {
|
||||
|
@ -55,7 +57,7 @@ const Year = (props: Props) => {
|
|||
<hr />
|
||||
<div className={styles.links}>
|
||||
{props.terms.map((term) => (
|
||||
<Link key={term} href={`events/${props.year}/${term}`}>
|
||||
<Link key={term} href={`/events/${props.year}/${term}`}>
|
||||
{`${term.charAt(0).toUpperCase()}${term.slice(1)}`}
|
||||
</Link>
|
||||
))}
|
||||
|
|
Loading…
Reference in New Issue