> 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="/files/3NN7UUVXpQIsaqtlXNwW" alt=""><figcaption></figcaption></figure>
3. Click **Change to private**.

   <figure><img src="/files/9yrnwmfK3XnN1FusUxPM" 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="/files/oaAyURPea5jENna19w8O" 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="/files/3gBeQnWvhhfNg8QCOQgY" 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="/files/eZUTxjAZ6SlZWJbk4zck" 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/). I have also put a lot of effort into properly commenting and describing the existing template files in the [comic\_git\_engine](https://github.com/comic-git/comic_git_engine/tree/master/templates) `/templates/` directory to help anyone who wants look through them to figure out how comic\_git works.

### List of Values Available to Jinja2 Templates

Assuming you want to create your own Jinja2 templates (see [Customizing Your Website](/documentation/advanced-editing/themes.md#jinja-template-format) for guidance on how to do that), it will be helpful for you to know what data the comic\_git Python script makes available to the template whenever it builds a web page. The following is a list of all variables passed to the templates as they're being built, as well as a short description of each variable. The descriptions below assume you have basic knowledge of HTML, Jinja2, and Python data structures.

<table><thead><tr><th valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>template_name</code></td><td valign="top">The name of the template being loaded. E.g., <code>comic</code></td></tr><tr><td valign="top"><code>_title</code></td><td valign="top">The title of the page, as defined in the [Pages] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>autogenerate_warning</code></td><td valign="top">A bit of text added to the top of every file when it's created to warn comic creators against trying to edit the HTML files directly. Not very useful for any other purpose.</td></tr><tr><td valign="top"><code>version</code></td><td valign="top">The comic_git version, e.g. 0.2.1</td></tr><tr><td valign="top"><code>comic_title</code></td><td valign="top">The comic name, as defined in the [Comic Info] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>comic_author</code></td><td valign="top">The comic author name, as defined in the [Comic Info] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>comic_description</code></td><td valign="top">The comic description, as defined in the [Comic Info] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>banner_image</code></td><td valign="top">The web path of the banner image at the top of your website, as defined in the [Comic Settings] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>theme</code></td><td valign="top">The name of the current theme that's in use.</td></tr><tr><td valign="top"><code>comic_url</code></td><td valign="top">The URL of the homepage of your website, e.g. <code>https://ryanvilbrandt.github.io/comic_git/</code>. See <a href="/pages/lCcOMIAOgMGO6cjvyIEu">Changing Your Website URL</a> for information about changing this value, or you can host your webcomic from a custom domain.</td></tr><tr><td valign="top"><code>base_dir</code></td><td valign="top">The base directory for your comic, aka your repository name while you're hosting from a GitHub Pages URL. It is important that all URLs that reference the root directory of your website use this variable, or have the correct root directory hardcoded in the template file.</td></tr><tr><td valign="top"><code>comic_base_dir</code></td><td valign="top">The web path for the current comic being built. For the main comic, this will always be the same as <code>{{base_dir}}</code>, but for extra comics, the extra comic name will be added.<br>e.g. <code>/{{base_dir}}/extra_comic</code></td></tr><tr><td valign="top"><code>content_base_dir</code></td><td valign="top">The web path where the your_content files are stored for the current comic being built. For the main comic, this will always be <code>/{(base_dir)}/your_content</code>, but for extra comics, the extra comic name will be added.<br>e.g. <code>/base_dir/your_content/extra_comic</code></td></tr><tr><td valign="top"><code>links</code></td><td valign="top">The list of links that make up the Links Bar on your website, partially defined by the [Links Bar] section of the comic_info.ini file. This is a list of dictionaries, each with the format <code>{"name": "&#x3C;link name>", "url": "&#x3C;link url>"}</code></td></tr><tr><td valign="top"><code>use_thumbnails</code></td><td valign="top">The boolean value of the Use thumbnails option, as defined in the [Archive] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>storylines</code></td><td valign="top">A dictionary of all the comics in the archive, grouped by their Storyline value as defined in their <code>info.ini</code> files. Any comics without a Storyline value are put into the "Uncategorized" storyline. The dictionary has the format <code>{"&#x3C;storyline>": [&#x3C;comic_dict>, &#x3C;comic_dict>, &#x3C;comic_dict>, ...]}</code>, and each comic is a dictionary of all the values comic_git needs to build a comic page, and then some. See the next table for a description of that.</td></tr><tr><td valign="top"><code>home_page_text</code></td><td valign="top">The text contained in the <code>/your_content/home_page.txt</code> file. It is used by the default <code>index.tpl</code> file provided with comic_git.</td></tr><tr><td valign="top"><code>google_analytics_id</code></td><td valign="top">Your Google Analytics Tracking ID, as defined in the [Google Analytics] section of the <code>comic_info.ini</code> file. If it's not defined, this value will be an empty string.</td></tr><tr><td valign="top"><code>scheduled_post_count</code></td><td valign="top">The number of comic pages you have uploaded that have Post Dates set in the future, so web pages for those comics have not been built yet. Useful for teasing your audience with extra pages. This number will always be 0 if you have the <code>publish_all_comics</code> command line argument set to <code>True</code>.</td></tr><tr><td valign="top"><code>extra_comics</code></td><td valign="top">A dictionary of all the extra comics defined for your site. The keys are the extra comic names, and the values are lists of the comic_data_dicts for that particular extra comic.</td></tr><tr><td valign="top"><code>use_images_in_navigation_bar</code></td><td valign="top">The boolean value of the "Use images" option, as defined in the [Navigation] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>navigation_bar_above_comic</code></td><td valign="top">The boolean value of the "Above comic" option, as defined in the [Navigation] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>navigation_bar_below_comic</code></td><td valign="top">The boolean value of the "Below comic" option, as defined in the [Navigation] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>navigation_bar_below_blurb</code></td><td valign="top">The boolean value of the "Below blurb" option, as defined in the [Navigation] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>enable_webring</code></td><td valign="top">True if the <a href="/pages/d2ldlFZhpV4DOyYRDIiT">Webring</a> feature is enabled. False otherwise. See below for more variables related to the Webring feature.</td></tr><tr><td valign="top"><code>social_media</code></td><td valign="top">A dictionary of OGP attributes and what values should be applied to each attribute. See the documentation on <a href="/pages/owe5DaE65gXgJlyms6WL">Social Media Previews</a> for more details.</td></tr></tbody></table>

If the [Webring](/documentation/expert-editing/webring.md) feature is enabled, the following variables may also be made available, depending on your chosen config options. See the feature description for more information about webrings and what these variables do.

| Variable           | Description                                                                                                                                                                    |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `webring_label`    | The `label` of the webring, as returned by the endpoint.                                                                                                                       |
| `webring_home`     | If a `home` is defined, this will be a [dictionary](https://comic-git.gitbook.io/documentation/expert-editing/webring#comic-dictionary) of values as provided by the endpoint. |
| `show_all_members` | Matches the value of the "Show all members" config option. Default False.                                                                                                      |
| `webring_members`  | A list of [dictionaries](https://comic-git.gitbook.io/documentation/expert-editing/webring#comic-dictionary), one for each member of the webring, as returned by the endpoint. |
| `webring_prev`     | A [dictionary](https://comic-git.gitbook.io/documentation/expert-editing/webring#comic-dictionary) of values for the "previous" webring link, as returned by the endpoint.     |
| `webring_next`     | A [dictionary](https://comic-git.gitbook.io/documentation/expert-editing/webring#comic-dictionary) of values for the "next" webring link, as returned by the endpoint.         |

In addition to the above information, the information for the most recent comic page is also passed to every template as it's built. The values below are specific to that comic page, and can be used for things like creating a landing page that shows the first comic image or even just the title and post date. This is also the same data provided in each `comic_dict` object in the `storylines` variable, described above.

<table><thead><tr><th valign="top">Variable</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>page_name</code></td><td valign="top">The unique identifier for the given comic page. This matches the name of the folder the comic is in, and the value in the URL for that comic page, e.g. <code>001</code> in <code>https://ryanvilbrandt.github.io/comic_git/comic/001/</code></td></tr><tr><td valign="top"><code>comic_paths</code></td><td valign="top">A list of the image filepaths for each comic. Each path is in the format <code>your_content/comics/&#x3C;page_name>/</code>.</td></tr><tr><td valign="top"><code>thumbnail_path</code></td><td valign="top">The path to find the thumbnail of the comic page, if it exists.</td></tr><tr><td valign="top"><code>escaped_alt_text</code></td><td valign="top">The alt text of the comic, as defined in the comic's <code>info.ini</code> file, with all nonstandard characters replaced with <a href="https://htmlandcssbook.com/extras/html-escape-codes/">HTML escape codes.</a></td></tr><tr><td valign="top"><code>first_id</code></td><td valign="top">The <code>page_name</code> of the first comic on your site, sorted chronologically.</td></tr><tr><td valign="top"><code>previous_id</code></td><td valign="top">The <code>page_name</code> of the previous comic.</td></tr><tr><td valign="top"><code>current_id</code></td><td valign="top">The <code>page_name</code> of the current comic.</td></tr><tr><td valign="top"><code>next_id</code></td><td valign="top">The <code>page_name</code> of the next comic.</td></tr><tr><td valign="top"><code>last_id</code></td><td valign="top">The <code>page_name</code> of the latest comic.</td></tr><tr><td valign="top"><code>page_title</code></td><td valign="top">The title of the comic, as defined in the comic's <code>info.ini</code> file.</td></tr><tr><td valign="top"><code>_post_date</code></td><td valign="top">The post date of the comic, as defined in the comic's <code>info.ini</code> file.</td></tr><tr><td valign="top"><code>archive_post_date</code></td><td valign="top">The post date of the comic, but formatted to match the date format in the [Archive] section of the <code>comic_info.ini</code> file.</td></tr><tr><td valign="top"><code>_storyline</code></td><td valign="top">The storyline of the comic, as defined in the comic's <code>info.ini</code> file. If storyline is not defined, this will be <code>None</code>.</td></tr><tr><td valign="top"><code>_characters</code></td><td valign="top">A list of the comic's Characters tags, as defined in the comic's <code>info.ini</code> file.</td></tr><tr><td valign="top"><code>_tags</code></td><td valign="top">A list of the comic's Tags, as defined in the comic's <code>info.ini</code> file.</td></tr><tr><td valign="top"><code>post_html</code></td><td valign="top">The contents of the <code>post.txt</code> file for the current comic, after being run through a Markdown parser to make it pure HTML.</td></tr><tr><td valign="top"><code>transcripts</code></td><td valign="top">A dictionary of the transcripts for this comic, of the format <code>{{"&#x3C;language>": "&#x3C;transcript text>"}}</code>.</td></tr><tr><td valign="top"><code>_on_comic_click</code></td><td valign="top">The value provided by the <code>On comic click</code> setting in your <code>Comic settings</code> section of your comic_info.ini file.</td></tr></tbody></table>

Any additional values found in the info.ini file for a particular comic will also be included in the Jinja variables. The names of these values will have all punctuation and spaces replaces with underscores, and an underscore will be prepended to the name of the value. E.g., `Inker's Home Address` will become `_inker_s_home_address`

If you want to add your own custom variables to the list of global variables, you can! See `extra_global_values` in [Code Hooks](/documentation/expert-editing/code-hooks.md) for instructions.

## 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="/files/fqYH3aEXumFCekGKA6Q4" alt=""><figcaption></figcaption></figure>

Then click on Collaborators in the sidebar

<figure><img src="/files/gCs5OCrRI6OJsFeCH8vu" 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="/files/KGPDX1d5AE6tL2uICtiC" 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="/files/ZLHvUdAOFDZOEPm9dHOk" 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="/files/aVTTxDG0CAZymIKgY6SV" 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="/files/8HCnJsEMXZLetKI4L0s8" 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="/files/g5EuSzvNr2bf21qsR7J1" 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="/files/0mFkZVoYvNsLuhjYBHqo" 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="/files/bVm3W1oGwm4pJc6dKLJa" 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="/files/osLDT1KSmiQSj9JLU3pn" 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="/files/9IUJXjL93ibrqFGiJZlb" 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="/files/d7iXIETu9otn3QxiMi4K" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://comic-git.gitbook.io/documentation/expert-editing/other-expert-tips.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
