Skip to content

[WIP] Use Hoof API for URL metadata #1335

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

[WIP] Use Hoof API for URL metadata #1335

wants to merge 10 commits into from

Conversation

fennifith
Copy link
Member

This won't work until hoof is deployed.

This is part of #1231, and a prerequisite for migrating to Fly.io & enabling SSR.

  • Adds openapi-typescript and openapi-fetch (https://openapi-ts.dev/introduction)
  • Migrates iframe titles, link previews, and epub reference pages to use hoof's URL Metadata endpoint
  • Decreases local build time from 130s->70s (almost half!)

Copy link

vercel bot commented May 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
playfulprogramming ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2025 9:59pm

@fennifith fennifith mentioned this pull request May 24, 2025
fennifith added a commit that referenced this pull request May 24, 2025
Fixes or removes a good handful of broken links found from testing
#1335, as well as some redirects / domain changes.

- `angular.io` moved to `angular.dev`
- Tried to find the closest match to any angular docs/guides that had
been moved
- `gatsbyjs.org` moved to `gatsbyjs.com`
- One link to `intro-to-web-accessability` (misspelt) in
art-of-a11y-preface
- A download link to some presentation slides (broken since the content
refactor) in angular-templates-start-to-source
- A number of deleted blog posts on external sites
fennifith added a commit that referenced this pull request Jun 20, 2025
Fixes #1233, but differently™

This PR changes the unified processor to return a "component tree"
rather than a plain HTML string. This tree contains portions of raw HTML
as well as props that would normally be passed to interactive components
(tabs, file lists, code embeds, link previews, etc).

The component tree is then passed to an Astro component, which is used
recursively to render the raw HTML and components.

This results in any imports (styles & scripts) being conditional on the
component appearing in the post. It also means that scoped CSS and
client hydration are supported.

In the future, this component tree could be cached with the post
content, and any SSR-dependent behavior could happen in the Astro
components.

## Changes to note:

- Components can now _only_ be nested at the root level of other
components, or within specific elements that are transformed into
components (`<details>`)

This means that iframes can no longer be placed within a list, as was
done in `example/index.md`. When this happens, the transformer will log
& throw an error.

- EPub generation is moved from a separate build script to a
`pages/[slug].epub.ts` Astro route
(this means it isn't parallelized, but takes advantage of caching & will
massively improve the build time with #1335)

- Conditional `tabs-small` behavior (keeping tabs at a fixed height) is
removed

### TODO:

- [x] Migrate tabs to preact
- [x] Migrate in-content-ad to preact
- [x] Migrate link-preview to preact
- [x] Migrate filetree to preact
- [x] Migrate IFramePlaceholder to preact
- [x] Migrate hints to preact
- [x] Validate epub changes
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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy