Print list of pages with title and URL (CLOSED)

I’m pretty sure there is no way to do this, but thought I’d ask.

I’d like to print (or PDF) a list of all my pages (not posts) with title and URL for each. Is that possible?

1 Like

Hello Bruce,

it is not possible natively from Ghost, but parsing sitemap.xml or using content API is option to get list of all pages and put them together in requested format.

2 Likes

Hadn’t thought of using the sitemap. Was able to get what I needed. Thanks!

You need to create a separate page in your theme file and list pages with title. After that you can usr ctrl + p or cmd + p to get print page.

Example code.

{{#get "pages" limit="all"}}
  <ul>
    {{#foreach pages}}
      <li>
        <p>{{title}}</p>
        <a href="{{url}}"><p>{{url}}</p></a>

      </li>
    {{/foreach}}
  </ul>
{{/get}}

1 Like