This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-website.git
The following commit(s) were added to refs/heads/master by this push: new 8749501 change category-wise blog layout and format the code within blog 8749501 is described below commit 874950158d12ecf78bfd40b659cdeddbc0a57f30 Author: AemieJ <aemi...@hotmail.co.uk> AuthorDate: Fri Apr 24 11:57:04 2020 +0530 change category-wise blog layout and format the code within blog --- layouts/_default/taxonomy.html | 24 +++++++++++++++++++--- layouts/blog/list.html | 46 ++++++++++++++++++++++++------------------ layouts/blog/post.html | 45 ++++++++++++++++++++++++----------------- 3 files changed, 73 insertions(+), 42 deletions(-) diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index f5ac4cd..6042b69 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -1,10 +1,28 @@ {{ partial "header.html" . }} <div class="body"> - <main role="main"> - {{ range .Pages }} + <div class="toolbar" role="navigation"> + <button class="nav-toggle"> + </button> + </div> + <main role="main" class="nav-container doc blog list"> + <aside class="nav"> + <h3>Categories</h3> + <ul> + {{ range .Site.Taxonomies.categories.Alphabetical }} + <li><a class="category" + href="{{ "/categories/" | relURL }}{{ .Name | urlize }}/">{{ .Name | upper }}<span>{{ .Count }}</span></a> + </li> + {{ end }} + </ul> + </aside> + </main> + <main role="main" class="doc blog list"> + <div> + {{ range .Pages }} {{ .Render "summary" }} - {{ end }} + {{ end }} + </div> </main> </div> diff --git a/layouts/blog/list.html b/layouts/blog/list.html index fad7cd1..4d5e713 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -1,7 +1,7 @@ {{ partial "header.html" . }} <div class="body"> - <div class="toolbar" role="navigation"> + <div class="toolbar" role="navigation"> <button class="nav-toggle"> </button> </div> @@ -9,19 +9,21 @@ <aside class="nav"> <h3>Categories</h3> <ul> - {{ range .Site.Taxonomies.categories.Alphabetical }} - <li><a class="category" href="{{ "/categories/" | relURL }}{{ .Name | urlize }}/">{{ .Name | upper }}<span>{{ .Count }}</span></a></li> - {{ end }} + {{ range .Site.Taxonomies.categories.Alphabetical }} + <li><a class="category" + href="{{ "/categories/" | relURL }}{{ .Name | urlize }}/">{{ .Name | upper }}<span>{{ .Count }}</span></a> + </li> + {{ end }} </ul> </aside> </main> - <main role="main" class="doc blog list"> + <main role="main" class="doc blog list"> <div> {{ $pages := ($.Paginator 3).Pages }} {{ range $pages }} - {{ .Render "summary" }} + {{ .Render "summary" }} {{ end }} - + {{ $page := .Paginator }} {{ if gt $page.TotalPages 1 }} {{ $shouldEllipse := false }} @@ -29,37 +31,41 @@ <ul class="pagination"> {{ if ne $page.PageNumber 1 }} <li class="page-item"> - <a href="{{ $page.First.URL }}" class="page-link" aria-label="First"><span aria-hidden="true">««</span></a> + <a href="{{ $page.First.URL }}" class="page-link" aria-label="First"><span + aria-hidden="true">««</span></a> </li> {{ end }} {{ if $page.HasPrev }} <li class="page-item"> - <a href="{{ $page.Prev.URL }}" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span></a> + <a href="{{ $page.Prev.URL }}" class="page-link" aria-label="Previous"><span + aria-hidden="true">«</span></a> </li> {{ end }} {{ range $page.Pagers }} - {{ if eq . $page }} - <li class="page-item active"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li> - {{ else if and (ge .PageNumber (sub $page.PageNumber 2)) (le .PageNumber (add $page.PageNumber 2)) }} - {{ $shouldEllipse = false }} - <li class="page-item"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li> - {{ else if eq $shouldEllipse false }} - {{ $shouldEllipse = true }} - <li class="page-item disabled"><a class="page-link">…</a></li> - {{ end }} + {{ if eq . $page }} + <li class="page-item active"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li> + {{ else if and (ge .PageNumber (sub $page.PageNumber 2)) (le .PageNumber (add $page.PageNumber 2)) }} + {{ $shouldEllipse = false }} + <li class="page-item"><a href="{{ .URL }}" class="page-link">{{ .PageNumber }}</a></li> + {{ else if eq $shouldEllipse false }} + {{ $shouldEllipse = true }} + <li class="page-item disabled"><a class="page-link">…</a></li> + {{ end }} {{ end }} {{ if $page.HasNext }} <li class="page-item"> - <a href="{{ $page.Next.URL }}" class="page-link" aria-label="Next"><span aria-hidden="true">»</span></a> + <a href="{{ $page.Next.URL }}" class="page-link" aria-label="Next"><span + aria-hidden="true">»</span></a> </li> {{ end }} {{ if ne $page.PageNumber $page.TotalPages }} <li class="page-item"> - <a href="{{ $page.Last.URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">»»</span></a> + <a href="{{ $page.Last.URL }}" class="page-link" aria-label="Last"><span + aria-hidden="true">»»</span></a> </li> {{ end }} </ul> diff --git a/layouts/blog/post.html b/layouts/blog/post.html index def0273..288b14a 100644 --- a/layouts/blog/post.html +++ b/layouts/blog/post.html @@ -2,38 +2,45 @@ <header> {{ if .Params.categories }} - {{ range .Params.categories }}<a class="category" href="{{ "/categories/" | relURL }}{{ . | urlize }}/">{{ upper . }}</a>{{ end }} + {{ range .Params.categories }}<a class="category" + href="{{ "/categories/" | relURL }}{{ . | urlize }}/">{{ upper . }}</a>{{ end }} {{ end }} <h1>{{ .Title }}</h1> </header> <div class="post"> <aside> <div class="summary">{{ .Params.preview }}</div> - Posted on <time itemprop="published" datetime="{{ dateFormat "2006-01-02" .PublishDate }}" title="{{ dateFormat "Monday, January 2, 2006" .PublishDate }}">{{ dateFormat "January 2, 2006" .PublishDate }}</time>, by {{ range $author := .Params.authors }} - {{ with getJSON "https://api.github.com/users/" $author }} - <figure> - <img src="{{ .avatar_url }}" alt="{{ .name }}"><figcaption rel="author">{{ .name }}</figcaption> - </figure> - {{ end }} - {{ end }} - <p> - {{ if .PrevInSection }} - <a class="arrow prev" href="{{ .PrevInSection.RelPermalink }}" title="Previous post: {{ .PrevInSection.Title }}">❮</a> + Posted on <time itemprop="published" datetime="{{ dateFormat "2006-01-02" .PublishDate }}" + title="{{ dateFormat "Monday, January 2, 2006" .PublishDate }}">{{ dateFormat "January 2, 2006" .PublishDate }}</time>, + by {{ range $author := .Params.authors }} + {{ with getJSON "https://api.github.com/users/" $author }} + <figure> + <img src="{{ .avatar_url }}" alt="{{ .name }}"> + <figcaption rel="author">{{ .name }}</figcaption> + </figure> {{ end }} - {{ if .NextInSection }} - <a class="arrow next" href="{{ .NextInSection.RelPermalink }}" title="Next post: {{ .NextInSection.Title }}">❯</a> {{ end }} + <p> + {{ if .PrevInSection }} + <a class="arrow prev" href="{{ .PrevInSection.RelPermalink }}" + title="Previous post: {{ .PrevInSection.Title }}">❮</a> + {{ end }} + {{ if .NextInSection }} + <a class="arrow next" href="{{ .NextInSection.RelPermalink }}" + title="Next post: {{ .NextInSection.Title }}">❯</a> + {{ end }} </p> </aside> <div class="post-content"> {{ $featured := (.Resources.ByType "image").GetMatch "*featured*" }} {{ with $featured }} - {{ if ne $featured.MediaType.SubType "svg" }} - {{ $featured := .Resize "800x q95 Gaussian" }} - <img class="featured" alt="Blog post featured image" src="{{ $featured.RelPermalink }}" width="{{ $featured.Width }}" height="{{ $featured.Height }}"> - {{ else }} - <img class="featured" alt="Blog post featured image" src="{{ $featured.RelPermalink }}" width="800"> - {{ end }} + {{ if ne $featured.MediaType.SubType "svg" }} + {{ $featured := .Resize "800x q95 Gaussian" }} + <img class="featured" alt="Blog post featured image" src="{{ $featured.RelPermalink }}" + width="{{ $featured.Width }}" height="{{ $featured.Height }}"> + {{ else }} + <img class="featured" alt="Blog post featured image" src="{{ $featured.RelPermalink }}" width="800"> + {{ end }} {{ end }} {{ .Content }} </div>