This is a two-piece ledger, which attaches to the house. We drill the holes right under the rafter notches so the fastners are concealed when the rafters are installed.
If a pergola is more than 20 feet wide, we use a half lap joint for strength and appearance.