Skip to content

Commit 084b655

Browse files
authored
Merge pull request #25 from dasc-lab/feat/search
2 parents 2de7987 + b0c4546 commit 084b655

File tree

11 files changed

+34
-7
lines changed

11 files changed

+34
-7
lines changed

.github/workflows/hugo.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161
--gc \
6262
--minify \
6363
--baseURL "${{ steps.pages.outputs.base_url }}/"
64+
- name: Index pagefind
65+
run: npx -y pagefind --source "public"
6466
- name: Upload artifact
6567
uses: actions/upload-pages-artifact@v3
6668
with:

content/search.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Search
3+
layout: search
4+
---

hugo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ buildFuture = true
2929
name = "Projects"
3030
url = "/projects/"
3131
weight = 4
32+
[[menu.main]]
33+
name = "Search"
34+
url = "/search/"
35+
weight = 100
3236

3337
[params]
3438
dateFormat = "Jan 2, 2006"

layouts/_default/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<h1>{{ .Title }}</h1>
55

6-
<p class="d-none"> Rendered from layouts/_defaults/list </p>
6+
{{/* <p class="d-none"> Rendered from layouts/_defaults/list </p> */}}
77

88
{{ range .Pages.ByPublishDate.Reverse }}
99

layouts/_default/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<h1>{{ .Title }}</h1>
44

5-
<p class="d-none"> Rendered from /layouts/_defaults/single.html </p>
5+
{{/* <p class="d-none"> Rendered from /layouts/_defaults/single.html </p> */}}
66

77
{{ .Content }}
88

layouts/page/search.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{ define "main" }}
2+
3+
4+
<h1>{{ .Title }}</h1>
5+
6+
{{/* <p> Rendered from layouts/page/search </p> */}}
7+
8+
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
9+
<script src="/pagefind/pagefind-ui.js"></script>
10+
<div id="search"></div>
11+
<script>
12+
window.addEventListener('DOMContentLoaded', (event) => {
13+
new PagefindUI({ element: "#search", showSubResults: true });
14+
});
15+
</script>
16+
17+
{{ end }}

layouts/papers/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<h1>{{ .Title }}</h1>
55

6-
<p class="d-none"> Rendered from layouts/papers/list </p>
6+
{{/* <p class="d-none"> Rendered from layouts/papers/list </p> */}}
77

88
{{ range .Pages.ByPublishDate.Reverse.GroupByDate "2006" }}
99
<div class="py-3">

layouts/papers/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ define "main" }}
22

3-
<p class="d-none"> Rendered from /layouts/papers/single.html </p>
3+
{{/* <p class="d-none"> Rendered from /layouts/papers/single.html </p> */}}
44

55
<div class="my-3">
66
<h2>{{ .Title }}</h2>

layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<head>
22
<meta charset="utf-8">
33
<meta name="viewport" content="width=device-width, initial-scale=1">
4-
<title>{{ .Site.Title }}</title>
4+
<title>{{ .Title }}</title>
55
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
66
{{ partial "style.html" . }}
77
</head>

layouts/people/people.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<h1> People</h1>
99

10-
<p class="d-none"> Rendered from /layouts/people/people </p>
10+
{{/* <p class="d-none"> Rendered from /layouts/people/people </p> */}}
1111

1212
{{ $categories := slice "Faculty" "PostDoc" "PhD" "Masters" "Visiting" "Alumni" }}
1313

layouts/people/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<h1>{{ .Title }}</h1>
44

5-
<p class="d-none"> Rendered from /layouts/people/single.html </p>
5+
{{/* <p class="d-none"> Rendered from /layouts/people/single.html </p> */}}
66

77
<div class="row">
88
<div class="col-6 col-md-3">

0 commit comments

Comments
 (0)