Genital herpes can be caused by either type one or type two of the herpes simplex virus. Because herpes can be extremely dangerous for newborns and can even be deadly (see more in How do I avoid spreading oral herpes to my newborn?) it is very important that you are properly treated if you have an outbreak of genital herpes in pregnancy. What does the management of genital herpes look like when you are expecting a baby, especially if you are close to your due date?
Primary outbreaks of genital herpes during pregnancy are the most dangerous. This means that you have never had an outbreak before. It is possible that you were already infected with the herpes simplex virus (which is very, very common!) and didn't have an outbreak yet, but first outbreaks should always be taken seriously. Primary outbreaks in the first trimester of pregnancy sometimes lead to miscarriage. At term, there won't be enough time to treat the infection and vaginal birth leaves you with a small chance of passing the herpes virus onto your baby. As this can potentially be lethal, you may need a cesarean section.
Secondary outbreaks are less dangerous and you will probably be able to deliver vaginally if this happens to you. If you are not yet in the third trimester, genital herpes should not pose a significant risk unless you go into labor prematurely. Cases of herpes being passed on while the baby is still in utero are so rare that you don't need to worry about that. Treatment consists of antiviral medications similar to those used to treat cold sores. If your partner has genital herpes while you are pregnant, tell him to get treatment immediately and refrain from having sex in the meantime. Also tell him to be diligent about washing his hands.