Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse all sidebar widgets on small devices #622

Merged
merged 5 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/main/scss/_carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}

.carousel-controls {
right: 1rem;
right: 1.75rem;
bottom: 1rem;
z-index: 3;
}
Expand Down
5 changes: 0 additions & 5 deletions assets/main/scss/_profile.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.profile {
color: var(--#{$prefix}secondary-text-on-surface) !important;
padding: 0.5rem 0 0;

.profile-avatar {
height: 120px;
Expand Down Expand Up @@ -48,8 +47,4 @@
text-align: center;
}
}

.social-links {
justify-content: start !important;
}
}
2 changes: 1 addition & 1 deletion assets/main/scss/_surface.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

.bg-surface {
color: var(--#{$prefix}surface-bg) !important;
background-color: var(--#{$prefix}surface-bg) !important;
}

.text-surface {
Expand Down
9 changes: 9 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ other = "{{ .Count }} posts in total"
[post_date]
other = "created on {{ .createdOn }}{{ with .updatedOn }}, updated on {{ . }}{{ end }}."

[posts]
other = "Posts"

[profile]
other = "Profile"

[read_more]
other = "Read More"

Expand Down Expand Up @@ -215,6 +221,9 @@ other = "Contents"
[tags]
other = "Tags"

[taxonomies]
other = "Taxonomies"

[tipeee]
other = "Tipeee"

Expand Down
9 changes: 9 additions & 0 deletions i18n/zh-cn.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ other = "总共 {{ .Count }} 篇文章"
[post_date]
other = "创建于 {{ .createdOn }}{{ with .updatedOn }},更新于 {{ . }}{{ end }}。"

[posts]
other = "文章"

[profile]
other = "Profile"

[read_more]
other = "阅读更多"

Expand Down Expand Up @@ -202,6 +208,9 @@ other = "目录"
[tags]
other = "标签"

[taxonomies]
other = "Taxonomies"

[try_again]
other = "再试一次"

Expand Down
9 changes: 9 additions & 0 deletions i18n/zh-hans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ other = "总共 {{ .Count }} 篇文章"
[post_date]
other = "创建于 {{ .createdOn }}{{ with .updatedOn }},更新于 {{ . }}{{ end }}。"

[posts]
other = "文章"

[profile]
other = "Profile"

[read_more]
other = "阅读更多"

Expand Down Expand Up @@ -202,6 +208,9 @@ other = "目录"
[tags]
other = "标签"

[taxonomies]
other = "Taxonomies"

[try_again]
other = "再试一次"

Expand Down
9 changes: 9 additions & 0 deletions i18n/zh-hant.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ other = "總共 {{ .Count }} 篇文章"
[post_date]
other = "創建於 {{ .createdOn }}{{ with .updatedOn }},更新於 {{ . }}{{ end }}。"

[posts]
other = "文章"

[profile]
other = "Profile"

[read_more]
other = "閱讀更多"

Expand Down Expand Up @@ -202,6 +208,9 @@ other = "目錄"
[tags]
other = "標籤"

[taxonomies]
other = "Taxonomies"

[try_again]
other = "再試一次"

Expand Down
9 changes: 9 additions & 0 deletions i18n/zh-hk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ other = "總共 {{ .Count }} 篇文章"
[post_date]
other = "創建於 {{ .createdOn }}{{ with .updatedOn }},更新於 {{ . }}{{ end }}。"

[posts]
other = "文章"

[profile]
other = "Profile"

[read_more]
other = "閱讀更多"

Expand Down Expand Up @@ -202,6 +208,9 @@ other = "目錄"
[tags]
other = "標籤"

[taxonomies]
other = "Taxonomies"

[try_again]
other = "再試一次"

Expand Down
9 changes: 9 additions & 0 deletions i18n/zh-tw.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ other = "總共 {{ .Count }} 篇文章"
[post_date]
other = "創建於 {{ .createdOn }}{{ with .updatedOn }},更新於 {{ . }}{{ end }}。"

[posts]
other = "文章"

[profile]
other = "Profile"

[read_more]
other = "閱讀更多"

Expand Down Expand Up @@ -202,6 +208,9 @@ other = "目錄"
[tags]
other = "標籤"

[taxonomies]
other = "Taxonomies"

[try_again]
other = "再試一次"

Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/archives.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{{- $path := replace .Permalink $baseURL "" -}}
{{- $date := split $path "/" -}}
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
{{- partial "sidebar" . -}}
<div class="col-lg-8 mb-4">
<div class="container">
{{- partial "breadcrumb" . -}}
Expand All @@ -20,5 +21,4 @@
</div>
</div>
</div>
{{- partial "sidebar" . -}}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/_default/contact.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ define "content" }}
{{- partial "sidebar" . -}}
<div class="col-lg-8">
{{- partial "breadcrumb" . -}}
<div class="contact row component card">
Expand All @@ -14,6 +15,5 @@ <h1 class="card-title">{{ .Title }}</h1>
</div>
</div>
</div>
{{- partial "sidebar" . -}}
{{ end }}

2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{ define "content" }}
{{- partial "sidebar" . -}}
<div class="col-lg-8">
<div class="container">
{{- partial "breadcrumb" . -}}
{{- partial "post" . -}}
</div>
</div>
{{- partial "sidebar" . -}}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ define "content" }}
{{- partial "sidebar" . -}}
<div class="col-lg-8">
<div class="container">
{{- partial "breadcrumb" . -}}
Expand Down Expand Up @@ -38,5 +39,4 @@ <h2 class="taxonomy-title card-title fs-4 my-2 text-surface">
{{- partial "pagination" . -}}
</div>
</div>
{{- partial "sidebar" . -}}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/docs/list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "content" }}
{{- partial "docs/nav" . -}}
{{- partial "docs/sidebar" . -}}
<div class="col-lg-7 ms-auto">
{{ partial "docs/list" . }}
</div>
{{- partial "docs/sidebar" . -}}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/docs/single.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ define "content" }}
{{- partial "docs/nav" . -}}
{{- partial "docs/sidebar" . -}}
<div class="col-lg-7 ms-auto">
<div class="container-fluid">
{{- partial "breadcrumb" . -}}
{{- partial "docs/post" . -}}
</div>
</div>
{{- partial "docs/sidebar" . -}}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "content" }}
{{- partial "carousel" . -}}
{{- partial "sidebar" . -}}
<div class="col-lg-8">
{{ partial "list" . }}
</div>
{{- partial "sidebar" . -}}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/partials/carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="container p-0 mb-4">
<div class="row p-0 m-0">
<div id="carouselHome" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators justify-content-sm-center justify-content-lg-start mb-0 mx-auto ps-0 ps-lg-3">
<div class="carousel-indicators justify-content-sm-center justify-content-lg-start mb-0 mx-auto ps-0 ps-lg-4">
{{- $i := 0 }}
{{- range $pages }}
<button type="button" data-bs-target="#carouselHome" data-bs-slide-to="{{ $i }}" aria-label="{{ .Title }}"
Expand Down
61 changes: 33 additions & 28 deletions layouts/partials/docs/repo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,39 @@
{{- $subPath := default "" .subPath -}}
{{- $contentDir := default "content" $.Site.Language.ContentDir -}}
{{- if $subPath -}}{{ $subPath = printf "/%s" $subPath }}{{- end -}}
<div class="docs-repo row card component">
<div class="card-header">
<h2 class="card-title fs-4 my-2 text-surface">{{ i18n "repo_title" }}</h2>
</div>
<div class="card-body text-secondary-on-surface">
<ul class="list-unstyled">
{{- if $.File -}}
{{- $filePath := printf "%s%s/%s/%s" $branch $subPath $contentDir $.File.Path -}}
<li class="mb-1">
<a href="{{ printf "%s/blob/%s" $url $filePath }}" target="_blank" rel="noopener noreferrer">
<i class="fas fa-fw fa-file-archive"></i> {{ i18n "repo_action_view" }}
</a>
</li>
<li class="mb-1">
<a href="{{ printf "%s/edit/%s" $url $filePath }}" target="_blank" rel="noopener noreferrer">
<i class="fas fa-fw fa-edit"></i> {{ i18n "repo_action_edit" }}
</a>
</li>
{{- end -}}
{{- with $.GitInfo -}}
<li class="mb-1">
<i class="fas fa-fw fa-code"></i> <a href="{{ printf "%s/commit/%s" $url .Hash }}" target="_blank" rel="noopener noreferrer">{{ .AbbreviatedHash }}</a>
</li>
<li class="mb-1">
<i class="fas fa-fw fa-history"></i> {{ .AuthorDate.Format $dateFormat }}
</li>
{{- end -}}
</ul>
<div class="accordion">
<div class="accordion-item docs-repo row card component">
<div class="card-header accordion-header" id="repo-header">
<h2 class="card-title fs-4 my-2 text-surface d-none d-lg-block">{{ i18n "repo_title" }}</h2>
<a class="accordion-button d-lg-none mb-1 collapsed shadow-none p-0 bg-transparent" type="button" data-bs-toggle="collapse" data-bs-target="#repo" aria-expanded="false" aria-controls="repo">
{{ i18n "repo_title" }}
</a>
</div>
<div class="card-body collapse accordion-collapse accordion-body text-secondary-on-surface d-lg-block" id="repo" aria-labelledby="repo-header">
<ul class="list-unstyled">
{{- if $.File -}}
{{- $filePath := printf "%s%s/%s/%s" $branch $subPath $contentDir $.File.Path -}}
<li class="mb-1">
<a href="{{ printf "%s/blob/%s" $url $filePath }}" target="_blank" rel="noopener noreferrer">
<i class="fas fa-fw fa-file-archive"></i> {{ i18n "repo_action_view" }}
</a>
</li>
<li class="mb-1">
<a href="{{ printf "%s/edit/%s" $url $filePath }}" target="_blank" rel="noopener noreferrer">
<i class="fas fa-fw fa-edit"></i> {{ i18n "repo_action_edit" }}
</a>
</li>
{{- end -}}
{{- with $.GitInfo -}}
<li class="mb-1">
<i class="fas fa-fw fa-code"></i> <a href="{{ printf "%s/commit/%s" $url .Hash }}" target="_blank" rel="noopener noreferrer">{{ .AbbreviatedHash }}</a>
</li>
<li class="mb-1">
<i class="fas fa-fw fa-history"></i> {{ .AuthorDate.Format $dateFormat }}
</li>
{{- end -}}
</ul>
</div>
</div>
</div>
{{- end -}}
2 changes: 1 addition & 1 deletion layouts/partials/docs/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<aside class="sidebar d-flex docs-sidebar col-lg-3 position-sticky">
<aside class="sidebar d-flex docs-sidebar col-lg-3 position-sticky order-lg-5">
<div class="container">
{{ partial "hooks/docs/sidebar-begin" . }}
{{ partial "docs/toc" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<aside class="col-lg-4 sidebar d-flex">
<aside class="col-lg-4 sidebar d-flex order-lg-5">
<div class="container d-flex flex-column">
{{ partial "hooks/sidebar-begin" . }}
{{ partial "sidebar/main" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/sidebar/archive-items.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $basePath = printf "/%s/" (strings.TrimPrefix "/" $basePath) }}
{{ range (where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections).GroupByDate "2006" }}
{{- $yearPage := $.GetPage (printf "%s%s" $basePath .Key) }}
<a href="{{ with $yearPage }}{{ .Permalink }}{{ end }}" class="btn btn-sm btn-secondary post-taxonomy me-2 mb-2" title="{{ .Key }}">
<a href="{{ with $yearPage }}{{ .Permalink }}{{ end }}" class="btn btn-sm btn-secondary post-taxonomy ps-3 me-2 mb-2" title="{{ .Key }}">
{{ .Key }} <span class="badge badge-sm text-secondary bg-white ms-1">{{ len .Pages}}</span>
</a>
{{ end }}
33 changes: 19 additions & 14 deletions layouts/partials/sidebar/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@
{{- $basePath := strings.TrimSuffix "/" (default "/archives" .Site.Params.archive.basePath) }}
{{- $basePath = printf "/%s/" (strings.TrimPrefix "/" $basePath) }}
{{- $archivePage := $.GetPage $basePath }}
<section class="row card component">
<div class="card-header">
<h2 class="card-title my-2 fs-4 text-surface">
{{- with $archivePage }}
<a href="{{ .Permalink }}">{{ i18n "archives" }}</a>
{{- else }}
{{ i18n "archives" }}
{{- end }}
</h2>
</div>
<div class="card-body">
{{- partial "sidebar/archive-items" . }}
</div>
</section>
<div class="accordion">
<section class="row card component">
<div class="card-header">
<h2 class="card-title my-2 fs-4 text-surface d-none d-lg-block">
{{- with $archivePage }}
<a href="{{ .Permalink }}">{{ i18n "archives" }}</a>
{{- else }}
{{ i18n "archives" }}
{{- end }}
</h2>
<a class="accordion-button d-lg-none mb-1 collapsed shadow-none p-0 bg-transparent" type="button" data-bs-toggle="collapse" data-bs-target="#archives" aria-expanded="false" aria-controls="archives">
{{ i18n "archives" }}
</a>
</div>
<div class="card-body collapse accordion-collapse accordion-body d-lg-block" id="archives">
{{- partial "sidebar/archive-items" . }}
</div>
</section>
</div>
{{- end }}
Loading