Scan a folder having markdown files (.MD or .MDX) and convert them into static html pages.
A SSG application made with Gatsby, tailwindcss, gatsby-plugin-mdx, gatsby-remark-prismjs or prismjs
-
Home Page Full
-
Blog Page Header Frontmatter section
-
Blog Page Features: Quotes, Image, Heading2/3, Code, List
-
Blog Page Features: Quotes, Image, Heading2/3, Code, List
You have to build the pages so locally so please follow the steps.
- First Clone the application.
- Node.js above v18.15.0 should be installed.
- Install the gatsby-cli globally
npm install --global yarn npm install -g gatsby-cli
- Now check if installed correctly
gatsby --version
- Go in the root directory where the Git repo is clone and install all the dependencies
yarn install
- Now to check the website in dev mode run
gatsby develop --verbose
- Wait till this process
- And check the website first if it is working correctly on http://localhost:8000/
- If takes too long or error occured close the terminal
Ctrl+C
and try again few times.- This is a heavy process so might take time depnding the number of files and images.
- If yes then build the application
gatsby build
- A new
public
folder will be created. - The whole website is in public folder to still check it again
- open the
public
folder in vs code - And run Live Server ( the root folder should be
/public
) - Now check it again and if everything seems fine the deploy it!
- This are all static files generated inside the /public folder you can directly deploy them
After running the build command gatsby scan the src/pages
folder and follow the file structure as the url structure
- e.g if the files was
pages/meow/about.tsx
it will appear on url{main-url}/meow/about.html
- Also the special cases are
404.tsx
it will appear if someone goes on wrong url which has not been declared. - And
pages/index.tsx
is the home page. - And
src/pages/{mdx.frontmatter__slug}.tsx
will scan all the .mdx and .md files from CMS. - CMS means content management system. Inside
gatsby-config.ts
checkoutgatsby-source-filesystem
insideplugin
. This will add ourblogs/
folder and its content in the CMS and hence .md files inside the blogs/ folder will be converted into html pages.