Skip to content

Commit

Permalink
Merge pull request #25 from dasc-lab/feat/search
Browse files Browse the repository at this point in the history
  • Loading branch information
dev10110 authored Nov 13, 2024
2 parents 2de7987 + b0c4546 commit 084b655
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Index pagefind
run: npx -y pagefind --source "public"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions content/search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Search
layout: search
---
4 changes: 4 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ buildFuture = true
name = "Projects"
url = "/projects/"
weight = 4
[[menu.main]]
name = "Search"
url = "/search/"
weight = 100

[params]
dateFormat = "Jan 2, 2006"
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

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

{{ range .Pages.ByPublishDate.Reverse }}

Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

{{ .Content }}

Expand Down
17 changes: 17 additions & 0 deletions layouts/page/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ define "main" }}


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

{{/* <p> Rendered from layouts/page/search </p> */}}

<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-ui.js"></script>
<div id="search"></div>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: "#search", showSubResults: true });
});
</script>

{{ end }}
2 changes: 1 addition & 1 deletion layouts/papers/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

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

{{ range .Pages.ByPublishDate.Reverse.GroupByDate "2006" }}
<div class="py-3">
Expand Down
2 changes: 1 addition & 1 deletion layouts/papers/single.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "main" }}

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

<div class="my-3">
<h2>{{ .Title }}</h2>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ .Site.Title }}</title>
<title>{{ .Title }}</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
{{ partial "style.html" . }}
</head>
2 changes: 1 addition & 1 deletion layouts/people/people.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<h1> People</h1>

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

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

Expand Down
2 changes: 1 addition & 1 deletion layouts/people/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

<div class="row">
<div class="col-6 col-md-3">
Expand Down

0 comments on commit 084b655

Please sign in to comment.