Skip to content

Commit 94de6f5

Browse files
committed
Ready case studies shortcode for Docsy
This changes the HTML on the site landing page(s), not the rendering within the Case Studies section.
1 parent 8de4c03 commit 94de6f5

File tree

2 files changed

+65
-16
lines changed

2 files changed

+65
-16
lines changed

assets/scss/_custom.scss

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,57 @@ body.td-search {
19281928
color: #ffffff !important;
19291929
}
19301930

1931+
body.td-home section.case-studies {
1932+
h2, h3 {
1933+
text-align: center;
1934+
}
1935+
.case-study-list {
1936+
display: flex;
1937+
flex-direction: row;
1938+
max-width: 80vw;
1939+
margin-left: auto;
1940+
margin-right: auto;
1941+
align-items: stretch;
1942+
gap: clamp(1rem, 4em, 10vw);
1943+
> .case-study-item {
1944+
display: flex;
1945+
flex-direction: column;
1946+
justify-content: space-between;
1947+
width: clamp(6rem, 20%, 50vw);
1948+
picture, picture img {
1949+
height: 4.8rem;
1950+
text-align: center;
1951+
}
1952+
> a {
1953+
display: block;
1954+
text-align: right;
1955+
}
1956+
padding-bottom: 2em;
1957+
}
1958+
}
1959+
padding-top: 4rem;
1960+
}
1961+
1962+
@media screen and (max-width: 768px) {
1963+
.case-study-list {
1964+
justify-content: center;
1965+
flex-wrap: wrap;
1966+
> .case-study-item {
1967+
min-width: 34vw;
1968+
}
1969+
}
1970+
}
1971+
1972+
@media screen and (max-width: 650px) {
1973+
.case-study-list {
1974+
> .case-study-item {
1975+
min-width: 51vw;
1976+
}
1977+
}
1978+
}
1979+
1980+
1981+
19311982
// handle main page features on narrow viewports
19321983
@media screen and (max-width: 768px) {
19331984
.features-container div.feature-box {
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
{{ $caseStudiesSection := site.GetPage "case-studies" }}
2-
{{ if not $caseStudiesSection }}
1+
{{- $caseStudiesSection := site.GetPage "case-studies" -}}
2+
{{- if not $caseStudiesSection -}}
33
{{ errorf "[%s] No case-studies section found. Create content/%s/case-studies/_index.md" $.Page.Lang $.Page.Lang }}
4-
{{ else }}
4+
{{- else -}}
55
{{ $caseStudiesPages := where $caseStudiesSection.Pages "Params.featured" true | first 4 }}
6-
<section id="talkToUs">
7-
<div class="main-section">
8-
<h3 style="text-align: center"><a href="{{ $caseStudiesSection.RelPermalink }}" style="color: #3371E3; font-weight: 400">{{ $caseStudiesSection.LinkTitle }}</a></h3>
9-
<div id="caseStudiesWrapper">
10-
{{ range $caseStudiesPages }}
6+
<section class="case-studies">
7+
<h3><a href="{{ $caseStudiesSection.RelPermalink }}">{{ $caseStudiesSection.LinkTitle }}</a></h3>
8+
<div class="case-study-list">
9+
{{- range $caseStudiesPages -}}
1110
{{ $dark := .Resources.GetMatch "**{dark_logo}*.svg" }}
1211
{{ $logo := .Resources.GetMatch "**{featured_logo}*.svg" }}
1312

1413
{{ if not $logo }}
1514
{{ $logo = .Resources.GetMatch "**logo*.png" }}
1615
{{ end }}
17-
{{ if not $dark }}
18-
{{ $dark = $logo }}
19-
{{ end }}
20-
<div>
16+
{{- if not $dark -}}
17+
{{ $dark = $logo }}
18+
{{- end -}}
19+
<div class="case-study-item">
2120
<picture>
22-
<source srcset={{$dark.RelPermalink}} media="(prefers-color-scheme: dark)">
21+
<source srcset="{{$dark.RelPermalink}}" media="(prefers-color-scheme: dark)">
2322
<img src="{{ $logo.RelPermalink }}" alt="{{ .Title }}">
2423
</picture>
2524
<p>"{{ .Params.quote | truncate 100 }}"</p>
2625
<a href="{{ .RelPermalink }}">{{ T "main_read_more" }}</a>
2726
</div>
28-
{{ end }}
29-
</div>
27+
{{- end -}}
3028
</div>
3129
</section>
32-
{{ end }}
30+
{{- end -}}

0 commit comments

Comments
 (0)