Page Resources might help you with this. See this example (ensure you are using the exended version of Hugo).