This page documents the structure and fields of afterpython.toml, the configuration file for project metadata that extends beyond what pyproject.toml supports. For information about how this file is synchronized with other configuration files, see Configuration Synchronization System. For the standard Python package metadata, see pyproject.toml Reference.
The afterpython.toml file stores project metadata that is specific to the website and branding aspects of your project but doesn't have a natural place in the standard pyproject.toml format. This includes company information, website URLs, and visual assets like logos and favicons.
Key characteristics:
pyproject.toml)ap sync to propagate values to myst.yml and authors.yml filesSources: afterpython/afterpython.toml1-16 afterpython/doc/concepts.md34-48
The following diagram shows how afterpython.toml fits into the configuration ecosystem:
Diagram: afterpython.toml in Configuration Flow
Sources: afterpython/afterpython.toml1-16 afterpython/doc/concepts.md34-48
The configuration file must be located at:
afterpython/afterpython.toml
This location is within the afterpython/ directory created by ap init, keeping it organized with other AfterPython-specific configuration files.
The file uses standard TOML syntax with three main sections: [company], [website], and content-specific subsections like [website.blog].
Sources: afterpython/afterpython.toml1 afterpython/doc/concepts.md18-24
The [company] section defines information about the organization or entity that maintains the project.
Field Reference:
| Field | Type | Required | Description | Used In |
|---|---|---|---|---|
name | string | Yes | Company or organization name | myst.yml venue.title |
url | string | Yes | Company homepage URL | myst.yml venue.url |
Example:
These values are synchronized to the venue section of all myst.yml files during ap sync:
company.name → venue.title in doc/myst.yml blog/myst.yml etc.company.url → venue.url in all myst.yml filesSources: afterpython/afterpython.toml2-4
The [website] section configures the project website's URLs and visual assets.
Field Reference:
| Field | Type | Required | Description | Default | Notes |
|---|---|---|---|---|---|
url | string | Yes | Project website URL | - | Full URL including protocol |
favicon | string | Yes | Favicon filename | - | Relative to afterpython/static/ |
logo | string | Yes | Logo filename (light theme) | - | Relative to afterpython/static/ |
logo_dark | string | No | Logo filename (dark theme) | Same as logo | Relative to afterpython/static/ |
thumbnail | string | Yes | Default thumbnail image | - | Used as fallback for all content types |
Example:
Asset Path Resolution:
All asset paths (favicon, logo, logo_dark, thumbnail) are relative to the afterpython/static/ directory. During ap build, files from this directory are copied to _website/static/ for use by the SvelteKit website.
Thumbnail Cascade:
The thumbnail field serves as the global default for all content types. It can be overridden at two levels:
[website.blog].thumbnailSources: afterpython/afterpython.toml6-11 afterpython/doc/project_website.md74-76 afterpython/doc/project_website.md88-146
Each non-documentation content type (blog, tutorial, example, guide) can have its own configuration subsection for listing page customization.
Available Content Type Sections:
[website.blog][website.tutorial][website.example][website.guide]Note: The doc content type does not have a listing page, so these settings do not apply to it.
Field Reference:
| Field | Type | Required | Description |
|---|---|---|---|
thumbnail | string | No | Default thumbnail for this content type |
featured_post | string | No | Filename of post to feature in hero section |
Example:
Thumbnail Path Resolution:
Content type thumbnails are resolved relative to the content type's static/ subdirectory:
[website.blog].thumbnail → afterpython/blog/static/[website.tutorial].thumbnail → afterpython/tutorial/static/[website.example].thumbnail → afterpython/example/static/[website.guide].thumbnail → afterpython/guide/static/Featured Post Resolution:
The featured_post field should contain the filename (with extension) of a markdown or notebook file in the content type's root directory:
[website.blog].featured_post = "blog1.md" → afterpython/blog/blog1.md[website.tutorial].featured_post = "intro.ipynb" → afterpython/tutorial/intro.ipynbSources: afterpython/afterpython.toml13-15 afterpython/doc/project_website.md86-146
The following diagram illustrates how thumbnail images are resolved for content listing pages:
Diagram: Thumbnail Resolution Priority
Priority Order:
thumbnail: "custom.png" in markdown/notebook)[website.blog].thumbnail)[website].thumbnail)Sources: afterpython/doc/project_website.md95-118 afterpython/afterpython.toml11
The ap sync command reads afterpython.toml and propagates values to dependent configuration files.
Synchronization Flow:
Specific Mappings:
| afterpython.toml | Target File | Target Field |
|---|---|---|
[company].name | All myst.yml files | venue.title |
[company].url | All myst.yml files | venue.url |
[company].name | authors.yml | venue.title |
[company].url | authors.yml | venue.url |
Automatic Synchronization:
Set the environment variable AP_AUTO_SYNC=1 to automatically run ap sync before build commands. See Environment Variables for details.
Sources: afterpython/afterpython.toml2-4 .env.example1
Here is a complete example of afterpython.toml with all available sections:
Sources: afterpython/afterpython.toml1-16 afterpython/doc/project_website.md130-145
The following table summarizes validation rules for each field:
| Field | Validation Rules |
|---|---|
[company].name | Non-empty string |
[company].url | Valid URL format with protocol (http:// or https://) |
[website].url | Valid URL format with protocol |
[website].favicon | Filename must exist in afterpython/static/ |
[website].logo | Filename must exist in afterpython/static/ |
[website].logo_dark | Filename must exist in afterpython/static/ (if specified) |
[website].thumbnail | Filename must exist in afterpython/static/ |
[website.<type>].thumbnail | Filename must exist in afterpython/<type>/static/ |
[website.<type>].featured_post | Filename must exist in afterpython/<type>/ |
Note: Validation is performed during ap build and ap sync commands. Missing files will result in warnings or errors.
Sources: afterpython/doc/project_website.md102 afterpython/doc/project_website.md125-126
The afterpython.toml configuration works in conjunction with other configuration files:
afterpython.tomlafterpython.tomlAP_AUTO_SYNCSources: afterpython/doc/concepts.md18-48
Refresh this wiki