Skip to content

Commit

Permalink
Modifying the casper-two theme to include taxonomies
Browse files Browse the repository at this point in the history
  • Loading branch information
shnek committed Apr 30, 2018
1 parent b747d89 commit ce80541
Show file tree
Hide file tree
Showing 5 changed files with 2,472 additions and 101 deletions.
1 change: 0 additions & 1 deletion layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<body class="home-template"><div class="site-wrapper">
{{ partial "header" . }}
{{end}}

<main id="site-main" class="site-main outer" role="main">
<div class="inner">
<div class="post-feed">
Expand Down
70 changes: 38 additions & 32 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
{{ partial "head" . }}
{{ partial "head" . }} {{if eq .Site.Params.singleViewStyle "casper"}}

{{if eq .Site.Params.singleViewStyle "casper"}}
<body class="tag-template"><div class="site-wrapper">
{{ partial "header-sori-term" . }}
{{else}}
<body class="home-template"><div class="site-wrapper">
{{ partial "header" . }}
{{end}}
<body class="tag-template">
<div class="site-wrapper">
{{ partial "header-sori-term" . }} {{else}}

<main id="site-main" class="site-main outer" role="main">
<div class="inner">
{{if ne .Site.Params.singleViewStyle "casper"}}
<div class="post-feed">
{{ partial "post-list" . }}
</div>
<body class="tag-template">
<div class="site-wrapper">
{{ partial "header-sori-term" . }} {{end}}

<nav class="pagination" role="navigation">
{{if .Paginator.HasPrev}}
<a class="newer-posts" href="{{ .Paginator.Prev.URL }}">&larr; <span class="hide">Next Posts</span></a>
{{end}}
<span class="page-number"><span class="hide">Page {{ .Paginator.PageNumber }} of {{.Paginator.TotalPages}}</span>&nbsp;</span>
{{if .Paginator.HasNext}}
<a class="older-posts" href="{{ .Paginator.Next.URL }}"><span class="hide">Previous Posts</span> &rarr;</a>
{{end}}
</nav>
{{else}}
<div class="post-feed">
{{ partial "post-list-term" . }}
</div>
{{end}}
</div>
</main>
<main id="site-main" class="site-main outer" role="main">
<div class="inner">
{{if ne .Site.Params.singleViewStyle "casper"}}
<div class="post-feed">
{{ partial "post-list-term" . }}
</div>

{{ partial "footer" . }}
</div>{{ partial "js" . }}</body></html>
<nav class="pagination" role="navigation">
{{if .Paginator.HasPrev}}
<a class="newer-posts" href="{{ .Paginator.Prev.URL }}">&larr;
<span class="hide">Next Posts</span>
</a>
{{end}}
<span class="page-number">
<span class="hide">Page {{ .Paginator.PageNumber }} of {{.Paginator.TotalPages}}</span>&nbsp;</span>
{{if .Paginator.HasNext}}
<a class="older-posts" href="{{ .Paginator.Next.URL }}">
<span class="hide">Previous Posts</span> &rarr;</a>
{{end}}
</nav>
{{else}}
<div class="post-feed">
{{ partial "post-list-term" . }}
</div>
{{end}}
</div>
</main>

{{ partial "footer" . }}
</div>{{ partial "js" . }}</body>

</html>
91 changes: 58 additions & 33 deletions layouts/partials/header-sori-term.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,73 @@
<div class="inner">
<nav class="site-nav">
<div class="site-nav-left">{{ if .Site.Params.logo }}
<a class="site-nav-logo" href="#"><img src="{{ .Site.Params.logo | absURL}}" alt="{{ .Site.Params.Title }}" /></a>{{end}}
<a class="site-nav-logo" href="#">
<img src="{{ .Site.Params.logo | absURL}}" alt="{{ .Site.Params.Title }}" />
</a>{{end}}

<ul class="nav" role="menu">
{{ $currentNode := . }}
{{with .Site.Menus.main}}
{{ range sort . "Weight" "desc"}}
<li class="{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .)}}nav-current{{end}}" role="menuitem">
<a href="{{.URL}}">{{.Name}}</a>
</li>
{{end}}{{end}}
</ul></div>
{{ $currentNode := . }} {{with .Site.Menus.main}} {{ range sort . "Weight" "desc"}}
<li class="{{if or ($currentNode.IsMenuCurrent " main " .) ($currentNode.HasMenuCurrent "main " .)}}nav-current{{end}}" role="menuitem">
<a href="{{.URL}}">{{.Name}}</a>
</li>
{{end}}{{end}}
</ul>
</div>

<div class="site-nav-right">
<div class="social-links">
{{ if .Site.Params.fbName }}<a class="social-link social-link-fb" href="https://www.facebook.com/{{ .Site.Params.fbName }}" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M19 6h5V0h-5c-3.86 0-7 3.14-7 7v3H8v6h4v16h6V16h5l1-6h-6V7c0-.542.458-1 1-1z"/></svg></a>{{end}}

{{ if .Site.Params.twitterName }}<a class="social-link social-link-tw" href="https://twitter.com/{{ .Site.Params.twitterName }}" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M30.063 7.313c-.813 1.125-1.75 2.125-2.875 2.938v.75c0 1.563-.188 3.125-.688 4.625a15.088 15.088 0 0 1-2.063 4.438c-.875 1.438-2 2.688-3.25 3.813a15.015 15.015 0 0 1-4.625 2.563c-1.813.688-3.75 1-5.75 1-3.25 0-6.188-.875-8.875-2.625.438.063.875.125 1.375.125 2.688 0 5.063-.875 7.188-2.5-1.25 0-2.375-.375-3.375-1.125s-1.688-1.688-2.063-2.875c.438.063.813.125 1.125.125.5 0 1-.063 1.5-.25-1.313-.25-2.438-.938-3.313-1.938a5.673 5.673 0 0 1-1.313-3.688v-.063c.813.438 1.688.688 2.625.688a5.228 5.228 0 0 1-1.875-2c-.5-.875-.688-1.813-.688-2.75 0-1.063.25-2.063.75-2.938 1.438 1.75 3.188 3.188 5.25 4.25s4.313 1.688 6.688 1.813a5.579 5.579 0 0 1 1.5-5.438c1.125-1.125 2.5-1.688 4.125-1.688s3.063.625 4.188 1.813a11.48 11.48 0 0 0 3.688-1.375c-.438 1.375-1.313 2.438-2.563 3.188 1.125-.125 2.188-.438 3.313-.875z"/></svg></a>{{end}}

{{ if .Site.Params.githubName }}<a class="social-link" href="https://github.com/{{ .Site.Params.githubName }}" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a>{{end}}

{{ if .Site.Params.linkedinName }}<a class="social-link" href="https://www.linkedin.com/in/{{ .Site.Params.linkedinName }}" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 50 512 512"><path d="M150.65,100.682c0,27.992-22.508,50.683-50.273,50.683c-27.765,0-50.273-22.691-50.273-50.683 C50.104,72.691,72.612,50,100.377,50C128.143,50,150.65,72.691,150.65,100.682z M143.294,187.333H58.277V462h85.017V187.333z M279.195,187.333h-81.541V462h81.541c0,0,0-101.877,0-144.181c0-38.624,17.779-61.615,51.807-61.615 c31.268,0,46.289,22.071,46.289,61.615c0,39.545,0,144.181,0,144.181h84.605c0,0,0-100.344,0-173.915 s-41.689-109.131-99.934-109.131s-82.768,45.369-82.768,45.369V187.333z" /></svg></a>{{end}}

{{ if .Site.Params.mediumName }}<a class="social-link" href="https://medium.com/@{{ .Site.Params.mediumName }}" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 195 195"><path d="M46.5340803,65.2157554 C46.6968378,63.6076572 46.0836,62.018231 44.8828198,60.93592 L32.6512605,46.2010582 L32.6512605,44 L70.6302521,44 L99.9859944,108.380952 L125.794585,44 L162,44 L162,46.2010582 L151.542017,56.2281011 C150.640424,56.9153477 150.193188,58.0448862 150.380019,59.1628454 L150.380019,132.837155 C150.193188,133.955114 150.640424,135.084652 151.542017,135.771899 L161.755369,145.798942 L161.755369,148 L110.38282,148 L110.38282,145.798942 L120.963119,135.527337 C122.002801,134.487948 122.002801,134.182246 122.002801,132.592593 L122.002801,73.0417402 L92.585901,147.755438 L88.6106443,147.755438 L54.3622782,73.0417402 L54.3622782,123.115814 C54.0767278,125.221069 54.7759199,127.3406 56.2581699,128.863022 L70.0186741,145.55438 L70.0186741,147.755438 L31,147.755438 L31,145.55438 L44.7605042,128.863022 C46.2319621,127.338076 46.8903838,125.204485 46.5340803,123.115814 L46.5340803,65.2157554 Z"/></svg></a>{{end}}
</div>
{{ if .Site.Params.fbName }}
<a class="social-link social-link-fb" href="https://www.facebook.com/{{ .Site.Params.fbName }}"
target="_blank" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<path d="M19 6h5V0h-5c-3.86 0-7 3.14-7 7v3H8v6h4v16h6V16h5l1-6h-6V7c0-.542.458-1 1-1z" />
</svg>
</a>{{end}} {{ if .Site.Params.twitterName }}
<a class="social-link social-link-tw" href="https://twitter.com/{{ .Site.Params.twitterName }}"
target="_blank" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<path d="M30.063 7.313c-.813 1.125-1.75 2.125-2.875 2.938v.75c0 1.563-.188 3.125-.688 4.625a15.088 15.088 0 0 1-2.063 4.438c-.875 1.438-2 2.688-3.25 3.813a15.015 15.015 0 0 1-4.625 2.563c-1.813.688-3.75 1-5.75 1-3.25 0-6.188-.875-8.875-2.625.438.063.875.125 1.375.125 2.688 0 5.063-.875 7.188-2.5-1.25 0-2.375-.375-3.375-1.125s-1.688-1.688-2.063-2.875c.438.063.813.125 1.125.125.5 0 1-.063 1.5-.25-1.313-.25-2.438-.938-3.313-1.938a5.673 5.673 0 0 1-1.313-3.688v-.063c.813.438 1.688.688 2.625.688a5.228 5.228 0 0 1-1.875-2c-.5-.875-.688-1.813-.688-2.75 0-1.063.25-2.063.75-2.938 1.438 1.75 3.188 3.188 5.25 4.25s4.313 1.688 6.688 1.813a5.579 5.579 0 0 1 1.5-5.438c1.125-1.125 2.5-1.688 4.125-1.688s3.063.625 4.188 1.813a11.48 11.48 0 0 0 3.688-1.375c-.438 1.375-1.313 2.438-2.563 3.188 1.125-.125 2.188-.438 3.313-.875z"
/>
</svg>
</a>{{end}} {{ if .Site.Params.githubName }}
<a class="social-link" href="https://github.com/{{ .Site.Params.githubName }}"
target="_blank" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
/>
</svg>
</a>{{end}} {{ if .Site.Params.linkedinName }}
<a class="social-link" href="https://www.linkedin.com/in/{{ .Site.Params.linkedinName }}"
target="_blank" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 50 512 512">
<path d="M150.65,100.682c0,27.992-22.508,50.683-50.273,50.683c-27.765,0-50.273-22.691-50.273-50.683 C50.104,72.691,72.612,50,100.377,50C128.143,50,150.65,72.691,150.65,100.682z M143.294,187.333H58.277V462h85.017V187.333z M279.195,187.333h-81.541V462h81.541c0,0,0-101.877,0-144.181c0-38.624,17.779-61.615,51.807-61.615 c31.268,0,46.289,22.071,46.289,61.615c0,39.545,0,144.181,0,144.181h84.605c0,0,0-100.344,0-173.915 s-41.689-109.131-99.934-109.131s-82.768,45.369-82.768,45.369V187.333z"
/>
</svg>
</a>{{end}} {{ if .Site.Params.mediumName }}
<a class="social-link" href="https://medium.com/@{{ .Site.Params.mediumName }}"
target="_blank" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 195 195">
<path d="M46.5340803,65.2157554 C46.6968378,63.6076572 46.0836,62.018231 44.8828198,60.93592 L32.6512605,46.2010582 L32.6512605,44 L70.6302521,44 L99.9859944,108.380952 L125.794585,44 L162,44 L162,46.2010582 L151.542017,56.2281011 C150.640424,56.9153477 150.193188,58.0448862 150.380019,59.1628454 L150.380019,132.837155 C150.193188,133.955114 150.640424,135.084652 151.542017,135.771899 L161.755369,145.798942 L161.755369,148 L110.38282,148 L110.38282,145.798942 L120.963119,135.527337 C122.002801,134.487948 122.002801,134.182246 122.002801,132.592593 L122.002801,73.0417402 L92.585901,147.755438 L88.6106443,147.755438 L54.3622782,73.0417402 L54.3622782,123.115814 C54.0767278,125.221069 54.7759199,127.3406 56.2581699,128.863022 L70.0186741,145.55438 L70.0186741,147.755438 L31,147.755438 L31,145.55438 L44.7605042,128.863022 C46.2319621,127.338076 46.8903838,125.204485 46.5340803,123.115814 L46.5340803,65.2157554 Z"
/>
</svg>
</a>{{end}}
</div>
{{ if .Site.Params.RSSLink}}
<a class="subscribe-button" href="{{.Site.Params.RSSLink }}">Subscribe</a> </div>
{{else if .Site.Params.showSubscribe}}
<a class="subscribe-button" href="{{if .IsNode}}{{.RSSLink}}{{else}}{{"index.xml" | absURL}}{{end}}">Subscribe</a>
{{end}}
<a class="subscribe-button" href="{{.Site.Params.RSSLink }}">Subscribe</a>
</div>
{{else if .Site.Params.showSubscribe}}
<a class="subscribe-button" href="{{if .IsNode}}{{.RSSLink}}{{else}}{{" index.xml " | absURL}}{{end}}">Subscribe</a>
{{end}}
</div>

</nav>
</nav>

<div class="site-header-content">
<h1 class="site-title">{{.Title | title}}</h1>
<div class="site-header-content">
<h1 class="site-title">{{.Title | title}}</h1>

<h2 class="site-description">&#x2F;&nbsp;
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms.Alphabetical }}
<a href="{{ $.Site.BaseURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> ({{ $value.Count }})&nbsp;&#x2F;&nbsp;
{{ end }}
</h2>
</div>
<h2 class="site-description">&#x2F;&nbsp; {{ $data := .Data }} {{ range $key, $value := .Data.Terms.Alphabetical }}
<a href="{{ $.Site.BaseURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> ({{ $value.Count }})&nbsp;&#x2F;&nbsp; {{ end }}
</h2>
</div>
</div>
</header>
70 changes: 36 additions & 34 deletions layouts/partials/post-list.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") }}
{{ range $paginator.Pages }}
{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") }} {{ range $paginator.Pages }}

<article class="post-card post">
{{if .Params.image}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{.Params.image | absURL}})"></div>
</a>
{{else}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>
{{end}}
<article class="post-card post">
{{if .Params.image}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{.Params.image | absURL}})"></div>
</a>
{{else}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>
{{end}}

<div class="post-card-content">
<a class="post-card-content-link" href="{{ .Permalink }}">
<header class="post-card-header">
{{if .Params.tags }}<span class="post-card-tags">{{ range $index, $tag := .Params.tags }}
#{{$tag}} {{end}} </span>
{{ end }}
<h2 class="post-card-title">{{.Title}}</h2>
</header>
<section class="post-card-excerpt">
{{ if .Description }}
<p>{{ .Description | markdownify }}</p>
{{else}}
<p>{{ .Summary | plainify | safeHTML }}{{ if .Truncated }} ... {{end}} </p>
{{end}}
</section>
</a>
<div class="post-card-content">
<a class="post-card-content-link" href="{{ .Permalink }}">
<header class="post-card-header">
{{if .Params.tags }}
<span class="post-card-tags">{{ range $index, $tag := .Params.tags }} #{{$tag}} {{end}} </span>
{{ end }}
<h2 class="post-card-title">{{.Title}}</h2>
</header>
<section class="post-card-excerpt">
{{ if .Description }}
<p>{{ .Description | markdownify }}</p>
{{else}}
<p>{{ .Summary | plainify | safeHTML }}{{ if .Truncated }} ... {{end}} </p>
{{end}}
</section>
</a>

<footer class="post-card-meta">
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | absURL}}" alt="Author" />
<span class="post-card-author"><a href="/">{{.Params.author | default .Site.Params.author}}</a></span>
</footer>
</div>
<footer class="post-card-meta">
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | absURL}}" alt="Author"
/>
<span class="post-card-author">
<a href="/">{{.Params.author | default .Site.Params.author}}</a>
</span>
</footer>
</div>
</article>
{{ end }}
{{ end }}
2,341 changes: 2,340 additions & 1 deletion static/built/screen.css

Large diffs are not rendered by default.

0 comments on commit ce80541

Please sign in to comment.