LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-12-2024, 05:05 PM   #1
slaccware
LQ Newbie
 
Registered: Jun 2024
Posts: 2

Rep: Reputation: 0
GitHub - How to reference a file that is deep in a directory?


I have an HTML file on my GitHub repository that is located within a sub-directory within a sub-directory. In this file, I need to reference a favicon that is located close to the root of the repository.

At the moment my code looks like this:
Code:
<link href="../../../img/favicon.ico">
This works, but I'm wondering if there is a simpler way to do this. I've tried
Code:
~/img/favicon.ico
but that doesn't seem to work.
 
Old 06-12-2024, 05:13 PM   #2
slaccware
LQ Newbie
 
Registered: Jun 2024
Posts: 2

Original Poster
Rep: Reputation: 0
Appologies, posted in the wrong forum. Meant to post in Non-*nix general.
 
Old 06-12-2024, 05:23 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,295
Blog Entries: 24

Rep: Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254Reputation: 4254
You should use the Report button to request this thread be moved (perhaps Programming would be a better choice).

Assuming the img/ directory is at the server root (and I am not certain what Github considers server root), this should do:

Code:
/img/favicon.ico
The web server has no concept of your home directory so the leading ~/ means nothing useful in this context.

And welcome to LQ!

Last edited by astrogeek; 06-12-2024 at 05:24 PM.
 
1 members found this post helpful.
Old 06-12-2024, 05:47 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,322

Rep: Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373Reputation: 5373
There's no way to pull it off without either programming (an application is serving up the favicon) or configuration (an actual web server like Apache is).
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Github no binaries /easy downloads without login? Github noob rico001 Linux - Software 4 01-02-2021 07:14 AM
LXer: GitHub Actions moves GitHub into DevOps LXer Syndicated Linux News 0 08-09-2019 01:04 PM
LXer: Learn to use GitHub with GitHub Learning Lab LXer Syndicated Linux News 0 04-20-2018 01:12 AM
LXer: GitHub wants more new contributors, because that's what GitHub is for LXer Syndicated Linux News 0 07-27-2017 06:36 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration