filecoin-saturn / homepage

The saturn.tech homepage
https://saturn.tech
Other
3 stars 2 forks source link

Saturn-website

The distribution website for Filecoin Saturn

Developer notes

The code in this repository was optimized to deliver a pleasant experience to both content editors and developers.

Styling prose blocks

We utilize the tailwind prose class to style prose / text blocks in this repository. The CustomProse component includes all necessary style customizations from our design system. Just wrap the according markup with CustomProse to style it.

Design deviations can be supplied with the overrides prop. E.g. to style h1 blocks differently, we could write overrides="prose-h1:bg-black".

Where does stuff go?

We differentiate between layout + functionality and content

Content:

Content is everything that is or has to be translatable or is language dependent. Content can be:

Content belongs in the /content directory, with a file structure as follows:

content

    en
        [Global component like NavBar].tsx
        [...].tsx

        index
            intro.mdx
            intro.tsx
            [section name].mdx
            [section name].tsx
            [...].mdx
            [...].tsx

    [lang]
        ...

As you can see, global components like NavBar or Footer go directly in the en or [lang] folder, while page scoped components and prose has it's own folder named after the page they will be placed in. Within the page folder all files are named after the page section they belong to.

Files mostly come in pairs, one or more *.mdx file for prose (and seldomly components that belong to prose blocks) and one .tsx file where components are injected with content and exported for use.

Layout + functionality:

Layout + functionality is everything else that is not language dependent. I.e. content is what differs in a layout depending on the language.

The file structure here is commonly split into a components and pages folder, as commonly know in the nextjs ecosystem.

We recommend to place most of the code within pages or components, leaving only the necessary parts to content.

Guidelines for writing code

Guidelines for deployment

License

Dual-licensed under MIT + Apache 2.0