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

Feat/new search #4835

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 5 additions & 1 deletion config/_default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ languages:
- identifier: guides
name: Guides
url: /guides/
weight: 3
weight: 3
markup:
goldmark:
renderer:
unsafe: true
outputs:
home : [HTML, RSS, JSON]
page : HTML
6 changes: 6 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<section class="section">
<div class="row">
<h2>{{ i18n "how-we-can-help" }}</h2>
{{ $p := where .Site.Pages "Section" "==" "blog" }}

<h2>{{ $p }}</h2>



<div>
<div class="row">
<div class="col-md-6">
Expand Down
16 changes: 4 additions & 12 deletions layouts/index.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{{- $.Scratch.Add "pagesIndex" slice -}}
{{- $pageIndex := slice -}}
{{- range $index, $page := .Site.Pages -}}



{{- if gt (len $page.Content) 0 -}}
{{- $pageData := (dict "title" $page.Title "href" $page.Permalink "description" $page.Params.description "type" $page.Type "date" $page.Params.date "archived" $page.Params.archived "translationKey" $page.Params.translationKey "content" ($page.Content | plainify)) -}}
{{- $.Scratch.Add "pagesIndex" $pageData -}}


{{- end -}}

{{- $pageIndex = $pageIndex | append (dict "index" $index "title" $page.Title "href" $page.Permalink "description" $page.Params.description "type" $page.Type "date" $page.Params.date "archived" $page.Params.archived "translationKey" $page.Params.translationKey "content" ($page.Content | plainify)) -}}
{{- end -}}
{{- $.Scratch.Get "pagesIndex" | jsonify -}}
{{- $pageIndex | jsonify -}}

4 changes: 3 additions & 1 deletion layouts/partials/search-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
</div>
</div>

<script type="text/javascript" src="/js/search.js"></script>
<!-- <script type="text/javascript" src="/js/search.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/index.min.js"></script>
<script type="text/javascript" src="/js/new-search.js"></script>
<!-- lunr script -->
<script src="/js/lunr.js"></script>
<!-- i18next script -->
Expand Down
Loading