Getting search box to include blog posts #395
Replies: 4 comments 12 replies
-
Hey @cameronelliott, nice one!
That's it: |
Beta Was this translation helpful? Give feedback.
-
This worked for me. But just FYI for those using the child theme, you'll need to create the folder assets/js/ in the root directory if it doesn't exist and copy the index.js file from node_modules/@hyas/assets/js/index.js to then make the modifications suggested above. |
Beta Was this translation helpful? Give feedback.
-
Configurable or system wide search would make a lot of sense for v1.0. My current configuration has no docs section at all, but sections books and faq, and a few more, all created with "npm run create -- --kind docs [section]". Well, I have a tiny blog currently, which I may remove later again. For the blog the search may work, but I have deactivated that search box now. For faq it would make sense when it would be working. |
Beta Was this translation helpful? Give feedback.
-
Thanks! You've found a bug that The files in ---
title: "{{ replace .Name "-" " " | title }}"
description: ""
lead: ""
date: {{ .Date }}
lastmod: {{ .Date }}
draft: false
images: []
menu:
{{ .Section }}:
parent: "lorem"
identifier: "{{ .Name }}-{{ delimit (shuffle (split (md5 .Name) "" )) "" }}"
weight: 100
toc: true
--- Which will render into: ---
title: "Ipsum"
description: ""
lead: ""
date: 2023-04-15T13:43:59+02:00
lastmod: 2023-04-15T13:43:59+02:00
draft: false
images: []
menu:
guides:
parent: "lorem"
identifier: "ipsum-413b8467abfc839d649b59e84ebbd377"
weight: 100
toc: true
--- Now, you can set the sections (types) to include in search — in Doks 1.0 like so (in # FlexSearch
flexSearch = true # true (default) or false
indexPages = ["books", "faq"] # [] (all regular pages, default) or list of sections (e.g. ["blog", "guides"])
showSearch = [] # [] (all pages, default) or homepage (optionally) and list of sections (e.g. ["homepage", "blog", "guides"]) In Doks 0.5 like so (in [..]
[options]
[..]
flexSearch = true
searchSectionsShow = []
searchSectionsIndex = ["books", "faq"]
[..] Note that, now (in Doks 0.5) you'll have to copy Doks 1.0 will use the |
Beta Was this translation helpful? Give feedback.
-
Is there some way to get the search-box to include blog articles?
As far as I can tell, the search box doesn't seem to be including the blog articles.
Thanks,
Cameron
Beta Was this translation helpful? Give feedback.
All reactions