I am currently trying to learn some complex geometry, using mainly the book by Huybrechts. There is one thing confusing me, however: For example on Wikipedia people are talking about the canonical bundle of a smooth divisor (in the linked article called $\omega_D$) and I am not sure what that is.
I do understand how to define the canonical bundle of a complex manifold. Therefore, I also understand how to define the canonical bundle of, say, a smooth hypersurface. I also know that every hypersurface Y defines a divisor $D = \sum_i [Y_i]$, where $Y_i$ are the irreducible components.
Given a smooth divisor $D = \sum_i a_i [Y_i]$ one could assign the hypersurface $Y = \bigcup_i Y_i$ to it and define $\omega_D = \omega_Y$. But (like Huybrechts also writes in his book) this construction is clearly not very natural.
It just doesn't seem to be right to me. How is the bundle $\omega_D$ defined then? (What is, e.g., the base space of this bundle?)