> For the complete documentation index, see [llms.txt](https://comic-git.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://comic-git.gitbook.io/documentation/expert-editing/other-expert-tips.md).

# Other Expert Tips

## Switching from a Public to a Private Repo

The main reason someone would want to make their comic\_git repository private would be to be able to schedule posts while still publishing their website to GitHub Pages. If you wish to do so, you'll need to first upgrade your account to a [GitHub Pro](https://github.com/account/upgrade) account for $4 per month.

Once you have GitHub Pro:

1. Go to your repo's **Settings** page.
2. Scroll all the way to the bottom to the section marked **Danger Zone**, and click the **Change Visibility** button.

   <figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2Fc4urJDacyO7pjzkK0Dul%2Fprivate01_change_visibility.png?alt=media&amp;token=0f330a00-023a-40ea-8c5c-ca42f9b53be8" alt=""><figcaption></figcaption></figure>
3. Click **Change to private**.

   <figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2F1rvYUlYcPEl816seuayF%2Fprivate02_set_private.png?alt=media&amp;token=07fcc201-e981-4f1c-ae31-558b608a7056" alt=""><figcaption></figcaption></figure>
4. A pop-up appears asking you to confirm that you want to make the repo private. Click **I want to make this repository private**.

   <figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FlS0c706I2X9ktFrkZ71r%2Fprivate03_warn01.png?alt=media&amp;token=0843e667-96e7-4a12-b647-4c44e9551fe3" alt=""><figcaption></figcaption></figure>
5. A second pop-up appears advising you of the effects of making the repo private. Click **I have read and understand these effects**.

   <figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FrfRgYAwzwPbNMqMGX7o5%2Fprivate04_warn02.png?alt=media&amp;token=404f37fa-92ce-46be-953e-e9127be209a2" alt=""><figcaption></figcaption></figure>
6. The first pop-up appears again. This time, **I want to make this repository private** highlights as red. Click a final time to complete the process.

   <figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FGpH0BQ7w07l7vrKREeTl%2Fprivate05_warn03.png?alt=media&amp;token=74a2513a-a7f0-46c5-9921-18ef27939f80" alt=""><figcaption></figcaption></figure>

You may need to re-enable GitHub Pages after making this change. Follow the [Publishing to GitHub Pages](/documentation/getting-started/publishing-to-github-pages.md) instructions to do so.

## Changing Archive Headers to Banner Images

One option creators frequently request is providing header images for their archive pages rather than the default text-only headers that come with comic\_git.

This is fortunately very easy to do! You can use CSS to replace the `<h2>` tags that represent the headers with images! For example, if you create a `Ch3.png` file in the `/your_content/images/` directory, you can replace your "Chapter 3" header with the following CSS in `stylesheet.css`:

```
#archive-section-Chapter-3 {
    display: inline-block;
    color: transparent;
    background: url("../../your_content/images/Ch3.png") no-repeat;
    background-size: contain;
    width: 100px;
    height: 100px;
}
```

You can do the same thing for the chapter link on the infinite scroll page using `#infinite-scroll-Chapter-3` instead.

For both archive sections and infinite scroll links, be sure to set `width` and `height` to match the dimensions of the image you've provided.

## Scheduled Posts

If you set the Post Date for a comic page for a future date or time (according to the Timezone you have set in your `comic_info.ini` file), comic\_git will not create that page when you push your changes to GitHub. However, the comic data (image file, `info.ini` file, etc.) are not gone, and when comic\_git runs for the first time on the date provided, the comic will be published then.

By default, comic\_git reruns every morning at 8:00 AM UTC to publish any comic posts that may have been scheduled previously. That is either 12:00 am midnight or 1:00 am Pacific Time, depending on Daylight Savings Time. If you wish to change this update schedule, you can do so by updating the following line in your `.github/workflows/main.yaml` file:

```
    - cron: '0 8 * * *'  # Runs at 8:00 AM UTC every day
```

The text `0 8 * * *` is what's called a "cron string" and it is a common way to tell computers when to perform automated tasks. This is a very powerful expression, but can be a little opaque. Fortunately, <https://crontab.guru/> is an excellent resource for generating the correct cron string to represent whatever update schedule you want.

Note that the cron string is processed by GitHub assuming it's in UTC time. This means the update time changes with respect to most American timezones whenever Daylight Savings Time begins or ends. Unfortunately, there's no way to change this, so it's recommended that you either pick an update time in the middle of the night where your readers won't notice if the comic uploads one hour earlier for half of the year, or change the cron string whenever Daylight Savings Time changes.

{% hint style="info" %}
**Hiding Your Scheduled Posts**

Despite the scheduled post protection above, any scheduled posts you want to hide from the public are still available to anyone who visits your GitHub page, if they know where to look. If you wish to make your scheduled posts completely hidden from the general public, you will need to [set your repository to Private](#switching-from-a-public-to-a-private-repo).
{% endhint %}

## The Power of Jinja2

One of the main components of the architecture of comic\_git that allows it to work as well as it does are [Jinja2 Templates](https://jinja.palletsprojects.com/en/2.11.x/templates/). Put very simply, Jinja2 templates are HTML files with extra syntax in them that act as placeholders for data that can be passed to the templates later to create a fully-fledged webpage. For example, there is a single template file that is used to create every comic page that's generated by comic\_git. The following is an excerpt from the part where the page title and post date parts of the web page are created:

```
    <div id="blurb">
        <h1 id="page-title">{{ page_title }}</h1>
        <h3 id="post-date">Posted on: {{ post_date }}</h3>
```

When the Python script that builds all the web pages runs, it passes a variable called `page_title` to the template, which gets added where `{{ page_title }}` is in that template. Same with `post_date`.

There are many other features of Jinja2 templates that make them an incredibly powerful tool for automatically building a website that I won't go into here, but if you're interested in learning about them, I highly recommend reading through the [Jinja2 documentation](https://jinja.palletsprojects.com/en/stable/templates/). The current files in comic\_git\_engine's [`templates` directory](https://github.com/comic-git/comic_git_engine/tree/latest/templates) are also commented examples of how comic\_git uses Jinja.

### Template and hook data

comic\_git provides structured page, image, and archive-entry objects to Jinja templates and Code Hooks. See [Template and Hook Data](/documentation/expert-editing/template-and-hook-data.md) for the current interface.

If you want to add custom global template values, use `extra_global_values` as described in [Code Hooks](/documentation/expert-editing/code-hooks.md).

## Adding Collaborators to your Repository

When you create your own comic\_git site for the first time, you will be the only one who can edit it at first. And if you make a private repository, you'll be the only one who will even be able to see it. If you want someone else to help you with your site, or even just to look at your GitHub Actions to help figure out why your build might have broken, you will likely need to add them as a "collaborator".

To do this, go to your Settings tab in your repository

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FLCCwypjkAEO8qDjarvSY%2Fimage.png?alt=media&amp;token=e0b8e809-9173-4ac7-a3da-d96b76abe203" alt=""><figcaption></figcaption></figure>

Then click on Collaborators in the sidebar

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2Fd6dTSSoeAM8THsk8mrD0%2Fimage.png?alt=media&amp;token=4b05e2e5-3e41-4ec0-a5cd-1a87955d0f70" alt=""><figcaption></figcaption></figure>

GitHub may ask you to sign back in. After that's done, you'll be taken to the Collaborators page. To add a collaborator, click the Add People button.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FL8hUL2adkFJ5BWfYVPPM%2Fimage.png?alt=media&amp;token=e844c1d1-4fd9-4358-b604-997f79fa4706" alt=""><figcaption></figcaption></figure>

A dialog will pop up that will let you search for a user by username, full name, or email.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FjCYVZNF38YC1DTJRGAXg%2Fimage.png?alt=media&amp;token=f4755224-0a81-4996-8c5b-0e30a9936d3e" alt=""><figcaption></figcaption></figure>

Use any of those to find the person you want to add, and they'll show up in the list of possible users.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2F96BfgvhJAS22KQ9K8MlI%2Fimage.png?alt=media&amp;token=9f7f4929-2431-4fd8-b14b-7793269032e9" alt=""><figcaption></figcaption></figure>

Click the name of the person you want to invite as a collaborator, then click the green "Add \<name>" button.

**WARNING:** The list of people that show up in this dropdown are pulled from the list of **ALL** GitHub users. Adding someone as collaborator gives them the ability to make changes to your website! **Make sure** the person you select is who you actually think they are!

If you accidentally add the wrong person as a collaborator, don't worry, it's easy to remove them later.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FkFj6kvjszJdo9uw8hSH3%2Fimage.png?alt=media&amp;token=e4900927-d963-44db-a0c6-98b9824f0126" alt=""><figcaption></figcaption></figure>

After clicking the "Add" button, the person you selected will show up in the list of collaborators with "Pending invite" next to their name.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FfmbwMNQfKfciewi0BdkX%2Fimage.png?alt=media&amp;token=7b209480-7168-4fb7-a0e4-e1fedde0839e" alt=""><figcaption></figcaption></figure>

This means GitHub has sent them an email inviting them to be a collaborator on your repo. The email will look like below:

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FRcU8LCqB3aaSiE7mCLEp%2Fimage.png?alt=media&amp;token=03945570-6969-40b9-9582-a18b80635fed" alt="" width="317"><figcaption></figcaption></figure>

That user will now need to click the "View Invitation" button, which will take them to the GitHub website, which will prompt them Accept or Decline the invitation.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FsOvBLcVczlteZcn5rRMH%2Fimage.png?alt=media&amp;token=8280d401-70db-4f97-ac29-599d40c90caa" alt="" width="344"><figcaption></figcaption></figure>

Once they click "Accept Invitation", they'll show up as a collaborator in your Collaborators list.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2F3Ipf9l8VCd8UEB8A9iF5%2Fimage.png?alt=media&amp;token=1ff09532-5b87-4c1f-8d36-497ef8ae999f" alt=""><figcaption></figcaption></figure>

Collaborators have full access to change and modify any code in your repository! And they'll be able to view your repository if it's set to Private. However, collaborators can **not** view or change any Settings on your repository, so you're not at risk of them deleting your repo or locking you out.

### Removing Collaborators

To remove a collaborator, simply go to the list of collaborators on your repository and click the red trashcan beside the collaborator's name.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2F4TQ4UqhMTWqjsG4D6xHn%2Fimage.png?alt=media&amp;token=ce6cbbef-e3b5-4a58-8d95-c9a3901299b1" alt=""><figcaption></figcaption></figure>

GitHub will pop up a dialog asking you to confirm you want to remove this collaborator. Click the "Remove" button, and the collaborator will be removed.

<figure><img src="https://2237275703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmiTVVg3fJxJoQNT4AA65%2Fuploads%2FdkyHGUOC1fGCGzzayOny%2Fimage.png?alt=media&amp;token=d287b8b2-97fe-4d0a-b12a-c83a5c5f234a" alt=""><figcaption></figcaption></figure>
