Skip to content

Commit

Permalink
Fix Breadcrumbs and Tags (#3)
Browse files Browse the repository at this point in the history
* fix breadcrumbs

* fix hover

* hide bread on home

* contrast links on homepage

* fix text transform

* support tags
  • Loading branch information
osterman authored May 4, 2018
1 parent f198706 commit 4e20524
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 15 deletions.
4 changes: 2 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ enableEmoji = true

[params]
showVisitedLinks = true # default is false
themeStyle = "flex" # "original" or "flex" # default "flex"
themeStyle = "flex"
ordersectionsby = "weight" # ordersectionsby = "title"
disableHomeIcon = true
disableSearch = true
disableNavChevron = false # set true to hide next/prev chevron, default is false
highlightClientSide = false # set true to use highlight.pack.js instead of the default hugo chroma highlighter
menushortcutsnewtab = false # set true to open shortcuts links to a new tab/window
enableGitInfo = false
enableGitInfo = true

[outputs]
home = [ "HTML", "RSS", "JSON"]
Expand Down
3 changes: 3 additions & 0 deletions content/Terraform/Terraform Best Practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Terraform Best Practices"
excerpt: ""
slug: "terraform-best-practices"
tags:
- "Best Practices"
- "Terraform"
---
![](/images/08bcd99-terraform.png)

Expand Down
1 change: 1 addition & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
title: "Home"
---
4 changes: 3 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ define "main" }}
<!-- main -->
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle=""><i class="fa fa-bars"></i></a>
</span>
{{ end }}
11 changes: 4 additions & 7 deletions layouts/partials/flex/body-aftercontent.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ <h3><i class="fa fa-align-left"></i>Table of Contents</h3>

</article>
<footer>

<div class="footline">
<div class="footline">
{{if .Params.tags }}
<div class="tags">
<div class="tags">
{{ range $index, $tag := .Params.tags }}
<a class="label label-default" href="{{$.Site.BaseURL}}tags/{{ $tag | urlize }}">{{ $tag }}</a>
{{ end }}
</div>
{{end}}


<div>
<div class="copyright">
{{ $footer := print "_footer." .Lang }}
{{ range where .Site.Pages "Source.BaseFileName" $footer }}
{{ .Content }}
Expand All @@ -44,14 +43,12 @@ <h3><i class="fa fa-align-left"></i>Table of Contents</h3>
</div>
{{end}}

{{ if not .Page.Lastmod.IsZero }}
{{ if not .Page.Lastmod.IsZero }}
<div class="date">
<i class='fa fa-calendar'></i> {{T "last-update-on"}} {{ .Page.Lastmod.Format "02/01/2006" }}
</div>
{{end}}

</div>

</footer>

{{ partial "flex/scripts.html" . }}
16 changes: 12 additions & 4 deletions layouts/partials/flex/body-beforecontent.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ <h1>The Cloud Posse Developer Hub</h1>
{{ end }}
<div class="subnav">
<div class="container">
{{ partial "breadcrumb.html" . }}
<div class="breadcrumbs">
<a href="{{.Site.BaseURL}}">Home</a> <i class="fa fa-chevron-right"></i> <a href="{{.Site.BaseURL}}">Home</a>
</div>
{{if not .IsHome}}
<div class="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
{{ template "breadcrumb" dict "page" . "value" .Title }}
</div>
<div class="searchbox">
<div class="fa fa-search"></div>
<input type="text" placeholder="Search" class="search-box">
Expand Down Expand Up @@ -109,3 +108,12 @@ <h1 class="title">{{.Title}}</h1>
{{ end }}
</div>
{{end}}

{{define "breadcrumb"}}
{{ if .page.Parent}}
{{$value := (printf "<a href='%s'>%s</a> <i class='fa fa-chevron-right'></i> %s" .page.Parent.URL .page.Parent.Title .value)}}
{{ template "breadcrumb" dict "page" .page.Parent "value" $value }}
{{else}}
{{.value|safeHTML}}
{{end}}
{{end}}
43 changes: 42 additions & 1 deletion static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ article > aside .menu .dd-item div a, article > aside .menu .dd-item div a:hover
padding-left: 10px;
}

aside#left-sidebar .menu li.active > div > a:hover {
background-color: transparent;
}

article > aside .menu .dd-item div i.category-icon {
color: #bbb;
opacity: .5;
Expand All @@ -99,6 +103,7 @@ aside#left-sidebar {
padding-left: 30px;
}


article > aside .menu .dd-item li {
border-left: 0;
white-space: nowrap;
Expand Down Expand Up @@ -380,7 +385,6 @@ div.landing-description {
display: inline-block;
color: #7d7d8e;
border-radius: 2px;
height: 26px;
line-height: 26px;
}

Expand Down Expand Up @@ -501,6 +505,7 @@ div.landing-description {
border-bottom: 1px solid #ddd;
line-height: 2em;
margin-bottom: 1em;
text-transform: none;
}

.homepage h3 {
Expand All @@ -511,6 +516,7 @@ div.landing-description {

.homepage li:not(.haschildren) {
padding-left: 5px;
color: #888;
}

.homepage .category ul li.dd-item {
Expand All @@ -521,3 +527,38 @@ thead {
background-color: #f9f9f9;
border-bottom: 2px solid #eee;
}

footer .footline {
display: block;
padding-top: 0.2rem;
padding-left: 5rem;
}

footer .footline .tags {
display: inline-block;
float: left;
font-size: 12px;
margin-right: 10px;
}

footer .footline .tags, .footline .copyright {
display: inline-block;
float: left;
}

.tags .label-default[href]:hover {
color: #f6f7f8;
background-color: #364548;
}

.tags .label {
font-size: 0.9em;
padding: 0 7px 0 9px;
display: inline-block;
color: #7d7d8e;
border-radius: 2px;
background-color: #f6f7f8;
line-height: 26px;
-webkit-box-shadow: 0 0 0 1px #c9d4d9, 0 2px 2px rgba(0,0,0,0.1);
box-shadow: 0 0 0 1px #c9d4d9, 0 2px 2px rgba(0,0,0,0.1);
}

0 comments on commit 4e20524

Please sign in to comment.