webdevRefinery Forum: Espresso - webdevRefinery Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline @Tom 

  • space
  • Group: Members
  • Posts: 704
  • Joined: 24-May 11
  • Locationspace
  • Expertise:Python

Posted 14 May 2012 - 04:53 PM (#1)

Espresso


relative paths
Hey espresso users, How do you set up where the site's root is because I am tired of using absolute paths and changing them. I know you can but this is irritating me because if you just have something like
<img src="/imgs/whatever.jpg" >
It always comes up as if it doesn't exist.

Edit: let me clarify, for local viewing the paths need to be pointed at site root
ocelotapps.com
jr wdR comedian under ThatRailsGuy

View Postarronhunt, on 30 June 2012 - 10:09 PM, said:

Sir you are the first person to make me piss myself laughing. Kudos.
0


User is offline arronhunt 

  • I'm a httpster
  • Group: Moderators
  • Posts: 3398
  • Joined: 09-March 10
  • LocationLos Angeles, CA
  • Expertise:HTML,CSS,Javascript,Graphics,Flash

Posted 14 May 2012 - 05:24 PM (#2)

I don't really understand what you mean. Can you post a screenshot of your folder structure?

Your site root needs to be whatever dir your site is in. So something like this

my_cool_website/
  |-  my_cool_website.esproj
  |-  index.html
  |-  imgs/
       |-  whatever.jpg

DO NOT OPEN THIS

Spoiler
0


User is offline Renegade 

  • 418 I'm a teapot
  • Group: Members
  • Posts: 748
  • Joined: 08-March 10
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL,Graphics

Posted 14 May 2012 - 05:30 PM (#3)

Are you absolutely need to reference the root directory? I suspect that your HTML file is in the same directory as that
imgs
folder. If so, all you need to do is drop the first forward-slash to make it just
imgs/whatever.jpg
. If you don't already know this, you should really fire up a terminal and play around with the
cd
command to give you a feel for navigating a filesystem.

Edit: Sorry, seems to be Espresso related. Does it create environments like that?
http://adriancooney.ieGithubTwitterDribbbleForrst
We all die. The goal isn't to live forever. The goal is to create something that will.

Array(16).join({}-{}) + " Batman!";
0


User is offline @Tom 

  • space
  • Group: Members
  • Posts: 704
  • Joined: 24-May 11
  • Locationspace
  • Expertise:Python

Posted 14 May 2012 - 05:44 PM (#4)

Okay that's not the issue renegade I have my file structure correct. No offense if that sounds mean, it's not meant to be.

Root folder/styles/css/style.css is where my CSS is but I do not want to have
/users/Thomas/Dropbox/itom07/styles/CSS/style.css

in all my links then change it for web deployment. I'd rather set them
/styles/css/style.css
to be the same as online. The site shows up fine but all links that are relative to root will not work (CSS,js,images)

Edit to renegades edit: it's just te default setup

I see this issue all around on people blogs and how people say coda does root paths better but nobody is telling how to fix it.
ocelotapps.com
jr wdR comedian under ThatRailsGuy

View Postarronhunt, on 30 June 2012 - 10:09 PM, said:

Sir you are the first person to make me piss myself laughing. Kudos.
0


User is offline arronhunt 

  • I'm a httpster
  • Group: Moderators
  • Posts: 3398
  • Joined: 09-March 10
  • LocationLos Angeles, CA
  • Expertise:HTML,CSS,Javascript,Graphics,Flash

Posted 14 May 2012 - 05:49 PM (#5)

Do you not have your website in a centralized location? ex
/users/Thomas/Sites/my_website/
?

This isn't an Espresso problem, you need to reference the image the same way you would in any other IDE. You should always reference to files in your project's root directory, not your system's root.

Otherwise something like
../../Dropbox/itom07/styles/CSS/style.css
could be tried if that reflects your folder structure.

Edit: Also can you link to those blogs where people are having this same issue?
DO NOT OPEN THIS

Spoiler
0


User is offline @Tom 

  • space
  • Group: Members
  • Posts: 704
  • Joined: 24-May 11
  • Locationspace
  • Expertise:Python

Posted 14 May 2012 - 06:10 PM (#6)

View Postarronhunt, on 14 May 2012 - 05:49 PM, said:

Do you not have your website in a centralized location? ex
/users/Thomas/Sites/my_website/
?

This isn't an Espresso problem, you need to reference the image the same way you would in any other IDE. You should always reference to files in your project's root directory, not your system's root.

Otherwise something like
../../Dropbox/itom07/styles/CSS/style.css
could be tried if that reflects your folder structure.

Edit: Also can you link to those blogs where people are having this same issue?

http://www.mactalk.c...i-switched.html
Thats exactly what I am talking about, under the preview catagory. Using / for site root of your project doesn't work.
ocelotapps.com
jr wdR comedian under ThatRailsGuy

View Postarronhunt, on 30 June 2012 - 10:09 PM, said:

Sir you are the first person to make me piss myself laughing. Kudos.
0


User is offline arronhunt 

  • I'm a httpster
  • Group: Moderators
  • Posts: 3398
  • Joined: 09-March 10
  • LocationLos Angeles, CA
  • Expertise:HTML,CSS,Javascript,Graphics,Flash

Posted 14 May 2012 - 06:45 PM (#7)

Interesting. Though I only work with relative paths when coding and rarely use Espresso's preview (I just view in browser with instant refreshes thanks to codekit).
DO NOT OPEN THIS

Spoiler
0


User is offline @Tom 

  • space
  • Group: Members
  • Posts: 704
  • Joined: 24-May 11
  • Locationspace
  • Expertise:Python

Posted 14 May 2012 - 06:51 PM (#8)

View Postarronhunt, on 14 May 2012 - 06:45 PM, said:

Interesting. Though I only work with relative paths when coding and rarely use Espresso's preview (I just view in browser with instant refreshes thanks to codekit).

Maybe there isn't an easy fix and Ill just have to deal with it and use codekit like you do.
ocelotapps.com
jr wdR comedian under ThatRailsGuy

View Postarronhunt, on 30 June 2012 - 10:09 PM, said:

Sir you are the first person to make me piss myself laughing. Kudos.
0


User is offline @Tom 

  • space
  • Group: Members
  • Posts: 704
  • Joined: 24-May 11
  • Locationspace
  • Expertise:Python

Posted 14 May 2012 - 09:22 PM (#9)

View Postarronhunt, on 14 May 2012 - 06:45 PM, said:

Interesting. Though I only work with relative paths when coding and rarely use Espresso's preview (I just view in browser with instant refreshes thanks to codekit).

Do you do your LESS stuff in espresso? w/o syntax. highlighting
ocelotapps.com
jr wdR comedian under ThatRailsGuy

View Postarronhunt, on 30 June 2012 - 10:09 PM, said:

Sir you are the first person to make me piss myself laughing. Kudos.
0


User is offline Hyde 

  • Group: Members
  • Posts: 1562
  • Joined: 08-March 10

Posted 14 May 2012 - 09:40 PM (#10)

View Postitom07, on 14 May 2012 - 09:22 PM, said:

Do you do your LESS stuff in espresso? w/o syntax. highlighting

Just select CSS as the language in Espresso, it wlil highlight the syntax as it would with any .css file, except LESS variables and etc.
Hyde | HTML & CSS | PHP & SQL | Objective-C | Java | Basic JavaScript
0


User is offline @Tom 

  • space
  • Group: Members
  • Posts: 704
  • Joined: 24-May 11
  • Locationspace
  • Expertise:Python

Posted 14 May 2012 - 10:41 PM (#11)

View PostHyde, on 14 May 2012 - 09:40 PM, said:

Just select CSS as the language in Espresso, it wlil highlight the syntax as it would with any .css file, except LESS variables and etc.

Mine already is but I was hoping for some variable highlighting, oh well. Although I prefer stylus more than less.

For those of you who want syntax highlighting in espresso, I found a repo that will do just the thing, fixed his git clone path and your good to go.
Blue strike github

Its off my account because it has the updated git clone, I sent a pull request to him and it'll be fixed soon.
ocelotapps.com
jr wdR comedian under ThatRailsGuy

View Postarronhunt, on 30 June 2012 - 10:09 PM, said:

Sir you are the first person to make me piss myself laughing. Kudos.
0


User is offline arronhunt 

  • I'm a httpster
  • Group: Moderators
  • Posts: 3398
  • Joined: 09-March 10
  • LocationLos Angeles, CA
  • Expertise:HTML,CSS,Javascript,Graphics,Flash

Posted 14 May 2012 - 11:22 PM (#12)

View PostHyde, on 14 May 2012 - 09:40 PM, said:

Just select CSS as the language in Espresso, it wlil highlight the syntax as it would with any .css file, except LESS variables and etc.


Yeah that's what I have to do. I tried LESS sugars before but they didn't work very well. At all. The first selector when nesting always messes up the highlighting so I've been coding like this the past few months.

div{
    width: 145px;
    height:150px;
    {}
    .cell{
        background: #ff0;
        {}
        &:hover{
            background: #00f;
        }
    }
}

DO NOT OPEN THIS

Spoiler
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services