Eggspress allows you to create and use custom sidebars with ease.
You could use one sidebar for each content item, reuse the same sidebars on multiple pages, or ignore them altogether.
Creating new sidebars
You can find all of your sidebars in the workspace folder found at my_sidebars
.
As with all other content folders (including my_posts
, my_pages
, my_authors
, and my_categories
), you may organize your files within my_sidebars
however you wish. Keep all of your sidebars in one place or nest them in subdirectories if you require more organization.
In Obsidian
If you use Obsidian, you can create a new sidebar by creating a new note in your my_sidebars
folder. You can then insert a template from my_templates
called #frontmatter.sidebar
.
In other editors
The easiest way to create a new template is by creating a duplicate from the template sidebar. You can do this by following these steps:
- Navigate to your workspace folder
- Open the folder
my_templates
- In this folder, locate the file
#.frontmatter.sidebar
- Right-click on this file and select "Copy"
- Navigate back to your workspace folder
- Open the folder
my_sidebars
- Right-click on an empty space in this folder and select "Paste"
- Right-click on your newly pasted file and select "Rename"
- Enter a new name for your newly pasted file
Populating your sidebars
Each sidebar can contain up to nine pinned posts and nine sections.
Pinned Posts appear at the very top of your sidebar. They allow you to draw attention to certain posts.
Sections can contain a combination of one or more of the following:
- a heading
- a block of text
- an image
- a link
Inserting images
You can reference an image by its slug. All images referenced must be stored somewhere within the my_sidebars
. You might choose to store images in subdirectories within my_sidebars
as well.
Links may be internal or external. If you are linking internally, you should try to create a relative link (beginning with a forward slash, "/").
The easiest way to do this is to remove everything up through the top-level domain. For example, if we wanted to link to this post in a sidebar, we would take:
https://eggspress.org/blog/using-sidebars
And drop the domain, ending up with:
/blog/using-sidebars
Doing so allows your linked page to load faster and prevents it from opening in a new tab or window. Note that this only applies to internal links.
For more information, see linking-internal-content