|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +--- |
| 4 | + |
| 5 | +<div class="mag-shell"> |
| 6 | + <header class="mag-masthead"> |
| 7 | + <p class="edition">Weekend Edition · {{ "now" | date: "%Y-%m-%d" }}</p> |
| 8 | + <h1>{{ site.title }}</h1> |
| 9 | + <p class="deck">{{ site.description }}</p> |
| 10 | + <nav class="mast-nav" aria-label="Homepage sections"> |
| 11 | + <a href="#lead">Top Story</a> |
| 12 | + <a href="#headlines">Headlines</a> |
| 13 | + <a href="#latest">Latest</a> |
| 14 | + <a href="{{ '/archive/' | relative_url }}">Archive</a> |
| 15 | + <a href="{{ '/about/' | relative_url }}">About</a> |
| 16 | + </nav> |
| 17 | + </header> |
| 18 | + |
| 19 | + <div class="mag-frontpage"> |
| 20 | + <main class="mag-main"> |
| 21 | + {% assign featured = site.posts.first %} |
| 22 | + |
| 23 | + {% if featured %} |
| 24 | + {% assign featured_parts = featured.content | split: 'src="' %} |
| 25 | + {% if featured_parts.size > 1 %} |
| 26 | + {% assign featured_image = featured_parts[1] | split: '"' | first %} |
| 27 | + {% else %} |
| 28 | + {% assign featured_image = nil %} |
| 29 | + {% endif %} |
| 30 | + |
| 31 | + <section id="lead" class="lead-package"> |
| 32 | + <article class="lead-story"> |
| 33 | + {% if featured_image %} |
| 34 | + <a class="lead-media" href="{{ featured.url | relative_url }}" aria-label="{{ featured.title | escape }}"> |
| 35 | + <img src="{{ featured_image }}" alt="{{ featured.title | escape }}" loading="eager" /> |
| 36 | + </a> |
| 37 | + {% endif %} |
| 38 | + <div class="lead-copy"> |
| 39 | + <p class="kicker">Cover Story</p> |
| 40 | + <h2><a href="{{ featured.url | relative_url }}">{{ featured.title }}</a></h2> |
| 41 | + <p class="meta">{{ featured.date | date: "%Y-%m-%d" }}{% if featured.author %} · {{ featured.author }}{% endif %}</p> |
| 42 | + <p>{{ featured.excerpt | strip_html | normalize_whitespace | truncate: 220 }}</p> |
| 43 | + <a class="read-more" href="{{ featured.url | relative_url }}">Read Story</a> |
| 44 | + </div> |
| 45 | + </article> |
| 46 | + |
| 47 | + <div class="lead-side"> |
| 48 | + <h3>Editor Picks</h3> |
| 49 | + {% for post in site.posts offset:1 limit:3 %} |
| 50 | + {% assign side_parts = post.content | split: 'src="' %} |
| 51 | + {% if side_parts.size > 1 %} |
| 52 | + {% assign side_image = side_parts[1] | split: '"' | first %} |
| 53 | + {% else %} |
| 54 | + {% assign side_image = nil %} |
| 55 | + {% endif %} |
| 56 | + |
| 57 | + <article class="mini-story"> |
| 58 | + {% if side_image %} |
| 59 | + <a class="mini-media" href="{{ post.url | relative_url }}" aria-label="{{ post.title | escape }}"> |
| 60 | + <img src="{{ side_image }}" alt="{{ post.title | escape }}" loading="lazy" /> |
| 61 | + </a> |
| 62 | + {% endif %} |
| 63 | + <div> |
| 64 | + <p class="meta">{{ post.date | date: "%Y-%m-%d" }}</p> |
| 65 | + <h4><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h4> |
| 66 | + </div> |
| 67 | + </article> |
| 68 | + {% endfor %} |
| 69 | + </div> |
| 70 | + </section> |
| 71 | + {% endif %} |
| 72 | + |
| 73 | + <section id="headlines" class="headline-ribbon"> |
| 74 | + <h3>Headlines</h3> |
| 75 | + <ul> |
| 76 | + {% for post in site.posts offset:4 limit:6 %} |
| 77 | + <li> |
| 78 | + <a href="{{ post.url | relative_url }}">{{ post.title }}</a> |
| 79 | + <span>{{ post.date | date: "%Y-%m-%d" }}</span> |
| 80 | + </li> |
| 81 | + {% endfor %} |
| 82 | + </ul> |
| 83 | + </section> |
| 84 | + |
| 85 | + <section id="latest" class="latest-grid"> |
| 86 | + <div class="section-head"> |
| 87 | + <h3>Latest Dispatches</h3> |
| 88 | + <a href="{{ '/archive/' | relative_url }}" class="section-link">View all</a> |
| 89 | + </div> |
| 90 | + <div class="post-cards"> |
| 91 | + {% for post in site.posts offset:10 limit:9 %} |
| 92 | + {% assign card_parts = post.content | split: 'src="' %} |
| 93 | + {% if card_parts.size > 1 %} |
| 94 | + {% assign card_image = card_parts[1] | split: '"' | first %} |
| 95 | + {% else %} |
| 96 | + {% assign card_image = nil %} |
| 97 | + {% endif %} |
| 98 | + |
| 99 | + <article class="post-card"> |
| 100 | + {% if card_image %} |
| 101 | + <a class="card-media" href="{{ post.url | relative_url }}" aria-label="{{ post.title | escape }}"> |
| 102 | + <img src="{{ card_image }}" alt="{{ post.title | escape }}" loading="lazy" /> |
| 103 | + </a> |
| 104 | + {% endif %} |
| 105 | + <div class="card-body"> |
| 106 | + <p class="meta">{{ post.date | date: "%Y-%m-%d" }}</p> |
| 107 | + <h4><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h4> |
| 108 | + <p>{{ post.excerpt | strip_html | normalize_whitespace | truncate: 120 }}</p> |
| 109 | + </div> |
| 110 | + </article> |
| 111 | + {% endfor %} |
| 112 | + </div> |
| 113 | + </section> |
| 114 | + </main> |
| 115 | + |
| 116 | + <aside class="mag-sidebar"> |
| 117 | + <section class="sidebar-card"> |
| 118 | + <h3>From the Desk</h3> |
| 119 | + <p>Books, films, and life notes from Leo, archived and continuously updated.</p> |
| 120 | + </section> |
| 121 | + |
| 122 | + <section class="sidebar-card"> |
| 123 | + <h3>Recent</h3> |
| 124 | + <ul class="compact-list"> |
| 125 | + {% for post in site.posts limit:7 %} |
| 126 | + <li> |
| 127 | + <a href="{{ post.url | relative_url }}">{{ post.title }}</a> |
| 128 | + <span>{{ post.date | date: "%m-%d" }}</span> |
| 129 | + </li> |
| 130 | + {% endfor %} |
| 131 | + </ul> |
| 132 | + </section> |
| 133 | + |
| 134 | + <section class="sidebar-card"> |
| 135 | + <h3>Topics</h3> |
| 136 | + <ul class="topic-cloud"> |
| 137 | + {% for category in site.categories limit:12 %} |
| 138 | + {% assign category_page = site.pages | where: "category_name", category[0] | first %} |
| 139 | + <li> |
| 140 | + {% if category_page %} |
| 141 | + <a class="topic-link" href="{{ category_page.url | relative_url }}"> |
| 142 | + <span class="topic-name">{{ category[0] }}</span> |
| 143 | + <span class="topic-count">{{ category[1].size }}</span> |
| 144 | + </a> |
| 145 | + {% else %} |
| 146 | + <span class="topic-name">{{ category[0] }}</span> |
| 147 | + <span class="topic-count">{{ category[1].size }}</span> |
| 148 | + {% endif %} |
| 149 | + </li> |
| 150 | + {% endfor %} |
| 151 | + </ul> |
| 152 | + <p class="topic-all"><a href="{{ '/categories/' | relative_url }}">Browse all categories</a></p> |
| 153 | + </section> |
| 154 | + |
| 155 | + <section class="sidebar-card"> |
| 156 | + <h3>By Year</h3> |
| 157 | + <ul class="compact-list years"> |
| 158 | + {% assign posts_by_year = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %} |
| 159 | + {% for year in posts_by_year limit:10 %} |
| 160 | + <li> |
| 161 | + <span>{{ year.name }}</span> |
| 162 | + <span>{{ year.items | size }} posts</span> |
| 163 | + </li> |
| 164 | + {% endfor %} |
| 165 | + </ul> |
| 166 | + </section> |
| 167 | + </aside> |
| 168 | + </div> |
| 169 | +</div> |
0 commit comments