Added sidebar component. Added entry frontmatter. Tweaked padding for heros.

This commit is contained in:
Chris 2018-04-14 02:08:43 -04:00
parent 5a5f12732d
commit 4409426205
7 changed files with 130 additions and 12 deletions

View File

@ -52,7 +52,25 @@
{{ .Render "header" }}
{{ block "header" . }}{{ end }}
{{ $full_width := .Params.FullWidth | default false }}
{{ if eq $full_width true }}
<div class="container">
{{ block "main" . }}{{ end }}
</div>
{{ else }}
<div class="container">
<div class="columns">
<div class="column is-two-thirds">
{{ block "main" . }}{{ end }}
</div>
<div class="column">
{{ partial "layout/sidebar" }}
</div>
</div>
</div>
{{ end }}
<div class="container">
<footer class="footer">

View File

@ -1,10 +1,8 @@
{{ define "main" }}
<section class="section">
<div class="container">
<h1 class="title">{{ .Title }}</h1>
<div class="content">
{{ .Content }}
</div>
</div>
</section>
{{ end }}

53
layouts/entry/single.html Normal file
View File

@ -0,0 +1,53 @@
{{ define "header" }}
{{ $author := index .Site.Data.authors ( .Params.author | default "" ) }}
<div class="container">
<div>
<div class="blog-entry-header-image is-3by1" style="background-image: url('./banner.png')">
&nbsp;
</div>
<div class="blog-entry-header-content is-3by1">
<div style="position: absolute; bottom: 3em;">
<div>
<span class="title px-md py-sm has-background-dark">{{ .Title }}</span>
</div>
{{ if $author }}
<div style="padding-top: 2em;">
<span class="h3 px-md py-sm has-background-dark">
Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a>
on {{ .Date.Format "January 02 2006" }}
</span>
</div>
{{ else }}
<div style="padding-top: 2em;">
<span class="h3 px-md py-sm has-background-dark">
Written on {{ .Date.Format "January 02 2006" }}
</span>
</div>
{{ end }}
</div>
</div>
</div>
</div>
{{ end }}
{{ define "main" }}
<div class="content pt-lg">
{{ .Content }}
</div>
<!--
{{ if .Params.forum }}
<div class="entry-comments">
<div id="discourse-comments"></div>
<script type="text/javascript">
DiscourseEmbed = { discourseUrl: 'https://community.citra-emu.org/', topicId: "{{ .Params.forum }}" };
(function() {
var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
})();
</script>
</div>
{{ end }}
-->
{{ end }}

View File

@ -0,0 +1 @@
{{ partial "entry/summary" . }}

View File

@ -0,0 +1,48 @@
{{ if .Params.twitter }}
<div class="column is-4">
<a class="is-size-5" href="{{ .Params.twitterUrl }}">
<span class="icon">
<i class="fas fa-file-alt"></i>
</span>
TWITTER {{ .Title }}
</a>
</div>
{{ else }}
{{ $author := index .Site.Data.authors ( .Params.author | default "" ) }}
<div class="mb-md blog-entry-summary" data-href="{{ .Permalink }}">
<div class="blog-entry-header-image is-3by1" style="background-image: url('/{{ .Dir }}/banner.png')">
&nbsp;
</div>
<div class="blog-entry-header-content is-3by1">
<div style="position: absolute; bottom: 1em;">
<div>
<span class="title px-md py-sm has-background-dark">{{ .Title }}</span>
</div>
{{ if $author }}
<div style="padding-top: 2em;">
<span class="h3 px-md py-sm has-background-dark">
Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a>
on {{ .Date.Format "January 02 2006" }}
</span>
</div>
{{ else }}
<div style="padding-top: 2em;">
<span class="h3 px-md py-sm has-background-dark">
Written on {{ .Date.Format "January 02 2006" }}
</span>
</div>
{{ end }}
<div style="padding-top: 2em;">
<span class="h3 px-md py-sm has-background-dark">
{{ .Summary }}
</span>
</div>
<div style="padding-top: 2em;">
<span class="h3 px-md py-sm has-background-dark">
<a href="{{ .Permalink }}">Read More</a>
</span>
</div>
</div>
</div>
</div>
{{ end }}

View File

@ -6,7 +6,7 @@
</nav>
</div>
<div class="hero-body">
<div class="hero-body pt-lg pb-xxs">
<section class="section">
<div class="container">
<div class="columns">

View File

@ -14,7 +14,7 @@
<div class="navbar-start">
{{ $currentPage := . }} {{ range .Site.Menus.main }} {{ if .HasChildren }}
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-item">
<a class="navbar-item px-sm">
{{ .Name }}
<span class="icon">
@ -30,7 +30,7 @@
</div>
</div>
{{ else }}
<a class="navbar-item {{ if $currentPage.IsMenuCurrent " main " . }} is-active{{ end }}" href="{{ .URL }}">
<a class="navbar-item px-md {{ if $currentPage.IsMenuCurrent " main " . }} is-active{{ end }}" href="{{ .URL }}">
{{ .Name }}
</a>
{{ end }} {{ end }}
@ -48,17 +48,17 @@
<div class="navbar-end">
<!-- Navbar icons -->
<a class="navbar-item is-hidden-touch" href="{{ .Site.Params.DiscordURL }}" target="_blank">
<a class="navbar-item px-md is-hidden-touch" href="{{ .Site.Params.DiscordURL }}" target="_blank">
<span class="icon">
<i class="fab fa-2x fa-discord"></i>
</span>
</a>
<a class="navbar-item is-hidden-touch" href="{{ .Site.Params.TwitterURL }}" target="_blank">
<a class="navbar-item px-md is-hidden-touch" href="{{ .Site.Params.TwitterURL }}" target="_blank">
<span class="icon">
<i class="fab fa-2x fa-twitter"></i>
</span>
</a>
<a class="navbar-item is-hidden-touch" href="{{ .Site.Params.GithubURL }}" target="_blank">
<a class="navbar-item px-md is-hidden-touch" href="{{ .Site.Params.GithubURL }}" target="_blank">
<span class="icon">
<i class="fab fa-2x fa-github"></i>
</span>