-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplified authorlist.html (with the help of chatGPT!)
- Loading branch information
Showing
4 changed files
with
47 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,31 @@ | ||
{{ $members := where .Site.Pages "Section" "members"}} | ||
{{ $members := where .Site.Pages "Section" "members" }} | ||
{{ $pun_count := 0 }} | ||
{{ with .Params.authors }} | ||
{{ $pun_count = len . }} | ||
{{ end }} | ||
|
||
{{ if eq $pun_count 2 }} | ||
|
||
{{ range .Params.authors }} | ||
{{ if (eq (len .) 2) }} | ||
{{ $author := . }} | ||
{{ if .Params.authors }} | ||
{{ $pun_count = len .Params.authors }} | ||
|
||
{{ range $index, $author := .Params.authors }} | ||
{{ if (eq (len $author) 2) }} | ||
{{ $found := false }} | ||
{{ $separator := "," }} | ||
{{ if eq $index (sub $pun_count 1) }}{{ $separator = "" }}{{ end }} | ||
{{ if eq $pun_count 1 }}{{ $separator = "." }}{{ end }} | ||
{{ range $members }} | ||
{{ if in .Params.tags (index $author 1)}} | ||
{{ if eq $pun_count 1 }} | ||
|
||
<a href="{{ .Permalink }}" class="link black bg-animate dim b"> | ||
{{ printf "%s" (index $author 0)}} | ||
</a> | ||
{{ else }} | ||
<a href="{{ .Permalink }}" class="link black bg-animate dim b"> | ||
{{ printf "%s" (index $author 0)}} | ||
</a> | ||
{{ end }} | ||
{{ end }} | ||
{{ if in .Params.tags (index $author 1) }} | ||
{{ $found = true }} | ||
<a href="{{ .Permalink }}" class="link black bg-animate dim b"> | ||
{{ printf "%s%s" (index $author 0) $separator }} | ||
</a> | ||
{{ end }} | ||
{{ end }} | ||
{{ else }} | ||
{{ if eq $pun_count 1 }} | ||
{{ printf "%s." (index . 0) }} | ||
{{ else }} | ||
{{ printf "%sl" (index . 0) }} | ||
{{ end }} | ||
{{ end }} | ||
{{ $pun_count = sub $pun_count 1 }} | ||
{{ end }} | ||
|
||
{{ else if eq $pun_count 1 }} | ||
|
||
{{ range .Params.authors }} | ||
{{ if (eq (len .) 2) }} | ||
{{ $author := . }} | ||
{{ range $members }} | ||
{{ if in .Params.tags (index $author 1)}} | ||
<a href="{{ .Permalink }}" class="link black bg-animate dim b"> | ||
{{ printf "%s" (index $author 0)}} | ||
</a> | ||
{{ end }} | ||
{{ if not $found }} | ||
{{ printf "%s%s" (index $author 0) $separator }} | ||
{{ end }} | ||
{{ else }} | ||
{{ printf "%s." (index . 0) }} | ||
{{ end }} | ||
{{ $pun_count = sub $pun_count 1 }} | ||
{{ end }} | ||
|
||
{{ else }} | ||
|
||
{{ range .Params.authors }} | ||
{{ if (eq (len .) 2) }} | ||
{{ $author := . }} | ||
{{ range $members }} | ||
{{ if in .Params.tags (index $author 1)}} | ||
{{ if eq $pun_count 1 }} | ||
<a href="{{ .Permalink }}" class="link black bg-animate dim b"> | ||
{{ printf "%s." (index $author 0)}} | ||
</a> | ||
{{ else }} | ||
<a href="{{ .Permalink }}" class="link black bg-animate dim b"> | ||
{{ printf "%s," (index $author 0)}} | ||
</a> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ else }} | ||
{{ if eq $pun_count 1 }} | ||
{{ printf "%s." (index . 0) }} | ||
{{ else }} | ||
{{ printf "%s," (index . 0) }} | ||
{{ end }} | ||
{{ $separator := "," }} | ||
{{ if eq $index (sub $pun_count 1) }}{{ $separator = "" }}{{ end }} | ||
{{ if eq $pun_count 1 }}{{ $separator = "." }}{{ end }} | ||
{{ printf "%s%s" (index $author 0) $separator }} | ||
{{ end }} | ||
{{ $pun_count = sub $pun_count 1 }} | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
{{ $section := . }} | ||
{{ $section_count := len $section }} | ||
{{ $section_name := "Publications" }} | ||
<div class="relative w-100 mb2"> | ||
<section class="w-100 mw8"> | ||
{{ range $section }} | ||
<div class="bb b--black-10 relative w-100 mb2 nested-copy-line-height" style="background-color:rgb(252,251,248)"> | ||
<div class="ph3 pv2 gray overflow-hidden"> | ||
<h1 class="f4 black mb0"> | ||
[{{ substr .Date 0 4 }}] | ||
<a href="{{ .Permalink }}" class="link black dim"> | ||
{{ .Title }} | ||
</a> | ||
</h1> | ||
<div class="mb0 near-black f5"> | ||
{{ partial "authorList.html" . }} | ||
<div class="relative w-100 mb2"> | ||
<section class="w-100 mw8"> | ||
{{ $counter := $section_count }} <!-- Start the counter from the total number of publications --> | ||
{{ range sort $section "Date" "desc" }} <!-- Sort by date in descending order --> | ||
<div class="bb b--black-10 relative w-100 mb2 nested-copy-line-height" style="background-color:rgb(252,251,248)"> | ||
<div class="ph3 pv2 gray overflow-hidden"> | ||
<h1 class="f4 black mb0"> | ||
{{ $counter }}. [{{ substr .Date 0 4 }}] | ||
<a href="{{ .Permalink }}" class="link black dim"> | ||
{{ .Title }} | ||
</a> | ||
</h1> | ||
<div class="mb0 near-black f5"> | ||
{{ partial "authorList.html" . }} | ||
<br> | ||
{{ partial "journal-link-bar.html" . }} | ||
</div> | ||
<div class='near-black'> | ||
<a href="{{.Permalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt1 ph2 pv1" style="background-color:rgb(230,225,230)">Read More</a> | ||
</div> | ||
{{ partial "journal-link-bar.html" . }} | ||
</div> | ||
<div class='near-black'> | ||
<a href="{{.Permalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt1 ph2 pv1" style="background-color:rgb(230,225,230)">Read More</a> | ||
</div> | ||
</div> | ||
{{ end }} | ||
</section> | ||
</div> | ||
</div> | ||
{{ $counter = sub $counter 1 }} <!-- Decrement the counter for each publication --> | ||
{{ end }} | ||
</section> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ <h1>{{ index $titleCards . }}</h1> | |
</section> | ||
</article> | ||
{{ end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters