mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
23 lines
389 B
JavaScript
23 lines
389 B
JavaScript
import fs from 'fs'
|
|
import findUp from 'find-up'
|
|
|
|
export default ({ world }) => <h1>About {world}</h1>
|
|
|
|
export async function getStaticProps() {
|
|
const text = fs
|
|
.readFileSync(
|
|
findUp.sync('world.txt', {
|
|
// eslint-disable-next-line no-eval
|
|
cwd: eval(`__dirname`),
|
|
}),
|
|
'utf8'
|
|
)
|
|
.trim()
|
|
|
|
return {
|
|
props: {
|
|
world: text,
|
|
},
|
|
}
|
|
}
|