https://github.com/eliasdabbas/dashseo
Making Plotly's Dash SEO-friendly
https://github.com/eliasdabbas/dashseo
frontend plotly plotly-dash plotly-python seo webdevelopment
Last synced: 2 months ago
JSON representation
Making Plotly's Dash SEO-friendly
- Host: GitHub
- URL: https://github.com/eliasdabbas/dashseo
- Owner: eliasdabbas
- Created: 2024-01-17T07:43:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-18T08:58:06.000Z (over 1 year ago)
- Last Synced: 2025-04-14T18:01:59.910Z (2 months ago)
- Topics: frontend, plotly, plotly-dash, plotly-python, seo, webdevelopment
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dash SEO
A set of tools to make Dash apps SEO-friendly.
### Why?
Dash is renderd as a single page app, as a set of React components. The HTML representation is not available like a traditional page, and app content an be difficult to read by search engines.
The solution is to convert the app's HTML components in the `layout` attribute to an HTML string, and include it in the app's source.
## Features
* Create the full HTML string of the app, to be easily read by crawlers and search engines.
* Does not convert `dcc` components (charts, dropdowns, date pickers, etc.) saving on performance because these components can be heavy without much content, especially charts.
* Title tag, and meta tags are already supported by Dash, and you can set these using default Dash.## Example
`$ pip install dashseo`
```python
from dashseo import htmlify
from dash import Dash, htmlapp = Dash()
app.layout = html.Div([
html.H1("Hello, world!")
])# You only need to add this:
htmlify(app)app.run()
```
## What just happened?The `div` containing "Loading..." get an additional div, which is the full HTML of the app's `layout`. For the above app, it ends up like this:
```html
Loading...
hello, world
```
## Limitations
The current solution works only for simple apps (not using pages).