Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ability to add more meta tags e.g. for seo #312

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

Open
shroominic wants to merge 2 commits into pydantic:main
base: main
Choose a base branch
Loading
from shroominic:meta-extra

Conversation

@shroominic
Copy link

@shroominic shroominic commented May 12, 2024
edited
Loading

example usage:

@app.get("/{path:path}", include_in_schema=False)
async def html_landing() -> HTMLResponse:
 return HTMLResponse(
 prebuilt_html(
 title=settings.title,
 api_root_url=settings.ui_root,
 meta_extra={
 "description": "A seo optimized description",
 "keywords": "seo, optimized, keywords",
 "author": "seo pro",
 },
 )
 )

*edit: now passed as dict

Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Contributor

jimkring commented May 15, 2024
edited
Loading

@shroominic would it make sense to pass in the meta_extra parameters to fastui as a dictionary or pydantic model, rather than raw html?

Copy link
Contributor

@shroominic would it make sense to pass in the meta_extra parameters to fastui as a dictionary or pydantic model, rather than raw html?

I totally agree, this (micro-syntax) doesn't look good.

jimkring reacted with thumbs up emoji

Copy link
Author

@shroominic would it make sense to pass in the meta_extra parameters to fastui as a dictionary or pydantic model, rather than raw html?

good idea i fixed this now!

jimkring reacted with rocket emoji

Copy link
Contributor

In principle, I'm ok with this change, but perhaps we should just add extra arguments to the prebuilt_html function so that we can add type hints for the extra metadata? At least for common meta things like description. Then perhaps we could also have one final argument with extra data for the meta_str...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /