diff --git a/components/FileListing.tsx b/components/FileListing.tsx
index b6d8369..24e20a6 100644
--- a/components/FileListing.tsx
+++ b/components/FileListing.tsx
@@ -123,9 +123,16 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
if ('folder' in resp) {
const { children } = resp
+
+ // Image preview rendering preparations
const imagesInFolder: ImageDecorator[] = []
const imageIndexDict: { [key: string]: number } = {}
let imageIndex = 0
+
+ // README rendering preparations
+ let renderReadme = false
+ let readmeFile = null
+
children.forEach((c: any) => {
if (fileIsImage(c.name)) {
imagesInFolder.push({
@@ -136,6 +143,11 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
imageIndexDict[c.id] = imageIndex
imageIndex += 1
}
+
+ if (c.name.toLowerCase() === 'readme.md') {
+ renderReadme = true
+ readmeFile = c
+ }
})
return (
@@ -202,6 +214,12 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =