Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.26 KB

code-snippets.md

File metadata and controls

62 lines (40 loc) · 1.26 KB

Links

Code Snippets

I think this loops through all the pages' front matter by level. This is how the cards show on the course home pages by semester.

{% for topic in site[page.level] %}
	{{topic.whatever}}	
{% endfor %}

YAML Front Matter


Liquid Loop

deliverables:

  • first
  • second
  • third
    {% for deliverable in page.deliverables %}
  • {{deliverable}}
  • {% endfor %}

{% if page.something == sometag %}

Put some text here

{% elsif page.something == someothertag %}

Put different text here.

{% endif %}

CSS

To center a div

Option 1 You could make that thing inline-block and use text-align: center on the parent element.

Option 2 Make the parent element: display: flex and & also justify-content: center.

  • Select ALL direct Decendants

    • .selector >* { attributes:something; }
  • Set a container to 100% height of the browser

    • height:100vh;

Grid

  • To make columns responsive
    • grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));

Emmet

  • To make repeating div contents
    • div.item*30.item$*30{$}*30