• GitHub Pages and Jekyll
    • Jekyll and Liquid
  • Language Comparisons
    • JavaScript
    • AP CSP Pseudocode
    • Python
    • Java
  • Blogging Example Code
    • HTML Included Code
    • Conclusion

GitHub Pages and Jekyll

GitHub Pages leverages the power of Jekyll to transform your Markdown and HTML files into a static website.

  1. Front Matter: All Markdown (.md) and Jupyter Notebook (.ipynb) files with front matter are processed into a static data structure, making their keys and values accessible to the GitHub Pages system via Jekyll.
  2. Jekyll Language: Jekyll can access all site-wide keys and values defined in _config.yml, as well as individual page front matter keys and values. This allows for dynamic organization and rendering of documents based on their metadata.

Jekyll and Liquid

The primary purpose of Jekyll within GitHub Pages is to help developers create dynamic web pages. By using site and page front matter, you can organize and render pages based on data. Liquid provides the templating syntax that allows you to dynamically generate content within your Jekyll templates. In essence, Jekyll is the system, and Liquid is the templating language.

Jekyll and Liquid provide programming constructs that are essential in all programming environments. These constructs are particularly relevant to concepts required by AP (CSP, CSA) and college articulated courses (CSSE, Data Structures).

Below are these key elements as defined in Liquid.

  • Variable Assignments: This assigns all the posts in the site to the variable rawposts.
    
    
    {% assign rawposts = site.posts %}
    
    
  • Conditionals: This checks if the number of posts is greater than zero.
    
    
    {%- if posts.size > 0 -%}
      
    {%- endif -%}
    
    
  • Loops: This iterates through each post in the site's posts.
    
    
    {%- for post in site.posts -%}
      
    {%- endfor -%}
    
    
  • Include: Include (HTML)
    
    
    {%- include post_list_image_card.html -%}
    
    
FRQ 1: Explain the relationship between Jekyll and Liquid. What is the role of Front Matter in making data accessible to both?