Skip to content

Commit

Permalink
fix: tree-categories, tree-sections
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Feb 7, 2020
1 parent 3be7996 commit 04bde37
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assets/scss/_common/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
}

.tree {
margin-left: -2em;
margin-left: -2.4em;
overflow: auto hidden;
white-space: nowrap;
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"css/meme.min.edc586febe0b0aca4a6babb022ad5f8cd896ec62bda098e7b6a1572953e89198.css","MediaType":"text/css","Data":{"Integrity":"sha256-7cWG/r4LCspKa6uwIq1fjNiW7GK9oJjntqFXKVPokZg="}}
{"Target":"css/meme.min.1cd65e86662c3df5c9137d0984d1cd8635333e017884484b0dfbe582fd97c479.css","MediaType":"text/css","Data":{"Integrity":"sha256-HNZehmYsPfXJE30JhNHNhjUzPgF4hEhLDfvlgv2XxHk="}}
4 changes: 2 additions & 2 deletions layouts/partials/tree/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="list-title">{{ .Title | default (.Type | title) }}</h1>
{{ range $categories }}
{{ $categoryTerms := (split (strings.TrimPrefix "/" .) "/") }}
{{ $depth := (len $categoryTerms) }}
{{ $padding := (mul $depth 2) }}
{{ $padding := (mul (mul $depth 2) 1.2) }}
{{ $lastTerm := (delimit (last 1 $categoryTerms) " ") }}
{{ $url := urls.Parse $lastTerm }}
{{ $path := $url.Path }}
Expand All @@ -44,7 +44,7 @@ <h1 class="list-title">{{ .Title | default (.Type | title) }}</h1>
{{ end }}
{{ $category := $.Scratch.Get "category" }}
{{ if eq $context $category }}
<p style="padding-left: {{ add $padding 2 }}em">
<p style="padding-left: {{ add $padding (mul 2 1.2) }}em">
<a href="{{ $page.RelPermalink }}" class="category-post">{{ $page.LinkTitle }}</a>
</p>
{{ end }}
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/tree/sections.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ <h1 class="list-title">{{ .Title | default (.Type | title) }}</h1>
{{ range $page, $name := $pages }}
{{ $depth := (len (split (strings.TrimPrefix "/" $page) "/")) }}
{{ with $.Site.GetPage $page }}
{{ $padding := (mul $depth (mul 2 (mul 1.2 .Site.Params.fontSize))) }}
<p style="padding-left: {{ $padding }}px">
{{ $padding := (mul (mul $depth 2) 1.2) }}
<p style="padding-left: {{ $padding }}em">
<a href="{{ .RelPermalink }}" class="category-item">{{ .LinkTitle | default $name }}</a>
{{ if $.Site.Params.displayPostsCount }}
{{ $sectionPage := .CurrentSection }}
Expand All @@ -35,7 +35,7 @@ <h1 class="list-title">{{ .Title | default (.Type | title) }}</h1>
{{ end }}
{{ $pages := $.Scratch.Get "pages" }}
{{ range $pages }}
<p style="padding-left: {{ add $padding (mul 2 (mul 1.2 .Site.Params.fontSize)) }}px">
<p style="padding-left: {{ add $padding (mul 2 1.2) }}em">
<a href="{{ .RelPermalink }}" class="category-post">{{ .LinkTitle }}</a>
</p>
{{ end }}
Expand Down

0 comments on commit 04bde37

Please sign in to comment.