next build
runs, meaning all the HTML sits ready)blogs
path of the personal website or whatevergetStaticProps
which gets called at build time and lets you pass the fetched data into the props of the componentgetStaticPaths
which gets called at build time and lets you specify which paths you want to pre-rendergenerateStaticParams
replaces getStaticPaths
in the app routerparams
of the component in that pageThe ultimate version of this would be I have some directory somewhere in my project, and as I add new .md files to the directory, they automatically get added as endpoints and also appear in a list on the main page of the website. Some kind of special character can also be included in the text in the md file which indicates the git repo. We can use the title text of the md file as the title that is shown on the main page of the website.
The markdown should be perfectly rendered on the website, not this shitty stuff that gpt just showed me.
Furthermore, if there are screenshots or other media, I want that to get translated over too. Ideally I'd write some kind of bash script that I can run where I pass the filepath to the md file which I want to turn into an endpoint, and it copies over all of the relevant assets.
First thing to tackle is proper markdown rendering. One of the issues that I'm facing is that lists are being displayed as regular text with no bullet points and no indentation. This makes the notes basically unreadable. Looking at the HTML rendered in DevTools, it looks like these lines indented with the dash are correctly being converted to list elements. However, according to GPT this is due to some processing that Tailwind does behind the scenes. We can modify the mdx-components.tsx
to add list-disc
to the class of the unordered lists. After adding it, it's adding the bullet point, but it's not indenting it.
After adding some styling to the different tags with the mdx-components.tsx
file, we got something that looks like decent markdown.
Now, the next step is to auto-generate links to these endpoints on the main page of the website.