31 Oct 2022
Aiming to replace Stork for my Pelican-powered static site. [Nic Note: This site]


Asked question regarding support of Github Pages:

Setup
Requires Node.js with npx
.
Install from:

Not working with code snippet provided on Pagefind homepage.
Seems like an issue with CSS and JS paths.
Copied .js
and .css
files to Pelican theme/js
and theme/css
.
This works (currently Live), ie search input and output appear.. but empty.
404 on https://notes.nicolasdeville.com/_pagefind/pagefind-ui.css
(which I should have tried and figured out at the previous step!) - which means the standard Github Actions worfklow triggered by Github Pages does not include the folder when deploying? ๐ค
Downloaded the Artifact (ie root folder content of the website on server) from Github Pages, and indeed the folder _pagefind
is not included, despite being present in the main
Github branch used as source for the default Github Actions workflow that generates Github Pages.
Confirmed that folders prefixed with _
do not get included in the build: https://github/orgs/community/discussions/23640
How to get it included?
Asked: https://github/CloudCannon/pagefind/discussions/126
02 Nov 2022
Working now, using:
npx -y pagefind --source "/Users/USER/path/to/folder/with/html/files" --bundle-dir pagefind
The last pagefind
argument defines the name of the folder to be created, overriding the default _pagefind
which did not work because Github Pages ignores folders prefixed with _
upon deployment.
output:
.
โโโ filter
โโโ fragment
โโโ index
โโโ pagefind-entry.json
โโโ pagefind-ui.css
โโโ pagefind-ui.js
โโโ pagefind.en_4dc9564564.pf_meta
โโโ pagefind.en_8ba44c3efa.pf_meta
โโโ pagefind.en_a9db73dbfe.pf_meta
โโโ pagefind.en_eca087938c.pf_meta
โโโ pagefind.en_fbece7798f.pf_meta
โโโ pagefind.js
โโโ wasm.en.pagefind
โโโ wasm.unknown.pagefind
Next steps:
- exclude folders from search index (eg
author
,tag
, etc..) - show only sections with results
- show categories without having to expand each
focus: true
on load- navigate results with keyboard
exclude folders from search index
Asked on Github: https://github/CloudCannon/pagefind/discussions/127
Is there a way to exclude (sub)folders or specific files from the index?
I'm getting duplicate results because the same article will show up in different folders, eg tags
folder, author
folder, etc..
Using Pelican as SSG and I can't figure out how to use data-pagefind-body
or data-pagefind-ignore
in the article's HTML in a way that they would be targeted depending on folder the article resides in.
For clarity, here is my output/source folder indicating where folders should be removed:
.
โโโ 2019 /// REMOVE
โโโ 2020 /// REMOVE
โโโ 2021 /// REMOVE
โโโ 2022 /// REMOVE
โโโ ABOUT /// REMOVE
โโโ BingSiteAuth.xml
โโโ CNAME
โโโ ai
โโโ apps
โโโ archives.html /// REMOVE
โโโ author /// REMOVE
โโโ authors.html /// REMOVE
โโโ b2b-sales
โโโ books
โโโ careerplaybook
โโโ categories
โโโ csvs /// REMOVE
โโโ extra /// REMOVE
โโโ favicon.ico
โโโ googlexxxxxxxxxxx.html /// REMOVE
โโโ helpers
โโโ home-office
โโโ images
โโโ index.html
โโโ interests
โโโ leadership
โโโ learning
โโโ movies
โโโ pagefind /// my Pagefind index folder
โโโ pdfs
โโโ projects
โโโ python
โโโ random
โโโ robots.txt
โโโ sitemap.xml
โโโ startups
โโโ tag /// REMOVE
โโโ tags.html /// REMOVE
โโโ tesla
โโโ theme
โโโ why