Skip to content

Commit

Permalink
feat: add latest news
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <[email protected]>
  • Loading branch information
fzipi committed Feb 21, 2024
1 parent 6e2009d commit f29fe0c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
9 changes: 9 additions & 0 deletions assets/scss/_sponsors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.gold-sponsor {
width: 100%;
}
.silver-sponsor {
width: 80%;
}
.bronze-sponsor {
width: 60%;
}
1 change: 1 addition & 0 deletions assets/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
@import "shortcodes/toc";
@import "shortcodes/intro";
@import "shortcodes/youtube-enhanced";
@import "sponsors";
@import "home";
6 changes: 5 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2 class="subhero">{{ i18n "subhero" }}</h2>
width="585"
height="530"
src="{{ "images/undraw_safe_re_kiil.svg" | relURL }}"
alt="Teamwork"
alt="Rules protecting a safe"
loading="eager"
decoding="async"
/>
Expand Down Expand Up @@ -47,6 +47,10 @@ <h2>{{ i18n "sectionTitle3" }}</h2>

<hr />

{{ partial "latest-news.html" . }}

<hr />

{{ partial "sponsors.html" . }}

{{ end }}
5 changes: 5 additions & 0 deletions layouts/partials/latest-news.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h3>Latest Blog Posts</h3>

{{ range ( where .Site.RegularPages "Type" "blog" | first 3 ) }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{end}}
25 changes: 14 additions & 11 deletions layouts/partials/sponsors.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ <h3>Call for Sponsors</h3>

{{ range $name, $kind := .Site.Data.sponsors }}
<h3>{{ strings.FirstUpper $name }} Sponsors</h3>

<div class="columns columns-2">
{{ $colnum := 2 }}
<div class="columns columns-{{ $colnum }}">
{{ range $kind }}
<div class="column">
<img
caption="{{ .caption }}"
width="300"
height="150"
loading="lazy"
src="{{ relURL .logo }}"
link="{{ .link }}"
/>
<div class="column {{ lower $name }}-sponsor">
<a href="{{ .link }}">
<img
caption="{{ .caption }}"
width="300"
height="150"
loading="lazy"
src="{{ relURL .logo }}"
link="{{ .link }}"
/>
</a>
</div>
{{ end }}
{{ $colnum = add $colnum 1 }}
</div>
{{ end }}

Expand Down

0 comments on commit f29fe0c

Please sign in to comment.