You’ve edited text. Now let’s add an image to your site—the full process from uploading the file to seeing it on a page.
Before we start, one core Xanthan workflow: find something that already works, copy it, then adapt it.
You don’t need to write include code from scratch. In practice, the fastest and safest way to add a new thing is:
We’ll do exactly that here.
Open Images guide in one tab and your page file in another.
Find a figure.html example in the guide, copy it, and paste it into your page. Then edit just these values:
image-path="assets/images/..."caption="..."alt-text="..."width="..."This copy/adapt pattern is how most Xanthan edits should work, especially when you’re new.
assets/images/ folderYour image is now in your repository at assets/images/your-image.jpg.
. on your repository page to open the code editorindex.md){% include images/figure.html
image-path="assets/images/your-image.jpg"
class="center"
width="60%"
caption="A brief description of what's shown."
alt-text="Describe the image for screen readers"
%}
your-image.jpg with your actual filename (capitalization matters)Wait 1–2 minutes for GitHub Pages to rebuild, then refresh your site. Your image should appear centered at 60% width with a caption below it.
The figure.html include has a few options you can adjust:
class — left, right, or center (controls positioning)width — any percentage like 40%, 80%, 100%caption — text that appears below the imagealt-text — description for accessibility (always include this)For the full range of image options—side-by-side layouts, carousels, full-width jumbotrons, and more—see the Images guide.