Is it safe to take osteoporosis medications while pregnant?

No. No bisphosphonates should be stopped. You should eat a calcium rich diet and do daily weight bearing exercises while pregnant.
No. With extremely few and very rare exceptions, there is no reason to take prescription "osteoporosis medication" before menopause, whether you are pregnant or not. If we call mineral calcium and vitamin d osteoporosis medicine, then it is very important to assure a good intake of these when pregnant but all of the prescription classes are unnecessary and quite possibly dangerous to take during pregnancy.