Skip to content

Commit

Permalink
Merge pull request #505 from openpracticelibrary/feature/perspectives
Browse files Browse the repository at this point in the history
Add perspective content type
  • Loading branch information
mtakane committed Nov 26, 2018
2 parents 1899700 + 420a8d1 commit 01d97f6
Show file tree
Hide file tree
Showing 17 changed files with 167 additions and 304 deletions.
6 changes: 6 additions & 0 deletions config.toml
Expand Up @@ -22,6 +22,12 @@ customCSS = [
[permalinks]
page = "/:slug/"

[[menu.main]]
name = "Perspectives"
weight = 3
identifier = "Perspectives"
url = "/perspective/"

[[menu.main]]
name = "GitHub"
weight = 2
Expand Down
Expand Up @@ -4,10 +4,11 @@ subtitle: Tackling Complexity in the Heart of Software
date: 2018-11-06T19:14:43.638Z
authors:
- sherl0cks
area: foundation-culture-and-collaboration
icon: /images/kandinsky.jpg
jumbotron: /images/kandinsky.jpg
participants: []
aliases:
- /practice/domain-driven-design/

---
## What is it?

Expand Down
Expand Up @@ -6,12 +6,9 @@ subtitle: >-
date: 2018-09-09T11:22:37.360Z
authors:
- tdbeattie
area: foundation-culture-and-collaboration
people: '1'
time: Continuous
difficulty: hard
participants:
- Product Owners
aliases:
- /practice/product-ownership/

---
## What is it?

Expand Down
2 changes: 2 additions & 0 deletions content/practice/backlog-refinement.md
Expand Up @@ -7,6 +7,8 @@ authors:
- mtakane
- tdbeattie
area: options
perspectives:
- product-ownership
people: 2+
time: 30 minutes
difficulty: moderate
Expand Down
2 changes: 2 additions & 0 deletions content/practice/event-storming.md
Expand Up @@ -10,6 +10,8 @@ authors:
- sudhakarau1
- sandraarps
area: discovery-loop-outcomes
perspectives:
- domain-driven-design
icon: /images/eventstormtile.jpeg
jumbotron: /images/eventstorm.jpeg
jumbotronAlt: An example event storm
Expand Down
2 changes: 2 additions & 0 deletions content/practice/how-now-wow-prioritization-matrix.md
Expand Up @@ -5,6 +5,8 @@ date: 2018-11-08T14:40:20.794Z
authors:
- valyonchev
area: options
perspectives:
- product-ownership
icon: /images/20181108_152130.jpg
jumbotron: /images/20181108_152130.jpg
jumbotronAlt: How-Now-Wow Prioritization Matrix
Expand Down
2 changes: 2 additions & 0 deletions content/practice/impact-mapping.md
Expand Up @@ -8,6 +8,8 @@ authors:
- rdebeasi
- valyonchev
area: discovery-loop-why
perspectives:
- domain-driven-design
people: 2+
time: >-
2-4 hours of prep to establish a goal or problem statement before the session.
Expand Down
2 changes: 2 additions & 0 deletions content/practice/iteration-planning.md
Expand Up @@ -8,6 +8,8 @@ authors:
- sandraarps
- tdbeattie
area: delivery-deliver
perspectives:
- product-ownership
people: 3+
time: 1-2 hours
difficulty: moderate
Expand Down
3 changes: 2 additions & 1 deletion content/practice/start-at-the-end.md
Expand Up @@ -5,7 +5,8 @@ authors:
- infosec812
- mtakane
area: discovery-loop-why
date: 2018-06-08T05:00:00.000Z
perspectives:
- domain-driven-design
---

## What is it?
Expand Down
163 changes: 78 additions & 85 deletions layouts/_default/single.html
@@ -1,7 +1,5 @@
{{ partial "header.html" . }}



{{if .Params.image}}
{{if or (eq (substr .Params.image 0 7) "http://") (eq (substr .Params.image 0 8) "https://")}}
<header class="main-header post-head" style="background-image: url({{.Params.image}})">
Expand All @@ -17,6 +15,9 @@
{{ if .Site.Params.logo }}
<a class="blog-logo" href="{{.Site.BaseURL}}"><img src="{{ .Site.Params.logo | relURL }}" alt="Home" /></a>
{{end}}

{{ partial "search-bar.html" . }}

{{ if .Site.Menus.main }}
<a class="menu-button" href="#"><span class="burger">&#9776;</span><span class="word">Menu</span></a>
{{else}}
Expand All @@ -40,64 +41,79 @@ <h2 class="page-description">
</div>
</div>
{{end}}


</header>



<main class="content" role="main">




<article class="post {{ .Section }}">
<header class="post-header">
<nav class="breadcrumb">
{{ $currentNode := . }}
{{ range .Site.Menus.main }}
{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .)}}
<li><a href="{{.URL}}">{{.Name}}</a></li>
{{ range .Children }}
{{ if .HasChildren }}
{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .)}}
<li><a href="{{.URL}}">{{.Name}}</a></li>
{{ range .Children }}
{{ if .HasChildren }}
{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .)}}
<li><a href="{{.URL}}">{{.Name}}</a></li>
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
<!-- <li>{{.Title}}</li> -->
</nav>

{{ $authorScratch := newScratch }}
{{ range $.Params.authors }}
{{ $currrentAuthor := index $.Site.Data.content.author .}}
{{ $authorScratch.Add "listOfAuthors" (slice $currrentAuthor) }}
{{ end }}
{{ $listOfAuthors := $authorScratch.Get "listOfAuthors"}}
{{ partial "author.html" $listOfAuthors }}

<section class="post-meta">
Last update:
<time class="post-date" datetime="{{ .Page.Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
{{ .Page.Lastmod.Format "January 2, 2006" }}
</time>
</section>

<h1 class="post-title">{{.Title}}</h1>
<small>{{.Description}}</small>
{{ partial "content-heading.html" .Params }}

<section class="post-meta">
{{ if eq .Section "post"}}
<time class="post-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
{{ .Date.Format "Jan 2, 2006" }}
</time>
{{end}}
{{ range .Params.tags }}
<span class="post-tag small"><a href="{{$.Site.BaseURL}}/tags/{{ . | urlize }}/">#{{ . }}</a></span>
{{ end }}
</section>
</header>

<section class="post-content">
{{if and (isset .Params "people") (isset .Params "time") (isset .Params "difficulty") }}
<div class="how-to-box">
<div class="how-to-box-item">
<div class="icon-people how-to-box-icon"></div>
<p class="how-to-box-text"><i>No. People</i></p>
<p class="how-to-box-text">{{ .Params.people }}</p>
</div>
<div class="how-to-box-item">
<div class="icon-time how-to-box-icon"></div>
<p class="how-to-box-text"><i>Time</i></p>
<p class="how-to-box-text">{{ .Params.time }}</p>
</div>
<div class="how-to-box-item">
<div class="icon-stats how-to-box-icon"></div>
<p class="how-to-box-text"><i>Difficulty</i></p>
<p class="how-to-box-text">{{ .Params.difficulty }}</p>
</div>
<div class="how-to-box-item">
<div class="icon-speach how-to-box-icon"></div>
<p class="how-to-box-text"><i>Participants</i></p>
{{ if isset .Params "participants" }}
<p class="how-to-box-text">{{ range first 1 .Params.participants }} {{ . }}{{ end }}{{ range after 1 .Params.participants }}, {{ . }}{{ end }}</p>
{{ end }}
</div>
</div>
{{ end }}

{{ if isset .Params "perspectives" }}
{{ $numPerspectives := len .Params.perspectives }}
<p><em>
This {{ .Type }} is part of:
{{ range $index, $practice := $.Params.perspectives }}
{{ partial "link.html" ($.Site.GetPage "perspective" $practice) }}{{ if lt (add $index 1) $numPerspectives }},{{ else }}.{{ end }}
{{ end }}
</em></p>
{{ end }}

{{ if eq .Type "perspective" }}
This {{ .Type }} contains:
<ul>
{{ range where .Site.Pages "Params.perspectives" "intersect" ( slice .Source.BaseFileName ) }}
<li>{{ partial "link.html" . }}</li>
{{ end }}
</ul>
{{ end }}

{{ .Content }}

{{ .Content }}

{{if ne .Params.index true}}
{{if .Menus.main.HasChildren }}
Expand All @@ -114,48 +130,25 @@ <h1 class="post-title">{{.Title}}</h1>
{{ end }}
{{ end }}

{{if eq .Params.index true}}
<nav class="navpage">

{{ $currentNode := . }}
{{ range .Site.Menus.main }}
{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .)}}
{{ range .Children }}
<ul>
<li><a href="{{.URL}}">{{.Name}}</a>
{{ if .HasChildren }}
<ul>
{{ range .Children }}
<li><a href="{{.URL}}">{{.Name}}</a>
{{ if .HasChildren }}
<ul>
{{ range .Children }}
<li><a href="{{.URL}}">{{ .Name }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</ul>
{{ end }}
</li>
</ul>
{{ end }}


{{end}}
{{end}}

</nav>
{{end}}

</section>

</section>
{{ if eq .Type "practice" }}
<!-- TODO: Expand this to work with any content type -->
{{ partial "button.html" (dict "practicePath" .File.BaseFileName "buttonText" "Improve this practice") }}
{{ end }}

<footer class="post-footer">
{{ if .Params.authors }}
<section class="social-footer">
{{ partial "share.html" . }}
</section>
{{ end }}

</footer>
{{ if .Params.area }}
{{ partial "suggestions.html" . }}
{{ end }}
</article>

</main>

{{ partial "button.html" (dict "absolutePath" "/" "buttonText" "View all practices") }}

{{ partial "footer.html" . }}
Expand Up @@ -6,20 +6,15 @@ <h2 class="practice-title"> {{.title }}</h2>
{{ end }}
</div>


{{ if .area }}
<div class="inline-block mobius-loop-position ">
<img class="loop-img" src="/images/loop-positions/{{.area}}.svg" alt="{{.area}} loop position">
</div>

<!-- <div class="inline-block mobius-loop-position ">
<div class="{{.area}}">&nbsp;&nbsp;&nbsp;</div>
<p class="mobius-loop"></p>
<div class="mobius-foundation"></div>
</div> -->
{{ end }}
</section>

{{ if .jumbotron }}
<div class="jumbotron">
<img class="jumbotron-img" src="{{ .jumbotron }}" alt="{{ .jumbotronAlt }}">
</div>
{{end}}
{{ end }}
1 change: 1 addition & 0 deletions layouts/partials/link.html
@@ -0,0 +1 @@
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
7 changes: 4 additions & 3 deletions layouts/partials/share.html
@@ -1,10 +1,11 @@
{{ if ne .Params.share false}}
<h2 class="social-title">Like what you read? Give {{range first 1 .Params.authors }} {{ . }} {{end}} a thumbs up in the chat.</h2>
<p class="social-subtitle">Feedback on {{ .Type | pluralize }} will help us curate the best content for the community. Open chat to share your thoughts with the author.</p>

<section class="share">
<!-- To add a new chat topic, see footer-custom.html. -->
<div class="float-left">
{{ if eq .Type "practice" }}
<button type="button" class="btn btn-chat" id="practice-chat">Open Chat</button>
{{ end }}
<button type="button" class="btn btn-chat" id="practice-chat">Open Chat</button>
</div>
<div class="share-icons">
<a class="icon-twitter share-links" style="font-size: 1.4em" href="https://twitter.com/share?text={{ .Title | safeHTML}}&nbsp;-&nbsp;{{ .Site.Title }}&amp;url={{ .Permalink }}"
Expand Down

0 comments on commit 01d97f6

Please sign in to comment.