Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions data/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This is used for configuring author information for blog posts.
# Each author is identified by a unique key (e.g., their github username) in all lowercase.
# To get your github avatar URL, go to your profile and right-click on your avatar to copy the image address.
# template:
# name: "John Doe" (Optional)
# title: ""
# image_url: "https://avatars.githubusercontent.com/u/12345678?v=4"
# url: "https://github.com/johndoe"

crem:
# name: ""
title: "LCZero Core Developer"
image_url: "https://avatars.githubusercontent.com/u/11266455?v=4"
url: "https://github.com/mooskagh"

borg:
title: "LCZero Contributor"
image_url: "https://avatars.githubusercontent.com/u/39573933?v=4"
url: "https://github.com/borg323"

naphthalin:
title: "LCZero Contributor"
image_url: "https://avatars.githubusercontent.com/u/40385638?v=4"
url: "https://github.com/naphthalin"

daniel monroe:
title: "LCZero Contributor"
image_url: "https://avatars.githubusercontent.com/u/23456789?v=4"
url: "https://github.com/daniel-monroe"

ghostway:
title: "LCZero Contributor"
image_url: "https://avatars.githubusercontent.com/u/50481015?v=4"
url: "https://github.com/OfekShochat"

lepned:
title: "EngineBattle Developer"
image_url: "https://avatars.githubusercontent.com/u/1504584?v=4"
url: "https://github.com/lepned"

marcogio9:
title: "LCZero Odds Contributor"
image_url: "https://avatars.githubusercontent.com/u/154074772?v=4"
url: "https://github.com/marcogio9"
55 changes: 48 additions & 7 deletions layouts/blog/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,56 @@
<div class="main-container">
<div class="content-container">

<div class="blog-date">{{ .PublishDate.Format "2006-01-02" }}</div>
<h1 class="blog-title">{{ .Title }}</h1>

{{ if .Params.author }}
{{/* Get the author key from front matter */}}
{{ $authorKey := .Params.author }}
{{/* Look up the author in the data file */}}
{{ $authorData := index .Site.Data.authors (lower $authorKey) }}

{{ if $authorData }}
{{ $authorName := $authorData.name | default $authorKey }}
{{/* Author was found in data/authors.yml */}}
<div class="author-box">
{{ with $authorData.image_url }}
<img src="{{ . }}" alt="Photo of {{ $authorName }}" class="author-avatar">
{{ end }}
<div class="author-info">
{{ with $authorData.url }}
<a href="{{ . }}" target="_blank" rel="noopener" class="author-name">{{ $authorName }}</a>
{{ else }}
<span class="author-name">{{ $authorName }}</span>
{{ end }}

<div class="author-meta">
{{ with $authorData.title }}
<span class="author-title">{{ . }}</span>
{{ end }}
{{/* Add a separator if both title and date exist */}}
{{ if and $authorData.title .PublishDate }}
<span class="meta-separator" aria-hidden="true">&middot;</span>
{{ end }}
{{ if .PublishDate }}
<time class="author-date" datetime="{{ .PublishDate.Format "2006-01-02" }}">{{ .PublishDate.Format "January 2, 2006" }}</time>
{{ end }}
</div>
</div>
</div>
{{ else }}
{{/* Fallback/Default: Author not found in data file, just display the name */}}
<div class="author-box author-default">
<div class="author-info">
<span class="author-name">By: {{ $authorKey }}</span>
{{ if .PublishDate }}
<span class="meta-separator" aria-hidden="true">&middot;</span>
<time class="author-date" datetime="{{ .PublishDate.Format "2006-01-02" }}">{{ .PublishDate.Format "January 2, 2006" }}</time>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}

{{if .Draft}}
<div class="banner">
<strong>This is a draft.</strong>
Expand All @@ -15,12 +62,6 @@ <h1 class="blog-title">{{ .Title }}</h1>

{{ .Content }}

{{ if .Params.author }}
<div class="last-updated">
Posted by: {{ .Params.author }}
</div>
{{ end }}

<div class="bottom-nav">
{{ with .PrevInSection }}
<a class="previous" href="{{.Permalink}}">
Expand Down
30 changes: 21 additions & 9 deletions layouts/blog/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,40 @@ <h1 class="title">{{ .Title }}</h1>
{{if default true .Params.show_contents}}
{{ $paginator := .Paginate .Pages }}
{{ range $paginator.Pages }}
<div class="blog-summary">
<div class="blog-summary-title">
<a href="{{ .Permalink }}">
<span class="blog-summary-date">{{ .PublishDate.Format "2006-01-02" }}</span>{{ .Title }}
</a>
<div class="blog-summary">
<div class="blog-summary-header">
{{ if .PublishDate }}
<time class="blog-summary-date" datetime="{{ .PublishDate.Format "2006-01-02" }}">{{ .PublishDate.Format "2006-01-02" }}</time>
{{ end }}
<h2 class="blog-summary-title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h2>
</div>

{{/* Fetch and display the author name */}}
{{ with .Params.author }}
{{ $authorKey := . }}
{{ $authorData := index site.Data.authors $authorKey }}
{{ $authorName := $authorData.name | default $authorKey }}
<div class="blog-summary-meta">
By {{ $authorName }}
</div>
{{ end }}

{{ if .Params.image }}
<img alt="{{ .Title }}" src="{{ .Params.image }}" />
{{ end}}
<p>{{ .Summary }}</p>
<p class="blog-summary-content">{{ .Summary }}</p>
</div>
{{ end }}

<!-- Pagination navigation -->
{{ if gt $paginator.TotalPages 1 }}
<nav class="pagination">
<a {{ if $paginator.HasPrev }}href="{{ $paginator.Prev.URL }}" class="pagination-prev" {{ else }}class="pagination-prev pagination-disabled"{{ end }}>← Previous</a>

<span class="pagination-current">Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }}</span>

<a {{ if $paginator.HasNext }}href="{{ $paginator.Next.URL }}" class="pagination-next" {{ else }}class="pagination-next pagination-disabled"{{ end }}>Next →</a>
</nav>
</nav>
{{ end }}
{{ end }}
{{ end }}
132 changes: 132 additions & 0 deletions themes/leela/assets/css/blog.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
.blog-summary {
margin-top: 3rem; /* Creates vertical space between posts */
padding-bottom: 2rem;
border-bottom: 1px solid var(--color-border-primary);
}

.blog-summary:last-of-type {
border-bottom: none;
padding-bottom: 0;
}

/* NEW: Flex container for the date and title */
.blog-summary-header {
display: flex;
align-items: center;
gap: 1rem; /* Space between date and title */
}

/* The date "pill" style */
.blog-summary-date {
flex-shrink: 0; /* Prevents the date from shrinking */
background-color: var(--color-bg-secondary);
color: var(--color-text-tertiary);
font-size: 0.875rem;
padding: 0.3rem 0.6rem;
border-radius: 5px;
white-space: nowrap;
}

/* The title heading element */
.blog-summary-title {
margin: 0;
font-size: var(--font-size-h4);
font-weight: 600;
}

/* NEW: The author meta line */
.blog-summary-meta {
margin-top: 0.5rem;
font-style: italic;
}

/* The summary text paragraph */
.blog-summary-content {
margin-top: 0.75rem;
}


.author-box {
display: flex;
flex-wrap: wrap; /* Allows content to wrap on smaller screens */
gap: 1.5rem;
align-items: flex-start;
padding: 2rem;
margin-block: 2.5rem; /* Vertical margin for spacing */
background-color: var(--color-bg-secondary);
border: 1px solid var(--color-border-primary);
border-radius: 12px;
box-shadow: 0 4px 12px var(--shadow-color);
}

.author-box {
display: flex;
align-items: center;
gap: 1rem;
padding: 0.875rem 1.25rem;
margin-block: 2rem 2.5rem;
background-color: var(--color-bg-secondary);
border-left: 4px solid var(--color-accent);
border-radius: 8px;
box-shadow: 0 4px 12px -4px var(--shadow-color);
}

.author-avatar {
width: 50px;
height: 50px;
border-radius: 50%;
object-fit: cover;
flex-shrink: 0;
}

.author-info {
flex-grow: 1;
}

.author-name {
font-size: 1.125rem;
font-weight: 600;
color: var(--color-text-primary);
}

.author-meta {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 0.125rem;
}

.author-title {
font-size: 0.9rem;
color: var(--color-text-secondary);
font-style: italic;
}

.author-date {
font-size: 0.9rem;
color: var(--color-text-secondary);
}

.meta-separator {
color: var(--color-text-secondary);
}

/* --- Fallback Styling --- */
.author-default .author-info {
display: flex;
align-items: center;
gap: 0.5rem;
}

.author-default .author-name,
.author-default .author-date,
.author-default .meta-separator {
font-size: 1rem;
font-style: italic;
color: var(--color-text-tertiary);
}

.author-default .author-name {
font-weight: 400;
}
28 changes: 0 additions & 28 deletions themes/leela/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -707,34 +707,6 @@ footer {
color: var(--color-footer-icon);
}

/* Blog list */
.blog-summary {
margin-top: 48px;
}

.blog-date {
font-size: 0.9rem;
font-weight: 800;
}

.blog-title {
margin-top: 0;
}

.blog-summary-date {
font-size: 0.9rem;
font-weight: 800;
margin-right: 8px;
color: var(--color-text-secondary);
background-color: var(--color-footer-bg);
padding: 8px;
border-radius: 3px;
}

.blog-summary-title a {
font-size: 1.2rem;
}

nav.pagination {
display: flex;
justify-content: space-between;
Expand Down
3 changes: 2 additions & 1 deletion themes/leela/layouts/_partials/head/css.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{ $mainCss := resources.Get "css/main.css" }}
{{ $syntaxCss := resources.Get "css/syntax.css" }}
{{ $blogCss := resources.Get "css/blog.css" }}
{{ $iconsCss := resources.Get "css/icons.css" }}
{{ $css := slice $mainCss $syntaxCss $iconsCss | resources.Concat "css/bundle.css" }}
{{ $css := slice $mainCss $syntaxCss $blogCss $iconsCss | resources.Concat "css/bundle.css" }}

{{- with $css }}
{{- if hugo.IsDevelopment }}
Expand Down