1 | Page
CSE 3901: Midterm 2 Questions and Correct
Answers
STATIC SITES SECTION Ans: ---
What is static site generation? Ans: Using a program to produce
HTML pages
(kind of like compiling programs)
Middleman
what are the source files used in SSG? Ans: .md
.erb
.scss
What is Middleman? Ans: A ruby Gem
the project is its own directory
lots of subdirectories for css, images, etc
Compile the source files like a program
can then copy to any location
© 2025 All rights reserved
, 2 | Page
What are the three benefits of using a program for Static Site
Generation? Ans: 1. Code reuse and single point of control (visual
identity)
2. Authoring of content in a language that is more human-friendly
(improved syntax)
3. Parameterized generation of markup and content (content
generation)
Describe Visual Identity (code reuse/single POC) Motivation Ans: -
Having common headers and footers and making the whole
website have a base design for every page
-duplicated code ruins single POC
-Solution: putting common HTML in one file (a partial) and every
page includes it
What is ERb? Ans: Embedded Ruby
-things like <% code %> <%= expr %> and <%# text %>
How to generate a site Ans: save source files as html.erb
>> bundle exec middleman build
this then makes them .html
© 2025 All rights reserved
, 3 | Page
what is a partial Ans: a document fragment included in other
documents
-include in template as <%= partial "navigation" %>
what is special about naming a partial? Ans: they always start
with _ and end in .erb still (no html)
How to customize arguments with a partial Ans: in the normal
page when you call the partial:
<%= partial "banner", :locals => { :name => "Syllabus", :amount =>
34 } %>
in the partial file:
<h3> ,%= name %> </h3>
<p> Costs <%= "$#{amount}.00" %></p>
What is Layout Ans: It is a file that can make a consistent
structure across every page in a website
How do you label where there's page specific stuff in Layout.erb?
Ans: <%= yield =>
© 2025 All rights reserved
CSE 3901: Midterm 2 Questions and Correct
Answers
STATIC SITES SECTION Ans: ---
What is static site generation? Ans: Using a program to produce
HTML pages
(kind of like compiling programs)
Middleman
what are the source files used in SSG? Ans: .md
.erb
.scss
What is Middleman? Ans: A ruby Gem
the project is its own directory
lots of subdirectories for css, images, etc
Compile the source files like a program
can then copy to any location
© 2025 All rights reserved
, 2 | Page
What are the three benefits of using a program for Static Site
Generation? Ans: 1. Code reuse and single point of control (visual
identity)
2. Authoring of content in a language that is more human-friendly
(improved syntax)
3. Parameterized generation of markup and content (content
generation)
Describe Visual Identity (code reuse/single POC) Motivation Ans: -
Having common headers and footers and making the whole
website have a base design for every page
-duplicated code ruins single POC
-Solution: putting common HTML in one file (a partial) and every
page includes it
What is ERb? Ans: Embedded Ruby
-things like <% code %> <%= expr %> and <%# text %>
How to generate a site Ans: save source files as html.erb
>> bundle exec middleman build
this then makes them .html
© 2025 All rights reserved
, 3 | Page
what is a partial Ans: a document fragment included in other
documents
-include in template as <%= partial "navigation" %>
what is special about naming a partial? Ans: they always start
with _ and end in .erb still (no html)
How to customize arguments with a partial Ans: in the normal
page when you call the partial:
<%= partial "banner", :locals => { :name => "Syllabus", :amount =>
34 } %>
in the partial file:
<h3> ,%= name %> </h3>
<p> Costs <%= "$#{amount}.00" %></p>
What is Layout Ans: It is a file that can make a consistent
structure across every page in a website
How do you label where there's page specific stuff in Layout.erb?
Ans: <%= yield =>
© 2025 All rights reserved