#NEWLINE# def on_html_document( self , app , request , doc ) : #NEWLINE# #INDENT# if ( not is_succesful ( request . response . status_code ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# canonical = app . config [ 'CANONICAL_URL' ] #NEWLINE# if hasattr ( canonical , '__call__' ) : #NEWLINE# #INDENT# canonical = canonical ( request , doc ) #NEWLINE# #UNINDENT# if canonical : #NEWLINE# #INDENT# if ( not isinstance ( canonical , str ) ) : #NEWLINE# #INDENT# canonical = request . absolute_uri ( ) #NEWLINE# #UNINDENT# doc . head . links . append ( canonical , 'canonical' ) #NEWLINE# #UNINDENT# type = app . config [ 'DEFAULT_OG_TYPE' ] #NEWLINE# if type : #NEWLINE# #INDENT# doc . meta [ 'og:type' ] = type #NEWLINE# if canonical : #NEWLINE# #INDENT# doc . meta [ 'og:url' ] = canonical #NEWLINE# #UNINDENT# doc . meta [ 'og:locale' ] = app . config [ 'LOCALE' ] #NEWLINE# doc . meta [ 'og:site_name' ] = app . config [ 'APP_NAME' ] #NEWLINE# oauths = request_oauths ( request ) #NEWLINE# if oauths : #NEWLINE# #INDENT# for provider in oauths . values ( ) : #NEWLINE# #INDENT# provider . on_html_document ( request , doc ) #NEWLINE# #UNINDENT# doc . before_render ( self . meta_add_tags )