If Statement in Markdown

Is it possible to add an if else statement in Markdown?

I’ve been using the comments plugin. In user/config/site.yaml I added
menu:

url: '/register' 
text: Register

To add a menu item on my homepage. I created a test account and successfully logged in. But after logging in, the “register” menu item still shows up, along with the “welcome” and “logout” menu items that are added after logging in. Is there a way to make an if statement to only show the register menu item if the visitor is not logged in? Alternatively, is there another way to add the register page another than in site.yaml? Thanks.

You should edit the Twig that generates the menu.

Assuming you use Antimatter or a theme that uses a similar structure, that file is https://github.com/getgrav/grav-theme-antimatter/blob/develop/templates/partials/navigation.html.twig.

Lines 40-47 add the item you added to site.yaml. Add a check similar to lines 48-50, but reverted (or just add an {% else %} statement.

Got it working. You’ve been a big help, thank you!