How do I get the url of single pages? I've been struggling all evening with getting the urls of my singles in a menu generator. At first I thought I nailed it, but it turned out it used the title of the singles instead of the url. When I tried to get the url I an error, so clearly I'm doing something wrong.

This is the code to generate the menu:

{# generating menu #}
&lt;nav class="nav"&gt;
    &lt;ul class="hidden"&gt;
        {# Get all Sections #}
        {% set sections = craft.sections.getAllSections() %}

        {# Loop through all single sections #}
        {% for singleSection in sections if singleSection.type == 'single' %}

            {# Output #}
            &lt;li class=""&gt;
                &lt;a href="{{ singleSection.url }}"&gt;
                    &lt;div class="link"&gt;{{ singleSection }}&lt;/div&gt;
                &lt;/a&gt;
            &lt;/li&gt;

        {% endfor %}
    &lt;/ul&gt;
&lt;/nav&gt;


It is the singleSection.url that causes the error. 

Craft\SectionModel and its behaviors do not have a method or closure named “url”.

I presume the SectionModel does not have an Url, but that doesn't bring me any close to solving my problem of getting the url of single pages.
Craft creates an EntryModel for each Single Section, that allows you to access the URL property you are after. You can get the (one) EntryModel using the Section's ID and the first() method:

{% set singleSectionEntry = craft.entries.sectionId(singleSection.id).first() %}

&lt;a href="{{ singleSectionEntry.url }}"&gt;
    &lt;div class="link"&gt;{{ singleSectionEntry.title }}&lt;/div&gt;
&lt;/a&gt;