Skip to content

Commit

Permalink
Fix html errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarg committed Apr 26, 2020
1 parent bbf6c65 commit d0b426c
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 115 deletions.
8 changes: 4 additions & 4 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
{{- partial "header.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
<div class="content">
{{- partial "head.html" . -}}
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</div>
</body>
</html>
46 changes: 16 additions & 30 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
{{ define "main" }}
{{ if isset .Data "Term" }}
<h1>Entries tagged - "{{ .Data.Term }}"</h1>
{{ else }}
<h1 class="page-title">All articles</h1>
{{ end }}

<body>
<div class="container wrapper list">
{{ partial "head.html" . }}

{{ if isset .Data "Term" }}
<h1>Entries tagged - "{{ .Data.Term }}"</h1>
{{ else }}
<h1 class="page-title">All articles</h1>
{{ end }}

<ul class="posts">
{{- range .Data.Pages -}}
{{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}}
{{- else -}}
<li class="post">
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
</li>
{{- end -}}
{{- end -}}
</ul>
{{ partial "footer.html" . }}
</div>


</body>

</html>
<ul class="posts">
{{- range .Data.Pages -}}
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
<li class="post">
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
</li>
{{- end -}}
{{- end -}}
</ul>
{{ end }}
48 changes: 19 additions & 29 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
<div class="content">
{{ partial "head.html" . }}
{{ define "main" }}
<main>
<article>
<article>
<div class="title">
<h1 class="title">{{ .Title }}</h1>
<div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
</div>
<div>
{{ if isset .Params "tldr" }}
<div class="tldr">
<strong>tl;dr:</strong>
{{ .Params.tldr }}
</div>{{ end }}
</div>
{{ if isset .Params "tldr" }}
<div class="tldr">
<strong>tl;dr:</strong>
{{ .Params.tldr }}
</div>{{ end }}

<section class="body">
{{ .Content }}
</section>

<div class="post-tags">
{{ if ne .Type "page" }}
{{ if gt .Params.tags 0 }}
<nav class="nav tags">
<ul class="tags">
{{ range .Params.tags }}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ if gt .Params.tags 0 }}
<nav class="nav tags">
<ul class="tags">
{{ range .Params.tags }}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
</div>


{{ partial "footer.html" . }}
</div>
</body>
</html>
</article>
</main>
{{ end }}
43 changes: 16 additions & 27 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
{{ define "main" }}
<h1 class="page-title">All tags</h1>

<body>
<div class="container wrapper tags">
{{ partial "head.html" . }}
{{ $biggest := 1 }}
{{ $smallest := 1 }}
{{ $max := 3 }}
{{ $min := 1 }}
{{ $size := $min }}

<h1 class="page-title">All tags</h1>

{{ $biggest := 1 }}
{{ $smallest := 1 }}
{{ $max := 3 }}
{{ $min := 1 }}
{{ $size := $min }}

{{ $data := .Data }}
<div class="tag-cloud">
<ul>
{{ $data := .Data }}
<div class="tag-cloud">
<ul class="tags">
{{ range $key, $value := .Data.Terms.ByCount }}
{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
{{ $size := (cond (eq $biggest $smallest) $min $size) }}
<li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li>
{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
{{ $size := (cond (eq $biggest $smallest) $min $size) }}
<li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li>
{{ end }}
</ul>
</div>
{{ partial "footer.html" . }}
</div>
</body>

</html>
</ul>
</div>
{{ end }}
29 changes: 14 additions & 15 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
{{ partial "head.html" . }}

{{ partial "header.html" . }}
<body>
<div class="content">
{{ partial "head.html" . }}

<main class="list">
<div class="site-description">
{{- if isset .Site.Params "subtitle" -}}
<p>{{ .Site.Params.Subtitle | markdownify }}</p>
{{- end -}}
</div>
<div class="site-description">
{{- if isset .Site.Params "subtitle" -}}
<p>{{ .Site.Params.Subtitle | markdownify }}</p>
{{- end -}}
</div>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
{{ range $paginator.Pages }}
<section class="list-item">
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
<time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
<br><span class="description">
<br><div class="description">
{{ if isset .Params "description" }}
{{ .Description }}
{{ else }}
{{ .Summary }}&hellip;
{{ end }}
</span><br/>
</div>
<a href="{{ .RelPermalink }}">Read more ⟶</a>
</section>
{{ end }}
Expand All @@ -31,7 +32,5 @@ <h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
{{ partial "footer.html" . }}
</div>

</div>

</body>
</html>
</body>
</html>
3 changes: 3 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
{{ if not .Site.IsServer }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}

{{- if (isset .Site.Params "social") -}}
<script>
feather.replace()
</script>
{{- end }}

19 changes: 9 additions & 10 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<div class="content">
<header>
<div class="main">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</div>
<nav>
{{ range .Site.Menus.main }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>
</header>
<div class="main">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</div>
<nav>
{{ range .Site.Menus.main }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>
</header>

0 comments on commit d0b426c

Please sign in to comment.