takahe/core/context.py

18 lines
522 B
Python
Raw Normal View History

from core.models import Config
2022-11-05 13:17:27 -07:00
def config_context(request):
return {
2022-11-17 18:16:34 -08:00
"config": Config.system,
"config_identity": (
2022-11-25 18:33:46 -08:00
request.identity.config_identity if request.identity else None
),
"top_section": request.path.strip("/").split("/")[0],
"opengraph_defaults": {
"og:site_name": Config.system.site_name,
"og:type": "website",
"og:title": Config.system.site_name,
"og:url": request.build_absolute_uri(),
},
}