changes working

This commit is contained in:
akilan
2020-05-10 20:47:17 +04:00
parent 8c14650b51
commit 2fca76e753
154 changed files with 6271 additions and 1 deletions

View File

@@ -0,0 +1,61 @@
{{ $authors := partialCached "func/GetArticleAuthors" . .File.UniqueID }}
{{ if eq (len $authors) 1 }}
{{ with $author := index $authors 0 }}
<a href="{{ .URL }}" class="article-author-link">
{{ with .avatar }}
<div class="article-author-avatar">
<img src="{{ . }}" />
</div>
{{ end }}
{{ with .name }}
<strong>{{ . }}</strong>
{{ end }}
<span class="hide-on-mobile">,&nbsp;</span>
</a>
{{ end }}
{{ else }}
<div class="article-coauthors-container">
{{ $avatarsWidth:= mul (len $authors) 15 }}
<span id="collapsedCoauthors" class="article-coauthors-collapsed">
<div class="article-coauthors-list" style="width: {{ $avatarsWidth }}px;">
{{ range $index, $author := $authors }}
{{ with .avatar }}
<div class="article-coauthors-avatar" style="left: {{ mul $index 15 }}px;">
<img src="{{ . }}" />
</div>
{{ end }}
{{ end }}
</div>
<strong class="article-coauthors-name-container">
{{ range $index, $author := $authors }}
{{ .firstname }}{{ if ne (add $index 1) (len $authors) }},{{ end }}
{{ end }}
</strong>
<div class="article-coauthors-icon-container">
{{ partial "icons/ui/toggle-open.html" . }}
</div>
</span>
<ul id="uncollapsedCoauthors" class="article-coauthors-list-open hidden">
<div id="uncollapsedAction" class="article-icon-open-container">
{{ partial "icons/ui/toggle-closed.html" . }}
</div>
{{ range $index, $author := $authors }}
<li class="article-coauthors-list-item-open">
<a href="{{ .URL }}" class="article-author-link">
{{ with $author.avatar }}
<div class="article-coauthor-avatar-open">
<img src="{{ . }}" />
</div>
{{ end }}
<strong class="article-author-name-open">{{ .name }}</strong>
</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ $script := resources.Get "js/collapseAuthors.js" }}
<script src="{{ $script.RelPermalink }}"></script>

View File

@@ -0,0 +1,19 @@
<section id="articleHero" class="section narrow">
<div class="article-hero">
<header class="article-header">
<h1 class="article-hero-heading">{{ .Page.Params.Title }}</h1>
<div class="article-hero-subtitle">
<div class="article-meta">
{{ partial "article/authors.html" . }}
{{ .Page.Date.Format "January 2, 2006" }}
{{ with .Page.Params.timetoread }} • {{ . }} min read{{ end }}
</div>
</div>
</header>
{{ with .Page.Params.hero }}
<div class="article-hero-image" id="ArticleImage__Hero">
<img src="{{ . }}">
</div>
{{ end }}
</div>
</section>

View File

@@ -0,0 +1,58 @@
{{/*
Prints the next 2 articles in the same section or, if less or 2 found, the first (and potentially second) of the section.
@author @regisphilibert @mountainbug95
@context Type Page (.)
@access public
*/}}
{{/* declaring next empty slice */}}
{{ $next := slice }}
{{/* Checking if current article has a PrevInSection (Prev as we are ordering dsc here.) */}}
{{ with .PrevInSection }}
{{ $next = $next | append . }}
{{/* Checking for that "next" article own "next" to fill the "second next" */}}
{{ with .PrevInSection }}
{{ $next = $next | append . }}
{{ end }}
{{ end }}
{{/* If the number of found "next article" is less than two we need to find the first and potentially second article
of the whole section and append them to our $next slice. */}}
{{ $diff := sub 2 (len $next) }}
{{ if $diff }}
{{/* We use that diff number (if > 0) to grab the first x number of articles */}}
{{ $articles := partialCached "func/GetArticles" . "articles"}}
{{ $next = $next | append (first $diff $articles) }}
{{ end }}
<section id="articleNext" class="section nartrow">
<h3 class="footer-next-heading">More articles from {{ .Site.Title }}</h3>
<div class="footer-spacer"></div>
<div class="next-articles-grid" numberOfArticles={numberOfArticles}>
<div class="post-row">
{{ range $index, $article := $next }}
<a href="{{ $article.RelPermalink }}" class="article-link"
{{ if not $index}} id="article-link-bigger"{{ end }}>
<div>
<div class="image-container">
<img src="{{ $article.Params.hero }}" class="article-image" />
</div>
<div>
<h2 class="article-title">
{{ $article.Params.title }}
</h2>
<p class="article-excerpt">
{{ $article.Params.excerpt }}
</p>
<div class="article-metadata">
{{ $article.Date | dateFormat "January 1, 2006" }}{{ with $article.Params.timeToRead }} · {{ $article.Params.timeToRead }} min read{{ end }}
</div>
</div>
</div>
</a>
{{ end }}
</div>
</div>
</section>

View File

@@ -0,0 +1,14 @@
<aside id="progressBar" class="aside-container">
<div class="aside-align">
<div>
<div class="overlap-container">
</div>
</div>
</div>
<div class="progress-container" tabIndex={-1}>
<div class="track-line" aria-hidden="true">
<div id="progressIndicator" class="progress-line"></div>
</div>
</div>
</aside>