View on GitHub

The Least You Need to Know About GitHub Pages

The least you need to know about GitHub Pages is laser-focused on one thing: showing how to get a working informational website up and running as fast as possible using GitHub Pages, using only the GitHub website.

Adding images to your GitHub Pages site

The Jekyll publishing system used by GitHub Pages expects you to have an assets directory, and that’s where image files should be placed. By convention they go into an images subdirectory (full path /docs/assets/images but that’s not a firm requirement. They can be anywhere in the /docs/assets path.

Create a directory called /docs/assets

Upload images to the /docs/assets directory

Screenshot of uploading a file to the /docs/assets directory

Screenshot showing the commit changes button

Add proper Markdown to display the image

Now insert Markdown text to specify an image. It’s the same as for a link, but preceded by a ! character. For example, if you want to show a file named logo.png in the assets directory (really /docs/assets in this example), you’d employ this Markdown. Note that the text in between the [ and ] should be a clear description of the image. It’s used by screen readers for visually impaired users.

![Book logo](/least-github-pages/assets/logo.png)

Book logo

Previous page Next page

Home