This project is a proof of concept for generating eBooks using Eleventy, a simple static site generator. The project includes custom configurations and scripts to build and serve the eBooks.
You can visit the live demo to see the eBooks in action.
To get started, clone the repository and install the dependencies:
git clone https://github.com/yourusername/lb-ebook-poc.git
cd lb-ebook-poc
npm install
To start the development server with live reloading:
npm start
This will watch for changes in Sass and Eleventy files and rebuild the project as needed.
To build the project for production:
npm run build
This will compile the Sass files and generate the static site using Eleventy.
The project structure is as follows:
src/
: Contains the source files for the eBooks.ebooks/
: Contains individual eBook directories.sass/
: Contains Sass files for styling._includes/
: Contains reusable templates and partials.
_site/
: The output directory for the built site (ignored by Git)..eleventy.js
: Configuration file for Eleventy.package.json
: Contains project metadata and scripts..github/workflows/BuildGitHubPages.yml
: GitHub Actions workflow for building and deploying the site.
The following scripts are defined in package.json
:
npm start
: Runs the build scripts and starts the development server.npm run build
: Builds the project for production.npm run watch:sass
: Watches for changes in Sass files and compiles them.npm run build:sass
: Compiles Sass files.npm run watch:eleventy
: Starts the Eleventy development server.npm run build:eleventy
: Builds the site using Eleventy.
The project includes a GitHub Actions workflow for building and deploying the site to GitHub Pages. The workflow is defined in .github/workflows/BuildGitHubPages.yml
:
The build script performs the following tasks:
- Compiles the Sass files to CSS.
- Generates the static site using Eleventy.
- Prepares the project for production deployment by optimizing and bundling the necessary assets.
There is then an Action as part of the workflow that publishes the built site to GitHub Pages.
The main path for the ebooks mini-site, ebooks.lullabot.com
, redirects to the main Lullabot site by default. In order to reach an actual ebook, the pattern is:
ebooks.lullabot.com/ebooks/
+ any book title from https://github.com/Lullabot/lb-ebook-poc/tree/main/src/ebooks + /cover
e.g. https://ebooks.lullabot.com/ebooks/large-team-challenges/cover/
This project is licensed under the ISC License. See the LICENSE file for details.