123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <div class="news-main container">
- <div class="row">
- {{ $pages := first 4 (where .Site.Pages "Params.type" "main") }}
- <!-- index 0 -->
- <div class="col-lg-6">
- {{ with index $pages 0 }}
- <div class="border rounded overflow-hidden position-relative h-100">
- <a href="{{ .Permalink }}">
- <img src="{{ .Params.image | relURL }}" alt="{{ .Params.title }}" class="img-fluid main-img">
- </a>
- <div class="p-3 title-info">
- {{ range (.GetTerms "categories") }}
- <a href="{{ .Permalink }}" class="me-2 badge-link">{{ .Params.title }}</a>
- {{ end }}
- <h2>
- <a href="{{ .Params.url }}">{{ .Params.title }}</a>
- </h2>
- <small class="d-block">{{ .Date | time.Format ":date_long" }}</small>
- </div>
- </div>
- {{ end }}
- </div>
- <!-- 右側 -->
- <div class="col-lg-6">
- {{ range $index, $page := $pages }}
- {{ if eq $index 1 }}
- <!-- index 1 -->
- <div class="d-flex mt-3 mt-lg-0 mb-3 border rounded overflow-hidden position-relative">
- <a href="{{ $page.Permalink }}" class="w-100">
- <img src="{{ $page.Params.image | relURL }}" alt="{{ $page.Params.title }}" class="img-fluid main-img">
- </a>
- <div class="p-3 title-info">
- {{ range ($page.GetTerms "categories") }}
- <a href="{{ .Permalink }}" class="me-2 badge-link">{{ .LinkTitle }}</a>
- {{ end }}
- <h2>
- <a href="{{ $page.Params.url }}">{{ $page.Params.title }}</a>
- </h2>
- <small class="d-block">{{ $page.Date | time.Format ":date_long" }}</small>
- </div>
- </div>
- {{ end }}
- {{ if eq $index 2 }}
- <!-- index 2 & 3 -->
- <div class="row g-3">
- {{ end }}
- {{ if or (eq $index 2) (eq $index 3) }}
- <div class="col-sm-6">
- <div class="border rounded overflow-hidden position-relative h-100">
- <a href="{{ $page.Permalink }}">
- <img src="{{ $page.Params.image | relURL }}" alt="{{ $page.Params.title }}" class="img-fluid">
- </a>
- <div class="p-3 title-info">
- <h2>
- <a href="{{ $page.Params.url }}">{{ $page.Params.title }}</a>
- </h2>
- <small class="td-block">{{ $page.Date | time.Format ":date_long" }}</small>
- </div>
- </div>
- </div>
- {{ end }}
- {{ if eq $index 3 }}
- </div>
- {{ end }}
- {{ end }}
- </div>
- </div>
- </div>
- <!-- <div class="news-main mt-3 mt-lg-0">
- {{ range first 2 (where .Site.Pages "Params.type" "main") }}
- <div class="col-12 mb-3 d-flex flex-column-reverse flex-lg-column">
- <div>
- <section class="news-info">
- {{ range (.GetTerms "categories") }}
- <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
- {{ end }}
- <small>{{ .Date | time.Format ":date_long" }}</small>
- </section>
- <h2 class="post-title my-0 my-lg-3">
- <a href="{{ .Params.url }}">{{ .Params.title }}</a>
- </h2>
- </div>
- <a href="{{ .Permalink }}">
- <img class="img-fluid" src="{{ .Params.image | relURL }}" alt="" />
- </a>
- </div>
- {{ end }}
- </div> -->
|