Skip to content
Permalink
Browse files

Move index generation to Hugo

  • Loading branch information...
Bart de Goede
Bart de Goede committed Jul 12, 2019
1 parent 7eccae4 commit 335d19e81016633823ccfb6fbb2038c891182bbb
Showing with 18 additions and 73 deletions.
  1. +0 −68 Gruntfile.js
  2. +4 −0 config.toml
  3. +0 −3 deploy.sh
  4. +13 −0 layouts/index.json
  5. +0 −1 static/js/search/index.json
  6. +1 −1 static/js/search/search.js

This file was deleted.

@@ -21,6 +21,10 @@ assetDir = "static"
url = "/about/"
identifier = "about"

[outputs]
home = ["HTML", "JSON"]
page = ["HTML"]

[params]
# If false display full article contents in blog index.
# Otherwise show description and 'read on' link to individual blog post page.
@@ -5,9 +5,6 @@ echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
# Build the project.
hugo # if using a theme, replace with `hugo -t <YOURTHEME>`

# build search index
grunt search-index

# Go To Public folder
cd public
# Add changes to git.
@@ -0,0 +1,13 @@
[{{ range $index, $page := .Site.Pages }}
{{- if eq $page.Type "post" -}}
{{- if $page.Plain -}}
{{- if and $index (gt $index 0) -}},{{- end }}
{
"href": "{{ $page.Permalink }}",
"title": "{{ htmlEscape $page.Title }}",
"categories": [{{ range $tindex, $tag := $page.Params.categories }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}],
"content": {{$page.Plain | jsonify}}
}
{{- end -}}
{{- end -}}
{{- end -}}]

This file was deleted.

@@ -1,7 +1,7 @@
var searchIndex, $results, pagesIndex;

function initSearchIndex() {
$.getJSON('/js/search/index.json')
$.getJSON('/index.json')
.done(function(documents) {
pagesIndex = documents;
searchIndex = lunr(function() {

0 comments on commit 335d19e

Please sign in to comment.
You can’t perform that action at this time.