  We give an algebro-geometric construction of the Hitchin connection, valid
also in positive characteristic (with a few exceptions). A key ingredient is a
substitute for the Narasimhan-Atiyah-Bott K\"ahler form that realizes the Chern
class of the determinant-of-cohomology line bundle on the moduli space of
bundles on a curve. As replacement we use an explicit realisation of the Atiyah
class of this line bundle, based on the theory of the trace complex due to
Beilinson-Schechtman and Bloch-Esnault.
