Giter Site home page Giter Site logo

dashseo's Introduction

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

from dashseo import htmlify
from dash import Dash, html

app = 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:

<div id="react-entry-point">
    <div class="_dash-loading">
        Loading...
    </div>
    <div>
        <h1>hello, world</h1>
    </div>
</div>

Limitations

The current solution works only for simple apps (not using pages).

dashseo's People

Contributors

eliasdabbas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.