what does marking directory as resource root do - phpstorm

I have the following project structure:
root
- pics
- less
- main
- components
- navbar.less
In my navbar.less I reference image from the pics folder like this:
background : url('../pics/dtv-logo.jpg') no-repeat;
The reason for specifying the path like that is that when deployed to server the project structure will be like this one:
root
- pics
- css
- index.css
So the path will correct when deployed. However, webstorm says it can't find resource, which is also correct given current folders structure. I googled and found that I can mark directory as resources. I did that but webstorm still complains. Can you explain what marking directory as resource root does and how can I solve my problem?
Example #2:
- css
- pics
- assets
- some_logo.png
Marking assets as resourceRoot and specifying URL like this '/assets/dtv-logo.jpg' still failed to resolve the path.

Related

Why is Live Sass Compiler breaking my many-to-one source mappings?

Goal
Compile many .sass files to one .css file, where all .sass and .css files are in the same directory.
Problem summary
I'm trying to compile many .sass files to one .css file, all located within the same directory, like this:
- app
- static
- css
- _base.sass
- _header.sass
- _layout.sass
- _map.sass
- _modal.sass
- _windows.sass
- main.v0.css
- main.v0.css.map
- main.v0.sass
I'm using the VSCode extension Live Sass Compiler, which has worked seamlessly in the past for what I'm doing but all of a sudden it's breaking my source mappings. I also can't remember/figure out how to do a many to one Sass compilation at the command line, with the specific constraint of keeping both the .sass and .css files in the same directory.
At this stage, every time I use Live Sass Compiler to compile, my git history shows these changes (see screenshots), which seem to be breaking the site. When I load my page after making changes in this way, all the styling for my site stops working.
Findings
From what I can deduce, it's wiping all the previously compiled styling from main.v0.css and replacing it with mapping information. In main.v0.css.map it seems to be stripping sourceRoot information, changing sources from main.v0.css to main.v0.sass, and changing file from main.v0.css to main.v0.sass (so just switching those two for some reason).
Can anyone help me? Maybe this broke with the last VSCode update or something?

PhpStorm: what does it mean the name of the folder in square brackets along with the name of a folder?

The root of my PhpStorm projects is app-project-name-www.
In all my other projects, PhpStorms shows the root with this name:
app-project-name-www [app-project-name-www]
In this project, instead, it adds the square brackets to the tests folder, like you can see in the image below.
Questions
What does it indicate the name in the square brackets?
How does it call PhpStorm? (I'm not able to search for info in Google as I don't know what to search for)
How to put this name again along with the root folder, removing it from the tests folder?
Current PhpStorm version: 2020.1.3
These brackets likely indicate that your tests folder is added as an additional content root to your project. Check Preferences | Directories

Mkdocs site is opened incorrectly

I've got mkdocs.yml file which looks like:
site_name: blabla
pages:
- One page: page2.md
- Second page: page2.md
- Navigation: Navigation.md
When I open it url is like this: http://10.2.0.8/blabla/master/Navigation.md and doesn't work and I get 404 Not Found
nginx/1.14.0 (Ubuntu) error. If I delete .md at the end of url it works fine.
However, on locally it opens like http://127.0.0.1:8000/Navigation/
does anyone know what's the problem with this?
As described in the official mkdocs documentation, the intended behavior is that http://10.2.0.8/blabla/master/Navigation.md does not exist, but rather http://10.2.0.8/blabla/master/Navigation as shortcut for http://10.2.0.8/blabla/master/Navigation/.
What might have gone wrong in your case is the deployment of the HTML & CSS files. Assuming that your markdown sources are in ~/blabla, a mkdocs build --clean within that directory will create a subdirectory ~/blabla/site/ which you then have to deploy in the respective directory, say /var/www/html/blabla/. Under Linux, I suggest a rsync -r --delete-before ~/blabla/site/* /var/www/html/blabbla/. In other words: The issue might also be that you simply have not deployed the whole site or at a different place.

How to generate a whole website in a variabilized sub-directory ? (Jekyll)

I've been playing around with Jekyll lately and recently discovered that S3 wouldn't allow me to have enough buckets to have one bucket per website.
So I'm struggling to figure out two things
1) How do I specify that I want a 'child' subdirectory to be created, and all the generated website's files to be in it ?
2) How do I use a variable as the 'child' subdirectory's name ? (since it will be different for each website)
The baseurl config option doesn't seem to do anything about that. Any idea will be welcome :-)
Thanks a lot, and have a great day !
I'm not sure about the variable option, however, for child sub-directories:
A) If you can put the content into "child" folders directly within the jekyll content, then use different configuration files to manage each site through build properties. See the examples under the example below.
B) If you just want to put the same content in different places, perhaps you could use different baseurl or destination properties in different config files? Use the same config file approach as below, but with different versions of those properties instead of/in combination with the exclude property (see https://jekyllrb.com/docs/configuration/#serve-command-options).
Example: Use different config files
Use the exclude config property to exclude folders (and all of that folder's contents) when running a build. You could also specify different output folder locations per site, base URLs, and so on. I'll focus on the exclude property, but you can find other useful properties in the documentation: https://jekyllrb.com/docs/configuration/#global-configuration
For example, you could have the following files/folders:
/siteA-folder/siteA-content/blah.html
/siteB-folder/siteB=content/meh.html
/siteC-folder/siteC=content/foo.html
config.yaml
config_buildA.yaml
config buildB.yaml
Use the build option --config FILE1[,FILE2...] (https://jekyllrb.com/docs/configuration/#build-command-options) to explicitly call your custom config file A or B, each of which has its own version of the exclude property.
Snippet from config_buildA.yaml:
exclude:
- /siteB-folder/ # While building A, you want to exclude the siteB folder and contents
- /siteC-folder/ # Similarly, exclude siteC contents
Snippet from config_buildB.yaml:
exclude:
- /siteA-folder/ # While building B, you want to exclude the siteA folder and contents
- /siteC-folder/ # Similarly, exclude siteC contents
Building A from the command line:
jekyll build --config config_buildA.yaml
Building B from the command line:
jekyll build --config config_buildB.yaml
By managing excludes in the config file, you can re-use the common templates and css, and keep everything together (using less disk space overall).
If there's shared content, you could also look into using a more advanced feature, includes (see https://jekyllrb.com/docs/includes/), to manage the shared content in the includes folder, referenced within the html or markdown files (but that's getting a little of the beaten track for your question, so I'll stop there...)
EDIT: I see you've edited the question specifying the baseurl property doesn't do what you're looking for.
I've used a combination of the url site property baseurl and destination similar to below. In my case, I have different destinations depending on whether it's an archive or latest content, but you could use this to build to different web folders if you wanted.
Ex: config for latest content
url: http://example.com
baseurl: "/latest/"
destination: /path/to/latest/output/
Ex: config for archived content
url: http://example.com
baseurl: "/archive/content/"
destination: /path/to/archive/output/
Then, using the multiple versions of the config file, I can just call whichever one applies.

How to include only a single folder in Bamboo build plan

I need Bamboo to build the project automatically when a file in "api" subfolder changes. When a file in any other subfolder changes the bamboo build plan shouldn't run.
Folder structure:
project
- api
- ui
- core
In the Plan Configuration repositories tab, from the "Include / exclude files" dropdown I have selected the following option
Include only changes that matches the following pattern
and I have tried the following patterns:
.*/api/.*
api/
api/*
api\/*
api/**
/api/*
but the build plan isn't running. With "Include / exclude files" dropdown set to None the build plan runs (but does so when a file changes in any other subfolder also)
I can't split the project up to different repositories.
What pattern should I use or is there any other solution for this?
Pattern that ended up working was
api/.*
It's a regular expression from the root of the checkout supposedly, although I have not used this feature. Here are some of their examples:
https://confluence.atlassian.com/display/BAMBOO052/_planRepositoryIncludeExcludeFilesExamples?_ga=2.91083610.1778956526.1502832020-118211336.1443803386
What you might try is let it checkout the whole thing without the include filter set, and don't let it delete the working directory. Look on the filesystem and verify the path from the root of the working directory. Then test your regex against the whole path relative from that working directory.