Merge branch 'master' of https://github.com/barziv/hugo-book into feat/dynamic-ltr

This commit is contained in:
barziv 2025-06-07 21:44:32 +03:00
commit 0cdb34dab6
47 changed files with 36 additions and 22 deletions

View File

@ -9,7 +9,7 @@ jobs:
matrix: matrix:
hugo-version: hugo-version:
- 'latest' - 'latest'
- '0.134.2' - '0.146.7'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:

View File

@ -1,6 +1,6 @@
# Hugo Book Theme # Hugo Book Theme
[![Hugo](https://img.shields.io/badge/hugo-0.134-blue.svg)](https://gohugo.io) [![Hugo](https://img.shields.io/badge/hugo-0.146-blue.svg)](https://gohugo.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
![Build with Hugo](https://github.com/alex-shpak/hugo-book/workflows/Build%20with%20Hugo/badge.svg) ![Build with Hugo](https://github.com/alex-shpak/hugo-book/workflows/Build%20with%20Hugo/badge.svg)
@ -33,7 +33,7 @@
## Requirements ## Requirements
- Hugo 0.134 or higher - Hugo 0.146 or higher
- Hugo extended version, [Installation Instructions](https://gohugo.io/installation/) - Hugo extended version, [Installation Instructions](https://gohugo.io/installation/)
## Installation ## Installation
@ -298,7 +298,7 @@ If you are using `config.yaml` or `config.json`, consult the [configuration mark
## Versioning ## Versioning
This theme follows a simple incremental versioning. e.g. `v1`, `v2` and so on. There might be breaking changes between versions. This theme follows a simple incremental versioning. e.g. `v1.0.0`, `v2.0.0` and so on. Releases will happen on breaking changes.
If you want lower maintenance, use one of the released versions. If you want to live on the bleeding edge of changes, you can use the `master` branch and update your website when needed. If you want lower maintenance, use one of the released versions. If you want to live on the bleeding edge of changes, you can use the `master` branch and update your website when needed.

View File

@ -49,11 +49,11 @@ aside nav ul {
list-style: none; list-style: none;
li { li {
margin: 1em 0;
position: relative; position: relative;
} }
a { a, span {
padding: .5em 0;
display: block; display: block;
} }
@ -136,10 +136,12 @@ a .book-icon {
input.toggle + label::after { input.toggle + label::after {
content: ""; content: "";
align-self: center;
} }
input.toggle:checked + label::after { input.toggle:checked + label::after {
content: ""; content: "";
align-self: center;
} }
} }
@ -155,7 +157,7 @@ body[dir="rtl"] .book-menu {
} }
.book-section-flat { .book-section-flat {
margin: $padding-16 * 2 0; margin: $padding-16 0;
> a, > a,
> span, > span,
@ -175,7 +177,7 @@ body[dir="rtl"] .book-menu {
} }
.book-post { .book-post {
margin-bottom: $padding-16 * 2; margin-bottom: $padding-16 * 4;
.book-post-date img { .book-post-date img {
height: 1em; height: 1em;
@ -210,7 +212,7 @@ body[dir="rtl"] .book-menu {
.book-search { .book-search {
position: relative; position: relative;
margin: $padding-16 0; margin: $padding-8 0;
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
input { input {
@ -244,6 +246,10 @@ body[dir="rtl"] .book-menu {
@include spin(1s); @include spin(1s);
} }
ul a {
padding-bottom: 0;
}
small { small {
opacity: 0.5; opacity: 0.5;
} }
@ -280,7 +286,7 @@ body[dir="rtl"] .book-menu {
} }
.book-languages { .book-languages {
margin-block-end: $padding-16 * 2; margin-bottom: $padding-16;
ul { ul {
padding-inline-start: 1.5em; padding-inline-start: 1.5em;

14
i18n/pt-BR.yaml Normal file
View File

@ -0,0 +1,14 @@
- id: Search
translation: Buscar
- id: Edit this page
translation: Editar página
- id: Last modified by
translation: Última modificação por
- id: Expand
translation: Expandir
- id: bookSearchConfig
translation: '{ cache: true }'

View File

@ -1,5 +1,5 @@
- id: Search - id: Search
translation: Buscar translation: Pesquisar
- id: Edit this page - id: Edit this page
translation: Editar página translation: Editar página

View File

@ -13,8 +13,8 @@
<ul class="book-languages"> <ul class="book-languages">
<li> <li>
<input type="checkbox" id="languages" class="toggle" /> <input type="checkbox" id="languages" class="toggle" />
<label for="languages" class="flex justify-between"> <label for="languages" class="flex">
<a role="button" class="flex align-center"> <a role="button" class="flex flex-auto">
<img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" /> <img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" />
{{ $.Site.Language.LanguageName }} {{ $.Site.Language.LanguageName }}
</a> </a>

View File

@ -30,8 +30,8 @@
{{ if .Page.Params.BookCollapseSection }} {{ if .Page.Params.BookCollapseSection }}
<input type="checkbox" id="section-{{ md5 .Page }}" class="toggle" {{ if or $current $ancestor }}checked{{ end }} /> <input type="checkbox" id="section-{{ md5 .Page }}" class="toggle" {{ if or $current $ancestor }}checked{{ end }} />
<label for="section-{{ md5 .Page }}" class="flex justify-between"> <label for="section-{{ md5 .Page }}" class="flex">
<a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}"> <a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="flex-auto {{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}} {{- partial "docs/title" .Page -}}
</a> </a>
</label> </label>

View File

@ -3,7 +3,7 @@
{{ range $term, $_ := .Site.Taxonomies }} {{ range $term, $_ := .Site.Taxonomies }}
{{ with $.Site.GetPage (printf "/%s" $term | urlize) }} {{ with $.Site.GetPage (printf "/%s" $term | urlize) }}
<li class="book-section-flat"> <li class="book-section-flat">
<strong>{{ .Title | title }}</strong> <span>{{ .Title | title }}</span>
<ul> <ul>
{{ range .Pages }} {{ range .Pages }}
<li class="flex justify-between"> <li class="flex justify-between">

View File

@ -7,9 +7,6 @@
{{ partial "docs/post-meta" . }} {{ partial "docs/post-meta" . }}
<div class="book-post-content"> <div class="book-post-content">
{{- .Summary -}} {{- .Summary -}}
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">...</a>
{{ end }}
</div> </div>
</article> </article>
{{ end }} {{ end }}

View File

@ -7,9 +7,6 @@
{{ partial "docs/post-meta" . }} {{ partial "docs/post-meta" . }}
<p> <p>
{{- .Summary -}} {{- .Summary -}}
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">...</a>
{{ end }}
</p> </p>
</article> </article>
{{ end }} {{ end }}