Fix styling of blog, photos, term, ruby
So many fixes!
This commit is contained in:
parent
b7070ccfd5
commit
a9cfddec80
21 changed files with 212 additions and 149 deletions
|
@ -3,29 +3,26 @@
|
|||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<header class="page">
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
<header>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
|
||||
{{ partial "table_of_contents.html" . }}
|
||||
{{ partial "ruby_controls.html" . }}
|
||||
{{ partial "ruby_controls.html" . }}
|
||||
|
||||
{{- $hasContent := false -}}
|
||||
{{ with .Content }}
|
||||
{{- $hasContent = true -}}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.posts | default true }}
|
||||
{{ if and $hasContent }}
|
||||
<h2>Posts</h2>
|
||||
{{- $hasContent := false -}}
|
||||
{{ with .Content }}
|
||||
{{- $hasContent = true -}}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
<ul>
|
||||
{{- range .Pages -}}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{ if .Params.posts | default true }}
|
||||
{{ if $hasContent }}
|
||||
<h2>Posts</h2>
|
||||
{{ end }}
|
||||
|
||||
{{- range .Pages -}}
|
||||
{{ .Render "li_grid_with_date" }}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
|
|
@ -3,20 +3,38 @@
|
|||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<header class="page">
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
<header class="page">
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
<article>
|
||||
{{ .Content }}
|
||||
|
||||
{{ .Content }}
|
||||
{{- range .Data.Terms.Alphabetical -}}
|
||||
<h2>{{ .Name | title }}</h2>
|
||||
|
||||
{{- range .Data.Terms.Alphabetical -}}
|
||||
<h2>{{ .Name | title }}</h2>
|
||||
<ul>
|
||||
{{- range .WeightedPages -}}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
{{- range .WeightedPages -}}
|
||||
<article class="post">
|
||||
<header>
|
||||
<time class="nobreak" datetime="{{ .Date | time.Format "2006-01-02" }}">{{ .Date | time.Format "Jan 2, 2006" }}</time>
|
||||
<h1 class="title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
|
||||
</header>
|
||||
|
||||
{{ if .Description }}
|
||||
<p>{{ .Description }}</p>
|
||||
{{ else if lt .WordCount 110 }}
|
||||
{{ .Content }}
|
||||
{{ else }}
|
||||
{{ warnf "Post \"%s\" doesn't have a description or content suitable for the blog list" .Title }}
|
||||
<p>{{ .WordCount }} words</p>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer_tags.html" . }}
|
||||
|
||||
{{ partial "development/draft_tag.html" . }}
|
||||
</article>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ define "footer" }}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
{{ define "main" }}
|
||||
{{- range .Pages.ByDate.GroupByDate "2006" -}}
|
||||
<h1 class="date"><a id="{{ .Key }}">{{ .Key | title }}</a></h1>
|
||||
|
||||
{{- range .Pages -}}
|
||||
{{- if or (not .Draft) (not hugo.IsProduction) -}}
|
||||
{{- .Render "li_grid_with_date" -}}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{{ if .HasShortcode "ruby" -}}
|
||||
<aside>
|
||||
<fieldset id="ruby-controls">
|
||||
<fieldset id=ruby-controls>
|
||||
<legend>Ruby</legend>
|
||||
<input id="none" type="radio" name="ruby-controls" value="NONE">
|
||||
<label for="none">Japanese Only</label>
|
||||
<input id="both" type="radio" name="ruby-controls" value="BOTH" checked>
|
||||
<label for="both">Both</label>
|
||||
<input id=hidden type=radio name=ruby-controls value=HIDDEN>
|
||||
<label for=hidden>English Only</label>
|
||||
<input id=ruby-controls-none type=radio name=ruby-controls value=NONE>
|
||||
<label for=ruby-controls-none>Japanese Only</label>
|
||||
<input id=ruby-controls-both type=radio name=ruby-controls value=BOTH checked>
|
||||
<label for=ruby-controls-both>Both</label>
|
||||
<input id=ruby-controls-hidden type=radio name=ruby-controls value=HIDDEN>
|
||||
<label for=ruby-controls-hidden>English Only</label>
|
||||
</fieldset>
|
||||
</aside>
|
||||
{{- end }}
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
{{ partial "content_header.html" . }}
|
||||
|
||||
{{ partial "table_of_contents.html" . }}
|
||||
|
||||
{{- $layout := .Params.layout -}}
|
||||
<article{{ with $layout }} class="{{ . }}"{{ end }}>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{- $content := .Content -}}
|
||||
{{ with $layout := .Params.layout }}
|
||||
<article class="{{ $layout }}">
|
||||
{{ $content }}
|
||||
</article>
|
||||
{{ else }}
|
||||
{{ $content }}
|
||||
{{ end}}
|
||||
|
||||
<footer>
|
||||
{{ partial "footer_tags.html" . }}
|
||||
|
|
|
@ -3,41 +3,42 @@
|
|||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{- if .Title -}}
|
||||
{{ partial "content_header.html" . }}
|
||||
{{- end -}}
|
||||
{{- $photos := partial "photos/list.html" . -}}
|
||||
{{ if eq (len $photos) 0 }}
|
||||
{{ errorf "Missing photo from photos page %q" .Path }}
|
||||
{{ end }}
|
||||
|
||||
{{- $photos := partial "photos/list.html" . -}}
|
||||
{{ if eq (len $photos) 0 }}
|
||||
{{ errorf "Missing photo from photos page %q" .Path }}
|
||||
{{ end }}
|
||||
{{ if eq (len $photos) 1 }}
|
||||
{{- $img := index $photos 0 -}}
|
||||
<figure>
|
||||
<img src="{{ $img.RelPermalink }}"{{ with $img.Params.alt }} alt="{{ . }}"{{ end }}>
|
||||
</figure>
|
||||
|
||||
{{ if eq (len $photos) 1 }}
|
||||
{{- $img := index $photos 0 -}}
|
||||
<figure><img src="{{ $img.RelPermalink }}"{{ with $img.Params.alt }} alt="{{ . }}"{{ end }}></figure>
|
||||
<article>
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
||||
{{ .Content }}
|
||||
{{- if .Params.photo_details | default true -}}
|
||||
{{- partial "photo_exif_table.html" $img.Exif -}}
|
||||
|
||||
{{- if .Params.photo_details | default true -}}
|
||||
{{- partial "photo_exif_table.html" $img.Exif -}}
|
||||
|
||||
{{- if in ($.Site.BaseURL | string) "localhost" -}}
|
||||
{{- partial "development/photo_exif_table.html" $img.Exif -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ else }}
|
||||
<figure>
|
||||
<ul class="carousel">
|
||||
{{- range $photos -}}
|
||||
<li>{{ . }}</li>
|
||||
{{- if in ($.Site.BaseURL | string) "localhost" -}}
|
||||
{{- partial "development/photo_exif_table.html" $img.Exif -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</figure>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{ else }}
|
||||
<figure>
|
||||
<ul class="carousel">
|
||||
{{- range $photos -}}
|
||||
<li>{{ . }}</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
||||
<footer>
|
||||
{{ partial "footer_tags.html" . }}
|
||||
</footer>
|
||||
<footer>
|
||||
{{ partial "footer_tags.html" . }}
|
||||
</footer>
|
||||
{{ end }}
|
||||
|
||||
{{ define "footer" }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- with $photoPage := $.Page.GetPage (printf "photos/%s" (.Get 0)) -}}
|
||||
{{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" 1280 "Height" 1280) -}}
|
||||
{{- $altText := $thumbnail.Params.alt | default .Title -}}
|
||||
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
|
||||
<a class="to-photo-post" href="{{ .RelPermalink }}" title="{{ .Title }}">
|
||||
<img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}>
|
||||
</a>
|
||||
{{- else -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue