Skip to content

Commit

Permalink
Add guest blog ability
Browse files Browse the repository at this point in the history
  • Loading branch information
jackalyst committed Apr 21, 2022
1 parent 29441e2 commit a0744f5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions layouts/_default/blog-post.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,34 @@ <h2>Table of Contents</h2>
<hr>

<div class="author-box flex_wrapper">
<div class="author-box-img">
{{ $a := .Params.author }}
{{ $t := .Site.GetPage "/team" }}
{{ range $t.Data.Pages }}
{{ if eq .Params.name $a }}
<a href="{{.Site.BaseURL}}/team/{{ .Params.slug }}"><img src="{{ .Params.profile }}" alt="{{$a}}"></a>
{{ end }}
{{end}}
</div>
<div class="author-box-text flex_dir_col flex_jc_center">
<p>WRITTEN BY </p>
{{ range $t.Data.Pages }}
{{ if eq .Params.name $a }}
<p><a href="{{.Site.BaseURL}}/team/{{ .Params.slug }}" style="text-decoration: none;">{{ $a }}</a></p>
{{ end }}
{{end}}
</div>
{{ if .Params.guest }}
<div class="author-box-img">
<img src="/img/guests/guest.png" alt="">
</div>
<div class="author-box-text flex_dir_col flex_jc_center">
<p>GUEST POST WRITTEN BY </p>
<p>{{ .Params.guest }}</p>
</div>
{{ else }}
<div class="author-box-img">
{{ $a := .Params.author }}
{{ $t := .Site.GetPage "/team" }}
{{ range $t.Data.Pages }}
{{ if eq .Params.name $a }}
<a href="{{.Site.BaseURL}}/team/{{ .Params.slug }}"><img src="{{ .Params.profile }}" alt="{{$a}}"></a>
{{ end }}
{{end}}
</div>
<div class="author-box-text flex_dir_col flex_jc_center">
<p>WRITTEN BY </p>
{{ range $t.Data.Pages }}
{{ if eq .Params.name $a }}
<p><a href="{{.Site.BaseURL}}/team/{{ .Params.slug }}" style="text-decoration: none;">{{ $a }}</a></p>
{{ end }}
{{end}}
</div>
{{ end }}
<div>

</div>
</div>
</div>
Expand Down
Binary file added static/img/guests/guest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a0744f5

Please sign in to comment.