You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-3Lines changed: 31 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,10 @@ Blist is a clean and fast blog theme for your Hugo site.
12
12
13
13
- Responsive content
14
14
- Blog pagination
15
+
- Text Search
15
16
- Social links
16
17
- Dark mode
18
+
- Fast performance
17
19
18
20
## Preview
19
21
@@ -43,7 +45,6 @@ Blist theme ships with an fully configured example site. For a quick preview:
43
45
44
46
Copy the `package.json` file from `themes/showcase` folder to your hugo website root folder, and run `npm install`.
45
47
46
-
47
48
```sh
48
49
cd themes/blist/exampleSite/
49
50
hugo serve --themesDir ../..
@@ -68,7 +69,7 @@ The following explains how to add content to your Hugo site. You can find sample
68
69
├── blog # Blog Section
69
70
│ ├── post1 # Post 1
70
71
│ ├── post2 # Post 2
71
-
│ └── _index
72
+
│ └── _index
72
73
└── ...
73
74
74
75
## Configure your site
@@ -79,14 +80,41 @@ From `exampleSite/`, copy `config.toml` to the root folder of your Hugo site and
79
80
80
81
Menu in Blist theme is pre-set to have all section names. You can include custom links in header using the `menu.main` option config.toml.
81
82
83
+
## Darkmode
84
+
85
+
`[params.darkModeToggle]` enables the dark mode toggle in header. The preference is then saved so that the mode is automatically chosen for return visits.
86
+
87
+
## Search
88
+
89
+
`[params.enableSearch]` option is used to enable search option in the theme.
90
+
91
+
- Adds the search icon in header
92
+
- Generates the search index
93
+
- Uses fuse.js to enable searching through content
94
+
95
+
In order to search, you can either click on the search icon from header or press `Ctrl/Cmd + /` key combination.
96
+
97
+
**Note:**
98
+
99
+
Make sure to enable JSON in outputs array.
100
+
101
+
```
102
+
[outputs]
103
+
home = ["HTML", "RSS", "JSON"]
104
+
```
105
+
82
106
### Latex
83
107
84
108
Enable Mathematical options: set `math: true` in your markdown frontmatter
85
109
86
-
## Google Analytics
110
+
###Google Analytics
87
111
88
112
Set `googleAnalytics` in `config.toml` to activate Hugo's [internal Google Analytics template](https://gohugo.io/templates/internal/#google-analytics).
If you have a question, please [open an issue](https://github.com/apvarun/blist-hugo-theme/issues) for help and to help those who come after you. The more information you can provide, the better!
event.preventDefault();// stop window from scrolling
64
+
if(document.activeElement==maininput){first.focus();}// if the currently focused element is the main input --> focus the first <li>
65
+
elseif(document.activeElement==last){last.focus();}// if we're at the bottom, stay there
66
+
else{document.activeElement.parentElement.nextSibling.firstElementChild.focus();}// otherwise select the next search result
67
+
}
68
+
}
69
+
70
+
// UP (38) arrow
71
+
if(event.keyCode==38){
72
+
if(searchVisible&&resultsAvailable){
73
+
event.preventDefault();// stop window from scrolling
74
+
if(document.activeElement==maininput){maininput.focus();}// If we're in the input box, do nothing
75
+
elseif(document.activeElement==first){maininput.focus();}// If we're at the first item, go to input box
76
+
else{document.activeElement.parentElement.previousSibling.firstElementChild.focus();}// Otherwise, select the search result above the current active one
0 commit comments