Relative/absolute links problems

I’m rather new to Middleman, have a sketchy knowledge of Ruby, and do psychotherapy for a living, so this is all an avocational endeavor for me (much loved!). My question is very quite simple I’m sure, but it’s a real challenge for ME.

I’ll just describe what I’m trying to do and hope that someone can tell me how to do it.

  1. Currently, I have a single layout file that works well for all my pages. It has a main navigation bar and an aside sidebar containing some links, in addition to a main content area.

  2. Most of my pages will go into the site root, but several sets will go into various directories, to keep the number of files in a directory reasonably manageable.

When I use the common layout file to build a page in one of the subdirectories, the navigation bar links, as well as the link to my site CSS file in the page section are wrong. How do I tell Middleman to adjust them so they are correct?

I could just specify absolute links, using the full URLs but that wouldn’t work with the development server, and seems a bit silly for the CSS link given in the section.

About all I can figure to do is to template the problem - which is to say to put into the frontmatter for the page source a string which I can then have erb prepend to all links in the layout file. Is this the best approach?

Thanks in advance for any ideas offered! I’m really loving Middleman - a marvelous tool.

I could just specify absolute links, using the full URLs but that wouldn’t work with the development server

Just in case you have not tried this, instead of a full URL

https://www.my_domain/path/to/page

use a root relative

/path/to/page

Thanks! Problem solved. Am very grateful.