The Eko website & blog built with Eleventy. Uses reusable component and simple configurations to automate page creation.
- Built with Eleventy! (docs)
- Netlify CMS: easy blog & website configuration management.
- Reusable components for faster development (src/_includes).
- Simple configuration files for creating retail/API product pages (src/_data).
- Simple stack. Minification/bundling using internal 11ty plugins.
- Getting Started
- Project Structure
- How to add a new blog post?
- How to add or edit a Retail-product page?
- How to add or edit an API-product page?
- How to add a custom page?
- How to add redirections to support old links?
- Install node/npm & git
- Clone this Repository:
git clone https://github.com/ekoindia/eko-website
- Navigate to the directory:
cd eko-website
- Install dependencies:
npm install
- Copy
.env.example
to a new.env
file and setup your own defaults - Build and host locally for local development:
npm start
Checkout in the browser:localhost:8080
- 📄🔧 .eleventy.js
All project technical configurations go here
- 📂 src/
Main source directory. Top-level/custom webpages are created right here
- 📄 index.njk
The home page
- 📂✍ blog/
Create blog posts here
- 📄 index.njk
The blog listing page
- 📄 blog-tag-pages.njk
Page template to list posts for individual tags
- 📄 index.njk
- 📂🔧 _data
All the website configuration and data go here
- 📄🔧 website.yaml
Top configurations, like, domain, logo, title, SEO, etc
- 📑🔧 products.yaml
The retail products listing. Pages automatically created and added to menu
- 📑🔧 developers.yaml
The API products listing. Pages automatically created and added to menu
- 📑🔧 ekoUniversity.yaml
The video listing for the Eko University section
- 📄🔧 footer.yaml
Configure footer links
- 📄🔧 env.yaml
Secret configurations as envoirnment variables
- 📄🔧 website.yaml
- 📂👩💻 _layouts
Reusable templates for various page types
- 📄⭐ base.njk
Main template with outermost common code used by all pages
- 📄 product_page.njk
Template for retail product pages
- 📄 developer_page.njk
Template for API product pages
- 📄 blog_post.njk
Template for blog post pages ideally written in markdown
- 📄 page.njk
Template for normal pages ideally written in markdown
- 📄 ekoUniversity.njk
For the Eko University page
- 📄⭐ base.njk
- 📂🧩 _includes
All build-time reusable components go here
- 📓 section_*.njk
Full width reusable UI components that compose the index & product pages
- 📄 navigation.njk
Top navigation bar in every page
- 📄 footer.njk
Footer section at the bottom of every page
- 📄 blogslist.njk
List of all blog posts with pagination
- 📄 form.njk
Visitor sign-up form
- 📂🎨 css
CSS files - inlined into HTML during build
- 📄 base.css
Common CSS rules used in every page
- 📄 blog.css
CSS rules for pages using the 'blog' or 'page' template
- 📄 nav.css
CSS rules for top navigation menu
- 📄 footer.css
CSS rules for footer section
- 📄 flex.css
Helper classes for CSS Flexbox
- 📄 carousel.css
CSS rules for the carousel section
- 📄 section_components.css
CSS rules for the section_*.njk reusable components
- 📄 base.css
- 📁 js
Javascript files - inlined into HTML during build
- 📓 section_*.njk
- 📁🖼 assets
Static assets like images, icons, etc
- 📄 index.njk
- 📂 utils/
11ty build-time custom utilities...
- 📄 shortcodes.js
Reusable short markup (HTML) snippets
(docs) - 📄 filters.js
Custom filters for 11ty to be used in templates to manipulate data
(docs)
- 📄 shortcodes.js
- Add a new file in the
src/blog/
folder (or, copy an existing file). - File name becomes the URL of the blog-post (without the extension).
- Easiest way to write the post is to use Markdown (.md). Any other file format can be used (eg: Nunjucks, HTML, Liquid, Javascript).
- Check EXAMPLE-POST.md for an example page and a quick guide to markdown.
- Add other page info (like title, description, image, etc) in the top section of the page between the two '---' lines.
- Make the first paragraph of the post an excerpt by add a
<!-- excerpt -->
comment after it. This will be shown as the post description. - Alternatively, add a
description
field in the top section of the page between the two '---' lines. - Check EXAMPLE-POST.md for a quick example.
- Make the first paragraph of the post an excerpt by add a
- You can also use the graphical admin interface (provided by Netlify CMS) to easily add/edit blog posts.
- Retail product pages can by added without coding by just adding the product details to the configuration file!
- All configuration files reside in the
src/_data/
folder. - Configuration files are simple text files written in YAML format.
- It is a simple format to understand and write manually.
- Just ensure proper indentation and spaces!
- Open the
src/_data/products.yaml
file. - Add a new product by copying configuration of an existing product and changing it's values!
- Any new product page is automatically added to the navigation menu!
- API product pages can by added without coding by just adding the product details to the configuration file!
- All configuration files reside in the
src/_data/
folder. - Configuration files are simple text files written in YAML format.
- It is a simple format to understand and write manually.
- Just ensure proper indentation and spaces!
- Open the
src/_data/developers.yaml
file. - Add a new product by copying configuration of an existing product and changing it's values!
- Any new product page is automatically added to the navigation menu!
- Add a new file in the
src/
folder (or, copy an existing file).- File name becomes the URL of the blog-post (without the extension).
- You can also create the file under a sub-directory, if required. The page URL will reflect the sub-directory in the path.
- Easiest way to write the post is to use Markdown (.md). Any other file format can be used (eg: Nunjucks, HTML, Liquid, Javascript).
- Check EXAMPLE-POST.md for an example page and a quick guide to markdown.
- For full customization, create a Nunjucks file (.njk) and write any custom HTML.
- Add other page info (like description, social image, etc) at the top of the page between the two '---' lines.
- Add to navigation menu in the
src/_includes/navigation.njk
file.
- Add an entry in the
src/_redirects
file. - Example and documentation in the file.
- Checkout the file src/_data/env.js
- Add a new
env
variable name in this file - Now this variable can be accessed anywhere using
env.<VARIABLE_NAME>