# Archive (All posts) Template

**Principle** has a template for the **Archive (All posts) Page**, which shows all of the posts of your publication. An archive page is not required, but you can add it if you want.

<figure><img src="https://3747166499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNEUq8JgkqyvfvcerS2FD%2Fuploads%2F9r89qyq46qxkdeotMGVe%2Farchive.JPG?alt=media&#x26;token=9dd7e683-7f1f-4706-ac9f-bebc2c10f2d3" alt=""><figcaption></figcaption></figure>

### <mark style="background-color:orange;">**If you've previously modified**</mark> <mark style="background-color:orange;"></mark><mark style="background-color:orange;">your</mark> <mark style="background-color:orange;"></mark><mark style="background-color:orange;">`routes.yaml`</mark> <a href="#if-youve-previously-modified-your-routes.yaml" id="if-youve-previously-modified-your-routes.yaml"></a>

**If you've previously modified** your `routes.yaml` file for any reason, you only need to incorporate the following lines to add an **Archive Page** to your publication. This ensures you keep your custom configurations while enabling the archive functionality.

**Here's a quick guide:**

1. Access your Ghost admin area, then navigate to **Settings** > **Labs**.
2. Under the **Labs** section, find and click on the <mark style="color:green;">**Download current routes**</mark> button to upload your current `routes.yaml` file.
3. Open your `routes.yaml` file in a text editor.
4. Add the following lines to your `routes.yaml` file:

   ```
   routes:
     /:
       controller: channel
       filter: tag:-case-study+tag:-hash-author-content
       template: index
     /account/:
       template: page-account
     /archive/:
       controller: channel
       template: archive
       data: page.archive
       filter: tag:-hash-author-content
     /author/:slug/:
       controller: channel
       template: author
       data: page.slug
       filter: tag:-hash-author-content
     /case-studies/:
       controller: channel
       data: page.custom-case-studies-page
       template: custom-case-studies-page
       filter: tag:case-study

   collections:
     /:
       permalink: /{slug}/
       template: index
       filter: tag:-hash-author-content
   taxonomies:
     tag: /tag/{slug}/
     author: /author/{slug}/
   ```
5. Save your changes and re-upload the `routes.yaml` file through the same **Labs** section by clicking **Upload routes file** button.
6. After completing these steps, you need to [**add an Archive Page**](#adding-an-archive-page)**.**

### <mark style="background-color:orange;">**If you have not previously modified**</mark> <mark style="background-color:orange;"></mark><mark style="background-color:orange;">your</mark> <mark style="background-color:orange;"></mark><mark style="background-color:orange;">`routes.yaml`</mark>

**This guide is intended for users who have not previously modified** their `routes.yaml` file. If you have already made changes to your `routes.yaml` file, please check [**this guide**](#if-youve-previously-modified-your-routes.yaml).

#### **Here's a quick guide:**

* Access your Ghost admin area, then navigate to **Settings** > **Labs**.
* Under the **Labs** section, find and click on the <mark style="color:green;">**Download current routes**</mark> button for the `routes.yaml` file to make a backup.
* Download this `routes.yaml` :&#x20;

{% file src="<https://3747166499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNEUq8JgkqyvfvcerS2FD%2Fuploads%2FNmvsGxWQcf1zKvxW8mm4%2Fprinciple-routes.yaml?alt=media&token=8c04c8dc-d0f2-4567-8eeb-7d8ec47ac762>" %}

{% hint style="info" %}
In case if you can't download our file, here is how your `routes.yaml` should look like:

```
routes:
  /:
    controller: channel
    filter: tag:-case-study+tag:-hash-author-content
    template: index
  /account/:
    template: page-account
  /archive/:
    controller: channel
    template: archive
    data: page.archive
    filter: tag:-hash-author-content
  /author/:slug/:
    controller: channel
    template: author
    data: page.slug
    filter: tag:-hash-author-content
  /case-studies/:
    controller: channel
    data: page.custom-case-studies-page
    template: custom-case-studies-page
    filter: tag:case-study

collections:
  /:
    permalink: /{slug}/
    template: index
    filter: tag:-hash-author-content
taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/
```

{% endhint %}

* Upload new `routes.yaml` file through the same **Labs** section by clicking **Upload routes file** button.&#x20;
* After completing these steps, you need to [**add an Archive Page**](#adding-an-archive-page)**.**

### Adding an Archive Page:

1. In your Ghost admin area, go to **Pages** and click on the **New Page** button in the top right corner.
2. Title your page. You can choose any title you like for the **Archive Page**.
3. Click <img src="https://3747166499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNEUq8JgkqyvfvcerS2FD%2Fuploads%2FjafE8K5kJ5uVqReN9ZPN%2F01.png?alt=media&#x26;token=bd4285b8-9261-4cdc-ad1b-e631c1df89b5" alt="" data-size="line"> icon in the top right corner to open the **Page settings**
4. In the **Page** **URL** section, ensure the slug is set to `archive`. This links the page to the route you've set up in your `routes.yaml` file.
5. **Optionally**, you can add an excerpt and feature an image to make the page more engaging.
6. Once you're done, click on **Publish** to make your **Archive Page** live.

This page will now follow the Archive template and functionality as defined in your routes.yaml file.
