Add a sidebar
This commit is contained in:
parent
c550f2cd22
commit
160f5d94c4
|
@ -1,15 +1,19 @@
|
||||||
{{ template "base.html" . }}
|
{{ template "base.html" . }}
|
||||||
|
|
||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
|
<h1>{{ .Title }}</h1>
|
||||||
{{ if .User.IsEduAuthor }}
|
{{ if .User.IsEduAuthor }}
|
||||||
<div class="optionbar">
|
<div class="mb3">
|
||||||
<div class="options">
|
<a href="{{ .EditUrl }}" title="Edit">✎ Edit</a>
|
||||||
</div>
|
<a href="{{ .DeleteUrl }}" title="Delete">✖ Delete</a>
|
||||||
<div class="options">
|
|
||||||
<a class="edit action button" href="{{ .EditUrl }}" title="Edit">✎ Edit</a>
|
|
||||||
<a class="delete action button" href="{{ .DeleteUrl }}" title="Delete">✖ Delete</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ .Article.Content }}
|
<div class="flex">
|
||||||
|
<div class="flex-grow-1 post-content">
|
||||||
|
{{ .Article.Content }}
|
||||||
|
</div>
|
||||||
|
<div class="ml3 flex-shrink-0 w5">
|
||||||
|
I'm a sidebar!
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -83,6 +83,10 @@ func EducationArticle(c *RequestContext) ResponseData {
|
||||||
tmpl.OpenGraphItems = append(tmpl.OpenGraphItems,
|
tmpl.OpenGraphItems = append(tmpl.OpenGraphItems,
|
||||||
templates.OpenGraphItem{Property: "og:description", Value: string(article.Description)},
|
templates.OpenGraphItem{Property: "og:description", Value: string(article.Description)},
|
||||||
)
|
)
|
||||||
|
tmpl.Breadcrumbs = []templates.Breadcrumb{
|
||||||
|
{Name: "Education", Url: hmnurl.BuildEducationIndex()},
|
||||||
|
{Name: article.Title, Url: hmnurl.BuildEducationArticle(article.Slug)},
|
||||||
|
}
|
||||||
|
|
||||||
var res ResponseData
|
var res ResponseData
|
||||||
res.MustWriteTemplate("education_article.html", tmpl, c.Perf)
|
res.MustWriteTemplate("education_article.html", tmpl, c.Perf)
|
||||||
|
|
Loading…
Reference in New Issue