31 Oct 2022
Aiming to replace Stork for my Pelican-powered static site. [Nic Note: This site]
Asked question regarding support of Github Pages:
Requires Node.js with
Not working with code snippet provided on Pagefind homepage.
Seems like an issue with CSS and JS paths.
.css files to Pelican
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?
02 Nov 2022
Working now, using:
npx -y pagefind --source "/Users/USER/path/to/folder/with/html/files" --bundle-dir pagefind
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.
. ├── 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
- exclude folders from search index (eg
- show only sections with results
- show categories without having to expand each
focus: trueon 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
author folder, etc..
Using Pelican as SSG and I can't figure out how to use
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