Skip to content

Custom programming language to generate static sites with Next.js

License

Notifications You must be signed in to change notification settings

agnlt64/meta-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I don't have a proper name for this

This is a custom programming language that compiles to Next.js code. See ./index.meta for more details on the syntax.

Run the code

You must have an existing Next.js application with shadcn ui and Tailwind CSS setup. You can then copy the ./runtime.tsx to where your pages are. If you use App router, the runtime must be in your-next-app/src/app/runtime.tsx. You must also have a ThemeProvider (from shadcn) located in your-next-app/src/components/theme-provider.tsx. You can put the code below into that file:

"use client"
 
import * as React from "react"
import { ThemeProvider as NextThemesProvider } from "next-themes"
 
export function ThemeProvider({
  children,
  ...props
}: React.ComponentProps<typeof NextThemesProvider>) {
  return <NextThemesProvider {...props}>{children}</NextThemesProvider>
}

Then you can compile your .meta source file.

$ go run . index.meta your-next-app/src/app

The code will be generated in the appropriate files and folders. If important files or folders don't exist, the compiler will create them for you.

About

Custom programming language to generate static sites with Next.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published