Floema represents a modernized rendition of Bizarro's Floema course from Awwwards, now leveraging the powers of 11ty and Vite for enhanced performance and modularity.
- 11ty (Eleventy): A light yet powerful static site generator offering swiftness in build times, data flexibility, and a broad template language support.
- Vite: A groundbreaking build tool and development server that drastically improves frontend development experience with features like lightning-fast HMR (Hot Module Replacement).
- PNPM: A package manager that stands out with its efficiency, making use of a shared store to conserve disk space and reduce installation time.
├── /_site/ # Folder generated by 11ty (contains the final build)
├── /src/ # Main source directory
└── /app/ # JavaScript source files
└── /fonts/ # Font assets
└── /styles/ # Modular SCSS styling
└── /views/ # Pug templates, Prismic Data
├── .env # Environment configuration
├── .gitignore # Git's filter list
├── package.json # Contains project metadata and dependencies
├── .eleventy.cjs # Configurations for Eleventy + Vite synergy
├── .nvmrc # Node version specification for the project
└── vercel.json # Vercel deployment configurations
11ty simplifies web templating. In this setup:
- views: Your starting point. For instance, index.pug serves as the main landing template.
- _includes: Essential building blocks. Store reusable fragments (like navigation or head) here, making it easier to maintain and update the website's consistent parts.
- _data: This is where the magic happens. Beyond conventional data, it sources and integrates content directly from Prismic, making content updates seamless and efficient.
Remember, once 11ty works its magic, the fruits of its labor reside in the _site directory.
The original course setup leveraged Server Side Rendering (SSR) with Express, sending hydrated templates to the client. This approach, although effective, brought along overheads in terms of server load and potential latency.
In contrast, the new setup adopts Static Site Generation (SSG), which pre-renders pages at build time. This means all pages are generated once and served statically, ensuring faster load times and reduced server load. This shift aligns perfectly with the JAMstack principles (JavaScript, APIs, Markup), ensuring better performance, security, and a more developer-friendly environment.
For consistent development, we suggest Node v18.17.1. Using NVM (Node Version Manager), this can be easily managed:
nvm install 18.7.1
Install the project dependencies using:
pnpm i
Kickstart the development environment:
pnpm run dev
To generate a static build of the project:
pnpm run build
Your .env file should contain:
PRISMIC_REPOSITORY=
PRISMIC_ACCESS_TOKEN=
Ensure these are properly set to connect with Prismic services.