Skip to content

Commit

Permalink
Add page with informations about posts authors
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye116477 committed Mar 3, 2019
1 parent f2d7830 commit 2069277
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 16 deletions.
11 changes: 10 additions & 1 deletion assets/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ DefaultContentLanguage = "en"
title = "Meghna"
theme = "meghna-hugo"

[taxonomies]
author = "author"
category = "categories"
tag = "tags"

# Menu
[menu]
Expand Down
7 changes: 7 additions & 0 deletions exampleSite/content/author/jamica-jock/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Jamica Jock
email: [email protected]
github: example
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eu magna arcu. Vivamus id hendrerit dui, in elementum ante. Aenean euismod ipsum sed sagittis accumsan. Ut ultrices tincidunt viverra. Mauris eu nisl urna. Proin finibus feugiat tortor ut interdum. Curabitur.
7 changes: 7 additions & 0 deletions exampleSite/content/author/john-doe/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: John Doe
email: [email protected]
github: example
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pulvinar turpis ac est vulputate egestas at vitae nunc. Praesent vestibulum nulla at ligula rutrum, quis cursus tellus tempus. Proin faucibus dapibus auctor. Mauris faucibus imperdiet metus, eget consectetur eros porttitor.
7 changes: 7 additions & 0 deletions exampleSite/content/author/somrat/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Somrat
email: [email protected]
github: example
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet vulputate augue. Duis auctor lacus id vehicula gravida. Nam suscipit vitae purus et laoreet. Donec nisi dolor, consequat vel pretium id, auctor in dui. Nam iaculis, neque ac ullamcorper.
14 changes: 14 additions & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@
translation: View All Post
- id: share
translation: Share
- id: aboutAuthor
translation: About author
- id: contact
translation: Contact
- id: authorsPosts
translation: Author's posts
- id: authorsOfPosts
translation: Authors of posts
- id: authorOfPostsOnBlog
translation: Author of posts on the blog
- id: authorsOfPostsOnBlog
translation: Authors of posts on the blog
- id: blogs
translation: Blogs
14 changes: 14 additions & 0 deletions i18n/pl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@
translation: Wyświetl wszystkie wpisy
- id: share
translation: Podziel się
- id: aboutAuthor
translation: O autorze
- id: contact
translation: Kontakt
- id: authorsPosts
translation: Wpisy autora
- id: authorOfPostsOnBlog
translation: Autor wpisów na blogu
- id: authorsOfPosts
translation: Autorzy wpisów
- id: authorsOfPostsOnBlog
translation: Autorzy wpisów na blogu
- id: blogs
translation: Blog
14 changes: 14 additions & 0 deletions layouts/_default/article.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

<article class="col-lg-4 col-md-6 col-12 clearfix wow fadeInUp" data-wow-duration="500ms">
<div class="post-block">
<div class="media-wrapper">
{{ with .Params.image }}<img src="{{ . | absURL }}" alt="post-image" class="img-fluid">{{ end }}
</div>

<div class="content">
<h3><a href="{{ .Permalink }}">{{ with .Params.name}}{{.}}{{else}}{{ .Title }}{{end}}</a></h3>
<p>{{ .Summary }}</p>
<a class="btn btn-transparent" href="{{ .Permalink }}">{{ i18n "readMore" }}</a>
</div>
</div>
</article>
14 changes: 1 addition & 13 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@

{{ range .Data.Pages }}
{{"<!-- single blog post -->" | safeHTML}}
<article class="col-lg-4 col-md-6 col-12 clearfix wow fadeInUp" data-wow-duration="500ms">
<div class="post-block">
<div class="media-wrapper">
{{ with .Params.image }}<img src="{{ . | absURL }}" alt="post-image" class="img-fluid">{{ end }}
</div>

<div class="content">
<h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
<p>{{ .Summary }}</p>
<a class="btn btn-transparent" href="{{ .Permalink }}">{{ i18n "readMore" }}</a>
</div>
</div>
</article>
{{ .Render "article" }}
{{"<!-- /single blog post -->" | safeHTML}}
{{ end }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="col-lg-8 offset-lg-2 text-center">
<h1>{{ .Title }}</h1>
<ul class="list-inline mb-50">
<li class="list-inline-item">{{ .Params.author }}</li>
<li class="list-inline-item"><a href="/author/{{ urlize .Params.author}}">{{ .Params.author }}</a></li>
<li class="list-inline-item">{{ dateFormat "Monday, Jan 2, 2006" .Date }}</li>
</ul>
{{ with .Params.image }}<img class="img-fluid mb-50" src="{{ . | absURL }}" alt="blog-image">{{ end }}
Expand Down
72 changes: 72 additions & 0 deletions layouts/author/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{{ define "main" }}

{{ partial "navigation.html" . }}
{{ if .Content}}
<section class="section section-bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="title text-center">
<h2> {{ with i18n "aboutAuthor" }} {{ index (split . " ") 0 }} {{ end }}<span class="color"> {{ with i18n "aboutAuthor" }} {{ index (split . " ") 1 }} {{ end }} </span></h2>
<div class="border-meghna"></div>
</div>
<div class="content text-center">
{{ partial "author-figure" . }}
<hr>
{{ .Content }}
<hr>
<div class="list-group">
{{ with .Params.github }}
<div>
<i class="tf-ion-social-github-outline mr-1"></i>
<span>GitHub: <a href="https://github.com/{{.}}">github.com/{{.}}</a>
</span>
</div>
{{ end }}

{{ with .Params.facebook }}
<div>
<i class="tf-ion-social-facebook-outline mr-1"></i>
<span>Facebook: <a href="https://facebook.com/{{.}}">facebook.com/{{.}}</a>
</span>
</div>
{{ end }}

{{ with .Params.twitter }}
<div>
<i class="tf-ion-social-twitter-outline mr-1"></i>
<span>Twitter: <a href="https://twitter.com/{{.}}">twitter.com/{{.}}</a>
</span>
</div>
{{ end }}

{{ with .Params.instagram }}
<div>
<i class="tf-ion-social-instagram-outline mr-1"></i>
<span>Instagram: <a href="https://instagram.com/{{.}}">instagram.com/{{.}}</a>
</span>
</div>
{{ end }}
</div>
</div>
</div>
</div>
</section>
{{ end }}
<section class="section">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="title text-center">
<h2> {{ with i18n "authorsPosts" }} {{ index (split . " ") 0 }} {{ end }}<span class="color"> {{ with i18n "authorsPosts" }} {{ index (split . " ") 1 }} {{ end }}</h2>
<div class="border-meghna"></div>
</div>
</div>
{{ range .Data.Pages }}
{{ .Render "article" }}
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}
41 changes: 41 additions & 0 deletions layouts/author/terms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{ define "main" }}
{{ partial "navigation.html" . }}
<section class="section">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="title text-center">
<h2> {{ with i18n "authorsOfPosts" }} {{ index (split . " ") 0 }} <span class="color"> {{ index (split . " ") 1 }} {{ index (split . " ") 2 }} {{ end }} </span></h2>
<div class="border-meghna"></div>
</div>
</div>

{{ range .Data.Pages }}
<article class="col-lg-4 col-md-6 col-12 clearfix wow fadeInUp" data-wow-duration="500ms">
<div class="post-block">
<div class="media-wrapper">
<div class="content">
<figure>
{{ if .Params.photo }}
<img class="rounded-circle img-fluid pt-2" src="{{.Params.Photo}}">
{{else if .Params.email}}
<img class="rounded-circle img-fluid pt-2" src="https://www.gravatar.com/avatar/{{ md5 .Params.email }}?s=128&pg&d=identicon">
{{ end }}
<figcaption>
<h5 class="font-weight-bold">
{{ .Params.name }}
</h5>
<p>{{ .Summary }}</p>
<a class="btn btn-transparent" href="{{ .Permalink }}">{{ i18n "readMore" }}</a>
</figcaption>
</figure>
</div>
</div>
</div>
</article>
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}
12 changes: 12 additions & 0 deletions layouts/partials/author-figure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<figure>
{{ if .Params.photo }}
<img class="rounded-circle img-fluid" src="{{.Params.Photo}}">
{{else if .Params.email}}
<img class="rounded-circle img-fluid" src="https://www.gravatar.com/avatar/{{ md5 .Params.email }}?s=128&pg&d=identicon">
{{ end }}
<figcaption>
<h5 class="font-weight-bold">
{{ .Params.name }}
</h5>
</figcaption>
</figure>
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ .Hugo.Generator }}

<title>{{ if .IsHome }}{{ .Site.Title }}{{" | "}}{{ .Site.Params.Description }}{{ else if .IsPage}}{{ .Title }}{{" | "}}{{ .CurrentSection.Title }}{{else}}{{ .Title }}{{" | "}}{{ .Site.Title }}{{ end }}</title>
<title>{{ if .IsHome }}{{ .Site.Title }}{{" | "}}{{ .Site.Params.Description }}{{ else if .IsPage}}{{ .Title }}{{" | "}}{{ .CurrentSection.Title }}{{else if eq .Section "author" }}{{if .Params.name}}{{.Params.name}} | {{ i18n "authorOfPostsOnBlog" }} „{{.Site.Title}}" {{else}}{{ i18n "authorsOfPostsOnBlog" }} „{{.Site.Title}}"{{end}}{{else if eq .Section "blog" }}{{ i18n "blogs" }} | {{ .Site.Title}}{{else}}{{ .Title }}{{with .Params.Description}}{{" | " .}}{{ end }}{{ end }}</title>


{{"<!-- Favicon -->" |safeHTML}}
Expand Down

0 comments on commit 2069277

Please sign in to comment.