Flask¶
The Flask adapter registers a context processor and exposes a for_entity
helper.
Install¶
Usage¶
from flask import Flask
from easeo import SEOConfig
from easeo.adapters.flask import Easeo
app = Flask(__name__)
easeo = Easeo(
app,
SEOConfig(
canonical_host="example.com",
public_base_url="https://example.com",
)
)
Templates¶
The adapter registers a seo_head(entity, route) helper:
The return value is Markup, so the | safe filter is optional.
Direct use¶
Deferred init¶
For application factories, construct without an app and initialize later:
init_app without a config raises ValueError.
Notes¶
for_entityreturns a dict; the template helper returns HTML.- Entities need
entity_type,title, anddescription; missingentity_typedefaults topage.