MACOS Sierra clone problem

Hi guys,

I’m a novice to Github and struggling with what might be very basic…

When I start a new repo in GH pages, then want to clone it to GH Desktop, I get an error message: Safari complains that it is unable to open a link that starts with:

‘x-github-client://openRepo/etc.’ Have reinstalled the Desktop, rebooted de compuer, same result.

The other way around: starting a simple repo with Desktop and Atom, with an index.md containing a link to a page2, it works fine on the local server, but when I upload it to GH pages, only the index file shows correctly, when clicking the link to the second page, safari does not find it. Safari shows the url of the index page correctly: ~github.io/css2. But for page2 it searches for ~github.io/page2, instead of ~github.io/css2/page2. Very confusing for me!

 Did I screw up with a setting somewhere? I have no clue where to look, so help would be really appreciated!

You have a couple options, but first of all I suggest starting with:

Create a repo in github.com, and check "add Readme"

Now, the options:

A) Try the “open in desktop” using a different browser, i.e. Firefox or Chrome

B) Using the GitHub desktop app :

1.- click the plus sign (+) at the Top Left

Screen Shot 2017-11-14 at 12.08.19 AM.png

2.- Select Clone

3.- Find your repo, select it

4.- In the dialog window, select a folder in your computer (I recommend creating a folder named github inside Documents), click Ok

5.- Done! You’ll have the repo in your computer 

Hope that helps :slight_smile:

6.- Now you can add files in this repo, and click Submit  and Sync to add them to GitHub

1 Like

Thank you very much indeed, cloning from within the desktop works OK. Is this a known problem for Safari though, or did I do something wrong there?

As for my second question: I created a small repo with a mainmenu at the top. It looks like this: 

<link rel=“stylesheet” type=“text/css” href="/assets/css/mystyle.css">
<ul>
<li><a class=“active” href="/index/">Home</a></li>
<li><a href="/snippets/">Snippets</a></li>
<li class=“dropdown”><a href=“javascript:void(0)” class=“dropbtn”>Dropdown</a>
<div class=“dropdown-content”>
<a href="/page3A/">Page 3A</a>
<a href="/page3B/">Page 3B</a>
<a href="/page3C/">Page 3C</a>
</div>
</li>
<li><a href="/about-us/">About</a></li>
</ul><br/><hr/>

Works fine as long as it is on the local server, but when I sync it to Github Pages, all references seem to go wrong, resulting in “404 page not found”. The url Safari is looking for looks like: “https://akras123.github.io/page3A/”, which should be: “https://akras123.github.io/css2/page3A/”, so the site reference “css2/” is missing. Should I include some prepend somewhere?

You should use relative links (remove the leading slash, e.g. replace “/page3A/” with “page3A/”).

Wish it was that simple! When I use that, it doesn’t run even on the local server, which makes sense, because the files are in the root directory css2, while the menu is in css2/_includes/mainmenu.html. So, imho I need absolute addressing, and that works fine on the local server.

But when uploading this to Github Pages, I get confused. I find the index file as expected: https://akras123.github.io/css2/. The menu is also found, but not formatted (so /assets/css/mystyle.css is apparently not found). When I click on any of the menu entries (like Page3A), Safari doesn’t find the page at all (404 page not found). Checking the address bar of Safari, it appears that Safari is looking for “~.io/Page3A/” instead of “~.io/css2/Page3A/”. In other words: the site’s base url seems to be missing somehow… When I insert that in the address bar, the page is found.

And once again, as long as it is on the local server the absolute addressing works perfectly as expected! I hope the description is clear enough, and that you can help me out of the dark…

Here is a quick and dirty solution: https://ricostacruz.com/til/relative-paths-in-jekyll. Hope it helps.

1 Like

Thanks a lot, that solves the riddle indeed. I had just run into a comparable solution, i.e. to insert {{site.baseurl}} in any absolute address. Works OK as well, and it seems I don’t need to include any extra coding for it, apparently site.baseurl is already predefined somewhere…

Anyway, now I can proceed ans discover further, thanks again!