Skip to content

Commit 3d5df51

Browse files
committed
Notable changes:
Collapsed menus can be navigated without changing page! Most SCSS vars were migration to CSS vars. MermaidJS configuration can be customized. Lead image can be now added to posts via image: frontmatter. New partials: before and after toc. New translations: Traditional Chinese (#335) Turkish (#300) Other changes and fixes: Post title rendering is now using proper partial. Collapsible menus are now changing arrow on toggle (#332). Link to SCM is now pointing to main branch by default. Edit link can be more customized. Bug Fix: Empty .Site.Params.contentDir (#312) Button shortcode can now render markdown (#308) Set default content direction to ltr (#307) New 'BookOnlyTranslated' property to display only links to translated pages (#303) MermaidJS upgraded to v8.9.0 (#305) New page param: bookSearchExclude to exclude pages from search index
1 parent 9c0603e commit 3d5df51

File tree

21 files changed

+181
-24
lines changed

21 files changed

+181
-24
lines changed

website/themes/book/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ disableKinds = ['taxonomy', 'taxonomyTerm']
163163
# Set source repository location.
164164
# Used for 'Last Modified' and 'Edit this page' links.
165165
BookRepo = 'https://github.com/alex-shpak/hugo-book'
166+
167+
# Specifies commit portion of the link to the page's last modified commit hash for 'doc' page
168+
# type.
169+
# Required if 'BookRepo' param is set.
170+
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
171+
# Github uses 'commit', Bitbucket uses 'commits'
172+
BookCommitPath = 'commit'
166173

167174
# Enable 'Edit this page' links for 'doc' page type.
168175
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
@@ -254,6 +261,7 @@ There are few empty partials you can override in `layouts/partials/`
254261
| `assets/_custom.scss` | Customise or override scss styles |
255262
| `assets/_variables.scss` | Override default SCSS variables |
256263
| `assets/_fonts.scss` | Replace default font with custom fonts (e.g. local files or remote like google fonts) |
264+
| `assets/mermaid.json` | Replace Mermaid initialization config |
257265

258266
### Plugins
259267

website/themes/book/assets/_main.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ ul.pagination {
125125
input.toggle:checked + label + ul {
126126
display: block;
127127
}
128+
129+
input.toggle + label::after {
130+
content: "";
131+
}
132+
133+
input.toggle:checked + label::after {
134+
content: "";
135+
}
128136
}
129137

130138
.book-section-flat {

website/themes/book/assets/plugins/_scrollbars.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
}
1313

1414
:hover::-webkit-scrollbar-thumb {
15-
background: $gray-500;
15+
background: var(--gray-500);
1616
}
1717

1818
// MS
1919
body {
20-
-ms-overflow-style: -ms-autohiding-scrollbar
20+
-ms-overflow-style: -ms-autohiding-scrollbar;
2121
}
2222

2323
// Future
2424
.book-menu nav {
25-
scrollbar-color: transparent $gray-500;
25+
scrollbar-color: transparent var(--gray-500);
2626
}

website/themes/book/exampleSite/config.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,17 @@ enableGitInfo = true
7575
# Used for 'Last Modified' and 'Edit this page' links.
7676
BookRepo = 'https://github.com/alex-shpak/hugo-book'
7777

78+
# (Optional, default 'commit') Specifies commit portion of the link to the page's last modified
79+
# commit hash for 'doc' page type.
80+
# Requires 'BookRepo' param.
81+
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
82+
# Github uses 'commit', Bitbucket uses 'commits'
83+
# BookCommitPath = 'commit'
84+
7885
# Enable "Edit this page" links for 'doc' page type.
7986
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
8087
# Edit path must point to root directory of repo.
81-
BookEditPath = 'edit/master/exampleSite'
88+
BookEditPath = 'edit/main/exampleSite'
8289

8390
# Configure the date format used on the pages
8491
# - In git information
@@ -108,4 +115,4 @@ enableGitInfo = true
108115

109116
# /!\ This is an experimental feature, might be removed or changed at any time
110117
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
111-
BookTranslatedOnly = true
118+
BookTranslatedOnly = false

website/themes/book/exampleSite/config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,17 @@ params:
7171
# Used for 'Last Modified' and 'Edit this page' links.
7272
BookRepo: https://github.com/alex-shpak/hugo-book
7373

74+
# (Optional, default 'commit') Specifies commit portion of the link to the page's last modified
75+
# commit hash for 'doc' page type.
76+
# Requires 'BookRepo' param.
77+
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
78+
# Github uses 'commit', Bitbucket uses 'commits'
79+
# BookCommitPath: commit
80+
7481
# Enable "Edit this page" links for 'doc' page type.
7582
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
7683
# Edit path must point to root directory of repo.
77-
BookEditPath: edit/master/exampleSite
84+
BookEditPath: edit/main/exampleSite
7885

7986
# Configure the date format used on the pages
8087
# - In git information
@@ -104,4 +111,4 @@ params:
104111

105112
# /!\ This is an experimental feature, might be removed or changed at any time
106113
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
107-
BookTranslatedOnly: true
114+
BookTranslatedOnly: false
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: ভূমিকা
3+
type: docs
4+
---
5+
6+
# বাংলা ভাষায় শুরু করুন
7+
8+
{{< columns >}}
9+
## অস্ট্রিস চিপসে ফুর্তিভা
10+
11+
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
12+
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
13+
modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies
14+
15+
<--->
16+
17+
## সুইস কোটা ভোটে
18+
19+
Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat:
20+
miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod
21+
nunc! Fragosis suae dextra geruntur functus vulgata.
22+
{{< /columns >}}
23+
24+
25+
## টেম্পোরার নিশি
26+
27+
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
28+
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
29+
sequens!
30+
31+
var panel = ram_design;
32+
if (backup + system) {
33+
file.readPoint = network_native;
34+
sidebar_engine_device(cell_tftp_raster,
35+
dual_login_paper.adf_vci.application_reader_design(
36+
graphicsNvramCdma, lpi_footer_snmp, integer_model));
37+
}
38+
public_keyboard_docking += error.controller_gibibyte_plug.ip(4,
39+
asciiPetaflops, software(supercomputer_compatible_status + 4));
40+
dynamic_disk.indexModeLaptop = bufferTftpReality;
41+
var export_vlog_sequence = trinitron_flowchart + supercomputer_cluster_rj(
42+
-1, toolbar_powerpoint_query, -2 / multiprocessing_impression);
43+
44+
## Locis suis novi cum suoque decidit eadem
45+
46+
Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab? Venit spes
47+
versus finis sermonibus patefecit murum nec est sine oculis. _Ille_ inmota
48+
macies domoque caelestia cadit tantummodo scelus procul, corde!
49+
50+
1. Dolentem capi parte rostro alvum habentem pudor
51+
2. Fulgentia sanguine paret
52+
3. E punior consurgit lentus
53+
4. Vox hasta eras micantes
54+
55+
## Facibus pharetrae indetonsusque indulsit sic incurrite foliis
56+
57+
Nefandam et prisci palmas! Blandita cutis flectitur montis macies, te _nati_
58+
Latiis; turbaque inferias. Virginis tibi peracta avidusque facies caper nec, e
59+
at ademptae, mira.
60+
61+
direct *= font(inputScareware(sliHome), crossplatform.byte(
62+
ppl_encryption.excel_e_rte(integratedModelModifier), timeVirtual,
63+
floating_speakers.media_printer(us, yahoo, primaryPhp)));
64+
friendly_metal_flatbed(cd, isoPrimaryStorage(reader), dmaMirrored);
65+
if (parse_flash_cron.metalGif(1, adServiceDevice, utility)) {
66+
adf -= operation_cdma_samba;
67+
imapGif.switch += torrent;
68+
} else {
69+
pmu.disk_captcha = digital_ppp_pci + recursionTransistor(5, dram);
70+
ajax_service += grayscalePythonLock;
71+
google_scroll_capacity = ftp + engine_dslam_sidebar / tape - 1;
72+
}
73+
drive_rw = zipTftp;
74+
var suffix = software_router_extension.dimm_ddr(-5,
75+
kernel_digital_minisite);
76+
77+
Vocavit toto; alas **mitis** maestus in liquidarum ab legi finitimosque dominam
78+
tibi subitus; Orionis vertitur nota. Currere alti etiam seroque cernitis
79+
innumeris miraturus amplectique collo sustinet quemque! Litora ante turba?

website/themes/book/exampleSite/content/docs/shortcodes/mermaid.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
[Mermaid](https://mermaidjs.github.io/) is library for generating svg charts and diagrams from text.
44

5+
{{< hint info >}}
6+
**Override Mermaid Initialization Config**
7+
8+
To override the [initialization config](https://mermaid-js.github.io/mermaid/#/Setup) for Mermaid,
9+
create a `mermaid.json` file in your `assets` folder!
10+
{{< /hint >}}
11+
512
## Example
613

714
{{< columns >}}
@@ -36,3 +43,4 @@ sequenceDiagram
3643
{{< /mermaid >}}
3744

3845
{{< /columns >}}
46+

0 commit comments

Comments
 (0)