What is the canonical bundle of a smooth divisor? 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?)
 A: This is actually a comment, but too big to say it in comments. That's why I'm writing it as an answer.
Theorem: (R. Hartshorne, Algebraic Geometry, Ch. II, Th. 8.17) Let $X$ be a non-singular variety of a field $k=\bar k.$ Let $Y$ be a closed irreducible subscheme of $X$ with the ideal sheaf $\mathcal I.$ Then $Y$ is non-singular if and only if (1) $\Omega_{Y/k}$ is locally free, and (2) we have the following exact sequence 
$$ 0 \to \mathcal I/\mathcal I^2 \to \Omega_{X/k} \otimes \mathcal O_Y \to \Omega_{Y/k} \to 0.$$
In this case, the sheaf $\mathcal I/\mathcal I^2$ is a locally free sheaf of rank $r= codim(Y,X)$ on $Y.$
Now let $Y$ be a non-singular subvariety of a non-singular variety $X$ over $k=\bar k.$ Then the sheaf $\mathcal N_{Y/X}:= \mathcal Hom_{\mathcal O_Y}(\mathcal I/\mathcal I^2, \mathcal O_Y)$ is called the normal sheaf of $Y$ in $X.$ It is locally free of rank $r= codim(Y,X).$
Theorem: (R. Hartshorne, Algebraic Geometry, Ch. II, Prop. 8.20) Let $Y$ be a non-singular subvariety of codimension $r$ in a non-singular variety $X$ over $k=\bar k.$ Then $\omega_Y \cong \omega_X \otimes \wedge^r \mathcal N_{Y/X}.$ If $r=1,$ consider $Y$ as a divisor, and let $\mathcal L$ be the associated invertible sheaf on $X.$ Then $\omega_Y \cong \omega_X \otimes \mathcal L \otimes \mathcal O_Y.$
