Skip to content

Commit 177db1e

Browse files
Merge pull request #52 from mcclatchy/sitemap
Sitemap addition and media url fixes
2 parents 71fc2c6 + 81d0c8d commit 177db1e

File tree

10 files changed

+381
-214
lines changed

10 files changed

+381
-214
lines changed

content/decks/sitemap.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: sitemap
3+
description: A sample sitemap.
4+
menu: decks
5+
layout: sitemap
6+
aliases:
7+
- /saratoga/sample/sitemap/
8+
- /saratoga/decks/sitemap/
9+
---

data/betting.json

Lines changed: 40 additions & 40 deletions
Large diffs are not rendered by default.

data/nationalsports.json

Lines changed: 34 additions & 34 deletions
Large diffs are not rendered by default.

data/news.json

Lines changed: 38 additions & 38 deletions
Large diffs are not rendered by default.

data/opinion.json

Lines changed: 37 additions & 37 deletions
Large diffs are not rendered by default.

data/sports.json

Lines changed: 34 additions & 34 deletions
Large diffs are not rendered by default.

data/thestreet.json

Lines changed: 26 additions & 26 deletions
Large diffs are not rendered by default.

layouts/_default/sitemap.html

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
{{ define "head" }}
2+
<script defer src="/js/navigation.js"></script>
3+
{{ end }}
4+
5+
{{ define "content" }}
6+
<style>
7+
.sitemap {
8+
display: grid;
9+
gap: var(--space-lg);
10+
font-family: var(--sans);
11+
}
12+
13+
.sitemap .header {
14+
text-align: center;
15+
}
16+
17+
.sitemap a {
18+
--link-color: var(--text-color);
19+
}
20+
21+
.sitemap a.disabled {
22+
pointer-events: none;
23+
opacity: 0.5;
24+
cursor: default;
25+
}
26+
27+
.grid-sitemap {
28+
display: grid;
29+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
30+
gap: var(--space-lg) var(--space);
31+
align-items: start;
32+
--columns: auto;
33+
--grid-column-gap: 5px;
34+
--grid-row-gap: 5px;
35+
}
36+
37+
.grid-sitemap-days {
38+
display: grid;
39+
grid-template-rows: repeat(8, 1fr);
40+
grid-auto-flow: column;
41+
gap: var(--space);
42+
}
43+
44+
.breadcrumb > span {
45+
color: var(--darkgray);
46+
font-size: 18px;
47+
border-left: 1px solid var(--darkgray);
48+
padding: 0 5px 0 10px;
49+
}
50+
51+
.breadcrumb > span:not(:last-of-type) {
52+
font-weight: normal;
53+
}
54+
55+
.articles-list {
56+
display: grid;
57+
gap: var(--space-sm);
58+
padding-top: var(--space-sm);
59+
}
60+
61+
@media (max-width: 800px) {
62+
.grid-sitemap-days {
63+
grid-template-rows: repeat(11, 1fr);
64+
}
65+
}
66+
67+
@media (max-width: 600px) {
68+
.sitemap {
69+
padding: var(--page-padding);
70+
}
71+
72+
.grid-sitemap-days {
73+
grid-template-rows: repeat(16, 1fr);
74+
}
75+
}
76+
</style>
77+
78+
<section class="sitemap">
79+
<div class="header">
80+
<h1 class="h1">Site Map</h1>
81+
<hr>
82+
</div>
83+
84+
{{ $currentYear := now.Year }}
85+
{{ $currentMonth := now.Month | int }}
86+
{{ $currentDay := now.Day }}
87+
88+
<div class="grid-sitemap">
89+
{{ $endYear := $currentYear }}
90+
{{ $startYear := 2017 }}
91+
92+
{{ range (seq $endYear $startYear) }}
93+
<div class="grid">
94+
<div class="h3">{{ . }}</div>
95+
{{ $year := . }}
96+
97+
{{ if eq $year $currentYear }}
98+
{{ range (seq 1 12) }}
99+
{{ $month := . }}
100+
{{ $monthFormatted := printf "%02d" $month }}
101+
{{ $monthDate := (time.AsTime (printf "%d-%s-01" $year $monthFormatted)) }}
102+
103+
{{ $isDisabled := false }}
104+
{{ if gt $month $currentMonth }}
105+
{{ $isDisabled = true }}
106+
{{ end }}
107+
108+
<a href="/{{ $year }}/{{ $monthDate.Format "Jan" | lower }}"
109+
class="{{ if $isDisabled }}disabled{{ end }}">
110+
{{ $monthDate.Month }}
111+
</a>
112+
{{ end }}
113+
{{ else }}
114+
{{ range (seq 1 12) }}
115+
{{ $month := printf "%02d" . }}
116+
{{ $monthDate := (time.AsTime (printf "%d-%s-01" $year $month)) }}
117+
<a href="/{{ $year }}/{{ $monthDate.Format "Jan" | lower }}">{{ $monthDate.Month }}</a>
118+
{{ end }}
119+
{{ end }}
120+
</div>
121+
{{ end }}
122+
</div>
123+
124+
<div class="h1 breadcrumb">
125+
Site Map
126+
<span>{{ now.Month }} {{ $currentYear }}</span>
127+
</div>
128+
<div class="h3">{{ now.Month }} {{ $currentYear }}</div>
129+
<div class="grid-sitemap-days">
130+
{{ $firstDay := (printf "%d-%02d-01" $currentYear $currentMonth) | time.AsTime }}
131+
{{ $lastDay := $firstDay.AddDate 0 1 -1 }}
132+
{{ range (seq 1 $lastDay.Day) }}
133+
<a href="#">{{ now.Month }} {{ . }}</a>
134+
{{ end }}
135+
</div>
136+
137+
<div class="h1 breadcrumb">
138+
Site Map
139+
<span>{{ now.Month }} {{ $currentYear }}</span>
140+
<span class="active">{{ now.Day }}</span>
141+
</div>
142+
<div class="h3">{{ now.Month }} {{ now.Day }}, {{ $currentYear }}</div>
143+
<div>
144+
<div class="h4">Articles</div>
145+
<div class="articles-list">
146+
<a href="#">Dartmouth College Basketball Players Halt Effort to Unionize</a>
147+
<a href="#">Video shows Lego display fall during balloon-drop at arcade</a>
148+
<a href="#">Art display falls, injures 10 people at NYE party in Peabody, Mass.</a>
149+
<a href="#">‘Fairy’ creature that swims upside down discovered in a roadside pond in India</a>
150+
<a href="#">‘Mythical’ deep-sea creature — found by a submarine — is new species off Japan</a>
151+
<a href="#">Armed ex-mayoral candidate robs Dollar General, leads FL cops on chase, feds say</a>
152+
<a href="#">Collapsed KC Family Dollar was missing concrete pillar car crash took out years ago</a>
153+
</div>
154+
</div>
155+
</section>
156+
157+
{{ partial "footer" . }}
158+
{{- end }}

layouts/shortcodes/big-news.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ <h3 class="h4"><a href="#" data-tb-link data-tb-title>Hurricane Irma's menacing
2020
<h1 class="h1"><a href="#" data-tb-link data-tb-title>Hurricane Florence now a Category 4 &mdash; state of emergency declared</a></h1>
2121
</div>
2222
<figure>
23-
<a href="#" data-tb-link><img src="https://www.mcclatchydc.com/latest-news/2dp7ij/picture218293685/alternates/LANDSCAPE_1140/Flood_td_103_LEDE.JPG"></a>
23+
<a href="#" data-tb-link><img src="https://www.mcclatchydc.com/public/latest-news/2dp7ij/picture218293685/alternates/LANDSCAPE_1140/Flood_td_103_LEDE.JPG"></a>
2424
<figcaption>Officers carry June Loch to dry land after she was rescued from her home in the Pine Glen subdivision of Columbia, S.C. on Oct. 5, 2015. Record rainfall that October triggered floods that killed at least 19 people in South Carolina and caused extensive damage to neighborhoods that had never flooded before. Despite that disaster, only 9 percent of South Carolina households had purchased flood insurance by May of last year. <span class="byline"><a href="#">Tim Dominick</a></span></figcaption>
2525
</figure>
2626
</article>
2727
<div class="grid featured" data-children="3">
2828
<article class="card" data-tb-region-item>
2929
<figure>
30-
<a href="#" data-tb-link><img src="https://www.mcclatchydc.com/news/nation-world/national/7g1ahc/picture174166396/alternates/LANDSCAPE_640/Hurricane%20Irma%202"></a>
30+
<a href="#" data-tb-link><img src="https://www.mcclatchydc.com/public/news/nation-world/national/7g1ahc/picture174166396/alternates/LANDSCAPE_640/Hurricane%20Irma%202"></a>
3131
</figure>
3232
<div class="package">
3333
<h3 class="h4"><a href="#" data-tb-link data-tb-title>Looking for water or gas? Here are some places that have them </a></h3>
@@ -36,7 +36,7 @@ <h3 class="h4"><a href="#" data-tb-link data-tb-title>Looking for water or gas?
3636
</article>
3737
<article class="card" data-tb-region-item>
3838
<figure>
39-
<a href="#" data-tb-link><img src="https://www.miamiherald.com/news/weather/hurricane/c3x8sb/picture172257337/alternates/LANDSCAPE_640/Coconut%20Grove%20Irma%2004%20EKM%20(1)"></a>
39+
<a href="#" data-tb-link><img src="https://www.miamiherald.com/public/news/weather/hurricane/c3x8sb/picture172257337/alternates/LANDSCAPE_640/Coconut%20Grove%20Irma%2004%20EKM%20(1)"></a>
4040
</figure>
4141
<div class="package">
4242
<h3 class="h4"><a href="#" data-tb-link data-tb-title>Hurricane Irma makes landfall in the Carribean: where's she headed next</a></h3>
@@ -45,7 +45,7 @@ <h3 class="h4"><a href="#" data-tb-link data-tb-title>Hurricane Irma makes landf
4545
</article>
4646
<article class="card" data-tb-region-item>
4747
<figure>
48-
<a href="#" data-tb-link><img src="https://www.mcclatchydc.com/news/nation-world/national/w763tv/picture172700996/alternates/LANDSCAPE_640/AP_17254522905028"></a>
48+
<a href="#" data-tb-link><img src="https://www.mcclatchydc.com/public/news/nation-world/national/w763tv/picture172700996/alternates/LANDSCAPE_640/AP_17254522905028"></a>
4949
</figure>
5050
<div class="package">
5151
<h3 class="h4"><a href="#" data-tb-link data-tb-title>Hurrican Irma makes landfall in the Carribean: where's she headed next</a></h3>

static/qa/labs/index.html~

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@
21712171
<figure>
21722172
<a href="https://www.fresnobee.com/news/local/education-lab/article245163350.html#storylink=mainstage" class="image-link-macro kfocusable" title="Fresno-area schools find ways around California’s COVID-19 watch list. Can they do that?">
21732173

2174-
<img src="https://www.mcclatchy-wires.com/incoming/hz1ccc/picture245164215/alternates/LANDSCAPE_768/Virus_Outbreak_Florida_School_80878.jpg" alt="Fresno-area schools find ways around California’s COVID-19 watch list. Can they do that?">
2174+
<img src="https://www.mcclatchy-wires.com/public/incoming/hz1ccc/picture245164215/alternates/LANDSCAPE_768/Virus_Outbreak_Florida_School_80878.jpg" alt="Fresno-area schools find ways around California’s COVID-19 watch list. Can they do that?">
21752175

21762176

21772177

0 commit comments

Comments
 (0)