Skip to content

Commit c7bf865

Browse files
Feature/search page (#283)
* Fix assignment button * draft for search * half-way throgh * Update search * Update metadata cover url * Add image to pagefind meta * draft for search * try netlify with pagefind * Update search_style.css * many small changes. pagefind generated automatically with docker * fix style * add card style * fix search and simplify code --------- Co-authored-by: Daniele Guido <gui.daniele@gmail.com>
1 parent 25b6a5c commit c7bf865

55 files changed

Lines changed: 900 additions & 121 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ gem "jekyll", "~> 4.2.0"
66
gem "minima", "~> 2.5"
77
gem "jekyll-github-metadata", "~> 2.16"
88
gem "jekyll-datapage-generator", "~> 1.4.0"
9-
# gem "github-pages", group: :jekyll_plugins
9+
# gem "github-pages", group: :jekyll_plugins
10+
gem "webrick", "~> 1.8"

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,64 @@ Syntax highlighted code block
7171
```
7272

7373
For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).
74+
75+
### Add new type of filter to search
76+
77+
Once you have added a new filter type using jekyll in default.html with `meta`, you can add it to the search engine.
78+
For example:
79+
Pass data directly from the metadata to search.
80+
```html
81+
<meta data-pagefind-filter="author:{{author_name.name}}"
82+
property="article:authors" content="{{author}}" />
83+
```
84+
Pass data from a html meta tag content parameter to search.
85+
```html
86+
<meta data-pagefind-filter="mediatype[content]"
87+
property="article:mediatypes" content="{{mediatype}}" />
88+
```
89+
90+
After that, you need to add the new filter type to search.html.
91+
92+
1. In div id="filters" in div class="row" add a new tag. Every new filter should be ended with `_filter`.
93+
```html
94+
<div id="filters" class="col-4">
95+
<div class="row">
96+
<div class="col-6">
97+
<div id="layouts_filter"></div>
98+
<div id="mediatypes_filter"></div>
99+
</div>
100+
<div class="col-6">
101+
<div id="authors_filter"></div>
102+
<div id="tags_filter"></div>
103+
</div>
104+
<!-- here goes a new filter type -->
105+
<div class="col-6">
106+
<div id="new_type_filter"></div>
107+
</div>
108+
</div>
109+
</div>
110+
```
111+
112+
2. In function `display_filters()` in javascript section
113+
```js
114+
...
115+
document.getElementById("authors_filter").innerHTML = "";
116+
document.getElementById("tags_filter").innerHTML = "";
117+
// add here
118+
document.getElementById("new_type_filter").innerHTML = "";
119+
...
120+
```
121+
122+
3. In function `display_filters()` in javascript section, add new case to `switch`
123+
```js
124+
...
125+
case "author":
126+
document.getElementById("authors_filter").innerHTML += new_filter;
127+
break;
128+
case "new_type":
129+
document.getElementById("new_type_filter").innerHTML += new_filter;
130+
break;
131+
...
132+
```
133+
134+
Finally recompile the docker and let pagefind create index.

_assignments/archival-digital-turn/03-boder-archival.de.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ lang: de
55
type: assignment
66
title: "Umwandlung von analog zu digital"
77
order: 3
8-
cover: /assets/images/attachments/12boxes/12boxes_01.png
8+
cover:
9+
url: /assets/images/attachments/12boxes/12boxes_01.png
910
documents:
1011
- pugh-judge-boder
1112
tags:

_assignments/archival-digital-turn/03-boder-archival.en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ lang: en
55
type: assignment
66
title: Transformation from Analogue to Digital
77
order: 3
8-
cover: /assets/images/attachments/12boxes/12boxes_01.png
8+
cover:
9+
url: /assets/images/attachments/12boxes/12boxes_01.png
910
documents:
1011
- pugh-judge-boder
1112
tags:

_assignments/archival-digital-turn/03-boder-archival.fr.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ lang: fr
55
type: assignment
66
title: "Transformation de l’analogique au numérique"
77
order: 3
8-
cover: /assets/images/attachments/12boxes/12boxes_01.png
8+
cover:
9+
url: /assets/images/attachments/12boxes/12boxes_01.png
910
documents:
1011
- pugh-judge-boder
1112
tags:

_assignments/boder/01-analogue-digital.de.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ unit: boder
44
lang: de
55
type: assignment
66
title: Das analoge Drahttonbandgerät im Vergleich zu digitalen Audioaufnahmen
7-
cover: /assets/images/attachments/12boxes/12boxes_02.png
7+
cover:
8+
url: /assets/images/attachments/12boxes/12boxes_02.png
89
order: 1
910
tags:
1011
- geschichte der Kommunikationstechnologie

_assignments/boder/01-analogue-digital.en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ unit: boder
44
lang: en
55
type: assignment
66
title: The analogue wire recorder compared to digital audio recording
7-
cover: /assets/images/attachments/12boxes/12boxes_02.png
7+
cover:
8+
url: /assets/images/attachments/12boxes/12boxes_02.png
89
order: 1
910
tags:
1011
- history of communication technology

_assignments/boder/01-analogue-digital.fr.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ unit: boder
44
lang: fr
55
type: assignment
66
title: Comparaison entre l'enregistreur analogique à fil et l'enregistrement audionumérique
7-
cover: /assets/images/attachments/12boxes/12boxes_02.png
7+
cover:
8+
url: /assets/images/attachments/12boxes/12boxes_02.png
89
order: 1
910
tags:
1011
- histoire des technologies de la communication

_assignments/boder/02-early-accounts-holocaust.de.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ unit: boder
44
lang: de
55
type: assignment
66
title: Verschiedene Verfahren zur Dokumentation von Erfahrungsberichten über den Holocaust
7-
cover: /assets/images/attachments/12boxes/12boxes_03.png
7+
cover:
8+
url: /assets/images/attachments/12boxes/12boxes_03.png
89
order: 2
910
tags:
1011
- Forschungsmethoden

_assignments/boder/02-early-accounts-holocaust.en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ unit: boder
44
lang: en
55
type: assignment
66
title: Different ways of documenting people’s accounts of the Holocaust
7-
cover: /assets/images/attachments/12boxes/12boxes_03.png
7+
cover:
8+
url: /assets/images/attachments/12boxes/12boxes_03.png
89
order: 2
910
tags:
1011
- methods of research

0 commit comments

Comments
 (0)