You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: afterpython/doc/project_website.md
+71-2Lines changed: 71 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,9 +74,78 @@ For example, to change the landing page, which by default displays the `README.m
74
74
All static files (e.g. `logo.svg`, `favicon.svg`, images, css files, etc.) should be put in the `afterpython/static/` directory.
75
75
They will be automatically copied to the `afterpython/_website/static/` directory during `ap build`.
76
76
77
+
#### Content-Type-Specific Static Files
78
+
In addition to the global `afterpython/static/` directory, each content type can have its own `static/` folder for content-specific assets:
79
+
80
+
-`afterpython/blog/static/` - Static files specific to blog posts (e.g., thumbnail images, blog-specific graphics)
81
+
-`afterpython/tutorial/static/` - Static files specific to tutorials
82
+
-`afterpython/doc/static/` - Static files specific to documentation
83
+
84
+
This organization helps keep content-related assets close to their source files. For example, if you have thumbnail images for your blog posts, place them in `afterpython/blog/static/` rather than mixing them with global assets in `afterpython/static/`.
85
+
86
+
---
87
+
## Content Type Configuration
88
+
Each content type (blog, tutorial, etc.) has a listing page that displays all posts of that type. You can customize these listing pages in `afterpython.toml`.
89
+
90
+
:::{note}
91
+
This configuration applies to all non-doc content types. Documentation (`doc`) does not have a listing page, so these settings don't apply to it.
92
+
:::
93
+
94
+
### Default Thumbnails
95
+
Set a default thumbnail image for all posts within a content type:
96
+
97
+
```toml
98
+
[website.blog]
99
+
thumbnail = "blog_default_thumbnail.png"
100
+
```
101
+
102
+
The thumbnail path is **relative to the content type's static folder**. In this example, `afterpython` will look for `afterpython/blog/static/blog_default_thumbnail.png`.
103
+
104
+
This default thumbnail will be used for any blog post that doesn't specify its own thumbnail.
105
+
106
+
:::{tip} Override Thumbnails Per Post
107
+
You can override the default thumbnail for individual posts using MyST [frontmatter](https://mystmd.org/guide/frontmatter#available-frontmatter-fields). Add this to the top of your markdown file:
108
+
109
+
```markdown
110
+
---
111
+
title: My Blog Post Title
112
+
description: A brief description of this post
113
+
thumbnail: custom_thumbnail.png # Specific thumbnail for this post
114
+
---
115
+
```
116
+
117
+
This also works for Jupyter Notebooks - just add the frontmatter in the first cell as markdown.
118
+
:::
119
+
120
+
### Featured Post
121
+
Specify which post appears in the featured/hero section of the listing page:
122
+
123
+
```toml
124
+
[website.blog]
125
+
featured_post = "blog1.md"
126
+
```
127
+
128
+
This will display `blog1.md` prominently in the hero section when users visit the blog listing page.
129
+
130
+
### Example Configuration
131
+
Here's a complete example for blog posts:
132
+
133
+
```toml
134
+
[website.blog]
135
+
thumbnail = "blog_default_thumbnail.png"# Default thumbnail for all blog posts
136
+
featured_post = "announcing-v1.md"# Featured post in hero section
137
+
```
138
+
139
+
The same configuration works for other content types:
0 commit comments