How to add user data to the post serializer?

I think I have this working, at least to a passable degree. I was unable to figure out how to add the website field to the post serializer, and it seems that I can’t add a field called user_custom_fields (perhaps that is reserved). I was able to add a user_extra_fields field that contains all of the user.custom_fields. Then in my theme components I can access those fields as needed (although it’s a bit odd to have to use a field called user_field_1).

The following did what I needed:

after_initialize do
  add_to_serializer(:post, :user_extra_fields, false) {
    return object.user.custom_fields
  }
end