Struggling to get path to url link to work from an include

Hi all… my first post of many I’m sure :slight_smile:

not really sure yet what all this GitHub / Liquid etc is… never done it before but now stuck into all sorts of youtube vids etc while the mrs is out so forgive me if this sounds really lame “Oh everyone knows thee answer to this one!” type of a question… :smiley:

I’m new to Jekyll as of 3 days… I have a project that I thought to start last week using php incudes rather than a database an while searching the net stumbled upon Jekyll and It’s just what I need.

I have removed the original theme minima from gems/config etc - copied pasted layout structure etc and the front index page loads fine with my custom css displaying on a Jekyll serve etc…

However… I have the following code on home.html as I am now trying to load separate bits into the front index page from includes…

<div class="col-4">
   {% include /frontpage/column1.html %}

with column1.html living in the includes folder “_includes/frontpage/” structure
with this content inside column1.html …

  		<p><a class="button button1" href="{{ site.baseurl }}/history/my-new-history-page.html" style="width: 100%;"> History »</a>

with of course a separate folder then in root of history/my-new-history-page.html

I’ve also tried without site.baseurl and another try with …/history etc etc…

column1.html does display on my index.html so that path is fine… is just the link to url showing a 404…

I have also tried simply displaying the link straight n the home page… the button appears but again when clicked “404…”

really struggling to get my head round what I think will probably be a really simple Path solution but there ya go… I’m baffled…

Any help appreciated or better explanation if you need…

many thanx advance…

Aha!! Found this link after more internet trawls… helped me in my quest…

placing for any other noobs… I now have sub directories - giddy - \0/

1 Like

Glad you found the answer and the link is super useful! :bulb:

Could you also share how your solution looks like?

Yeah sure… it was dead simple tbh I reccon just being new to Jekyll I just needed to read 'n learn a bit more…


I created a folder (with underscore)…"_pages" then inside created a sub dir without underscore eg: myfolder1, myfolder2 then my pages with .md extension.

As a note to my fellow noobs… if you were to create an inside myfolder1 , then simply adding " permalink: /myfolder1/ "on that page will then load that page.

Else you can add " permalink: /history/ " to the page inside myfolder1 to call a page called for example.

And then so Jekyll includes that folder add " include: ["_pages"] " into the config file. (just the name of your first folder with underscore - no need to add myfolder1 etc as jeckyll wil now recognise everthing inside of “_pages”)

easy and quick… now I have a full functioning flat HTML webby to work on without a database and very happy.

Subsequently since the other day I’ve also joined Git and actually that was super easy too… dunno why I thought this stuff was beyond me… No more Drupal sluggishnesss on my shared hosting… YeahBaby :smiley:

1 Like

That is slick! :thumbsup: Thanks a lot for sharing your adventure with permalinks and configuration.

You’re absolutely right - Git/Github is not a rocket science at all. :smile:

Cheers for your new (and perfectly linked) Jekyll site! :clinking_glasses: