Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a searchable website of formulas similar to Homebew #174

Merged
merged 22 commits into from
Feb 29, 2024
Merged

Create a searchable website of formulas similar to Homebew #174

merged 22 commits into from
Feb 29, 2024

Conversation

jcbhmr
Copy link
Contributor

@jcbhmr jcbhmr commented Jan 29, 2024

based on https://formulae.brew.sh/ but it uses https://docsearch.algolia.com/ -- this implementation uses vitepress local search

PREVIEW IT HERE

ref fontist/fontist.github.io#5
ref fontist/fontist.github.io#7

merge this PR before the web redesign PR: fontist/fontist.github.io#21

this pr would:

  1. add a docs/ folder which contains docs (which go on the website) about formulas
  2. add a /formulas/<formula_subpath>.html page for each formula in the Formulas root folder
  3. have a search box powered by minisearch through Vitepress (zero config)
  4. intended to be deployed via github pages
  5. would appear as https://fontist.org/formulas/ due to github pages https://<org>.github.io/<repo>/ pages site structure
  6. uses MARKDOWN instead of ASCIIDOC for docs
  7. add a tiny bit more content so its more than just a search box lol
  8. transfer some of the content from the readme to the docs website
  9. add the copyright footer to the config
  10. add the logo to the config
  11. add a fontist.org root link to the navbar
  12. any additional configs and such
  13. adds a github action to deploy the v3 branch to gh pages
  14. add more pages to the /guide/ folder? split the page into multiple pages? idk maybe just move the "/guide/create-formula.md" out of the /guide/ folder if no other pages lol
  15. configure the edit link https://vitepress.dev/reference/default-theme-edit-link

you can preview it here:
https://jcbhmr.me/formulas/ => fontist.org/formulas/

you can edit it with an in-browser ide here (make sure you cd docs and npm install in the docs folder. then run npm run dev) https://pr.new/https://github.com/jcbhmr/formulas

more info:

  • search is powered by minisearch via vitepress https://vitepress.dev/reference/default-theme-search via zero-config search: { provider: "local" } enable toggle
  • vitepress is a vite-powered static site generator https://vitepress.dev/
  • it uses vue if you do advanced things
  • most things are provided with zero config (which is why i like it)
  • ⚠️ uses JAVASCRIPT instead of RUBY; i can tell @fontist is very Ruby-oriented so idk how well this meshes with your ruby background
  • the github pages site is intended to rerun and rebuild on each new/changed recipe
  • the individual formula pages are deliberately small to avoid bloating the search index (there's 2000 formulas so 2000 * N bytes is how much it takes to download the index.jsonlike file)
  • i haven't played with customizing which parts of the formula page are/aren't indexed -- this could let you include more content on each formula page without it bloating the search index (because said extra content is filtered out of the index)
  • i tried using https://vitepress.dev/guide/routing#dynamic-routes but those dynamic paths dont get indexed by search 🤷 so you gotta generate them manually before vitepress gets invoked. oh well. Dynamic routes/pages not visible in local search vuejs/vitepress#2939

screenshots:

image
image
image
image
image

docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
docs/generate.js Show resolved Hide resolved
@jcbhmr jcbhmr marked this pull request as ready for review February 8, 2024 15:56
@ronaldtse ronaldtse merged commit 831d2c5 into fontist:v3 Feb 29, 2024
17 checks passed
@ronaldtse
Copy link
Contributor

Remaining tasks moved to #179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants