Lab 1

Featured Image

Static Site Generation (SSG) Lab Write-Up


Introduction

Static Site Generation (SSG) is a method used in web development to generate static HTML pages from templates. Instead of rendering web pages on each request, SSG pre-creates all pages at build time. This leads to faster load times and faster performance.


Template Engines

Template eengines are the core of SSG allowing developers to define structures for content and easily reuse these structures across different pages. After reading about several template engines, here are the three that I explored:

1. Nunjucks

2. Liquid

3. Pug (formerly Jade)

For my assignment, I chose Nunjucks. The reason behind this decision is its simplicity and flexibility. While Liquid is very beginner friendly too, Nunjucks provides more power and customizability from what i've seen which I found necessary as I wanted to include dynamic content in some areas. Also 11ty's strong integration with Nunjucks means less hassle during setup.


Other SSG Applications

Besides 11ty, there are several other popular Static Site Generators:

1. Gatsby

2. Hugo

3. Jekyll

Each of these platforms has its strengths but 11ty's flexibility with template engines and its simple setup made it a better choice for this project Gatsby’s reliance on React felt too complex for a simpler static site as well as my knowledge levels while Hugo’s templating system felt limited.


11ty Configuration Settings

After reviewing the 11ty documentation I found configuration options. In this assignment, we are using the following:

Other settings that might be useful to explore:


Front Matter

Front matter refers to metadata that is embedded at the top of a file in SSGs, formatted in YAML or JSON. It provides information like the title, date, and tags for a page. In the context of SSG, front matter is critical as it provides a way for developers to define variables and content metadata that can be used by the template engine to render the page dynamically. This approach allows for creating custom page templates, such as blog posts or project pages, where each page has a unique front matter section but shares a common template layout.


Conclusion

Static Site Generation provides an efficient way to create fast, optimized websites. By exploring different template engines and SSG tools like 11ty, I gained insight into how SSG helps optimize workflows and content organization. Through this lab, I’ve learned how to configure 11ty and make use of its flexible template engines and settings, making it a powerful tool for static site creation.