Jekyll assumes that the generated site will be served from the root directory, and subsequently all of the links are absolute beginning with "/". I'd like to serve out a blog from a subdirectory, i.e., http://www.example.com/~user/blog.
Setting permalink variable (http://jekyllrb.com/docs/permalinks/) would be a partial fix, but doesn't address other things such as css files.
I'll be glad for any pointers.
You want to use the baseurl config option in your _config.yml file. Permalinks will then be relative to that. See the Jekyll docs for the baseurl option:
http://jekyllrb.com/docs/configuration/
Assuming you are using at least Jekyll 1.0.0.
Related
I'm trying to get started with a blog using Jekyll. With Ruby, bundler and gems installation out of the way, I've spun up a site. The problem now is that the styles don't seem to render.
The site's src code is here, https://github.com/soumasish/Blog
I'm not sure if the problem is because the SASS isn't compiling or the site is just not able to pick up the CSS.
Any help appreciated.
I'm assuming you mean the styles aren't loading when you visit https://soumasish.github.io/Blog/, locally it looks fine.
It's requesting the CSS file at /css/main.css, which is an absolute URL. This absolute URL negates the base path of Blog, resulting in a request to:
https://soumasish.github.io/css/main.css
But the CSS file is located here:
https://soumasish.github.io/Blog/css/main.css
To fix it, you can add a baseurl option to _config.yml:
baseurl: "/Blog"
Or add that to the url setting (but baseurl is the recommended way):
url: "https://soumasish.github.io/Blog"
I have a simple HTML microsite, which I want to put inside my wordpress website. For example: Wordpress website is: abc.com
I want to put my microsite inside this wordpress site. So URL becomes:
abc.com/microsite/
But, wordpress treats any url as its own. How can put "abc.com/microsite/" urls to Wordpress Ignore list. So that any pages inside microsite folder executes independently.
just put you folder 'microsite' in root(Where you find wp-admin,wp-content and wp-include folder). and
you are able to access the folder
"abc.com/microsite/ by this url
If you are still having issues with accessing the subfolder, try renaming the .htaccess to .htaccess-bak in order for WordPress to regenerate the file again. Understand that your website might temporarily go down.
I've found this solution to help in some cases, but I don't know exactly why, ergo I am not sure it will work. And if you feel uncomfortable editing the .htaccess file I suggest you learn more about it (as should I). It is a very powerful file and WordPress uses it a good deal.
P.S. The file is located in the same folder, WordPress' root folder where you find /wp-admin/, /wp-content/, etc. It is hidden by some hosting providers, but I've always been able to find them through FTP with the hosting companies I've used before.
Ok this is almost a repost except I know the cause. Ok So I have a site in a subdirectory under my www folder (which appears to simply be a link to the public_html folder.) Anyhow this site is not a wordpress site, even though the parent site is. My wp-admin wp-content and wp-includes directories are also in the same spot.
My problem is that the second site in the subdirectory is automatically using the wordpress css for some reason. I do not want it to do that. I have a css file for it, but it does not load it and uses the wordpress one instead.
Is there a way to correct this so that it only uses the css file I tell it to use?
The only way that this site will use the Wordpress CSS is if it somehow imports the Wordpress CSS. View the page source and try do discover from where the site is getting the Wordpress CSS. Make sure that you are not calling the tag anywhere. If you have managed to strip away the Wordpress CSS, then just reference the desired CSS as you would with a static HTML site. The fact that it is in the same directory as the Wordpress directories will not make a difference.
Ok I fixed this. I simply renamed the css file to something other than style.css In this case I name it santastyle.css as this site is meant to work as a secret santa website. This solved the problem.
I've created a WP theme, which contains slideshows on different pages. I don't want to use any WP plugins for that specific project, so I tried the following:
define foldes at the root directory (e.g. /slideshow/folder1)
get files from folders on specific pages via php and echo the code
Wordpress naturally redirect any links which are not absolute I guess. This method will work at the home page (because the folders for the slideshow are in the root directory), but not in any other pages.
The schema for the pages is "www.mylocation.com/pagename/". When I'm trying to get the files with a relative url like "../slideshow/folder1" Wordpress redirect the link to "../pagename/slideshow/folder1".
Is there a solution which will work for that specific part (maybe without htaccess redirect)?
The temporarily solution is rewrite the urls after loading via JavaScript but this will force loading failures when php is trying to get the files.
Did you try to set a base URL?
<base href="http://www.mylocation.com/pagename/" />
this may solve the problem.
The tag specifies the base URL/target for all relative URLs in a document.
more details
I changed my Drupal $base_url in settings.php to
http://www.example.com/subfolder
but root relative paths are still pointing to
http://www.example.com
and not to the correct "subfolder". Any idea what I'm doing wrong?
I flushed cache, re-edited a couple links to make sure but they're still pointing to the root domain and not to the correct subfolder.
The Pathologic module provides input filtering to correct URLs that are no longer correct because of configuration changes. Here is an excerpt from its project page:
... an input filter which can correct paths in links and images in your Drupal content in situations which would otherwise cause them to “break;” for example, if the URL of the site changes, or the content was moved to a different server. Pathologic can also solve the problem of missing images and broken links in your site’s RSS feeds. See more example use cases on the documentation page.
Pathologic is designed to be a simple, set-it-and-forget-it utility. You don't need to enter any special “tags,” path prefixes, or other non-content noise into your content to trigger Pathologic to work; it finds paths it can manage in your content automatically.
Define what you mean by root-relative paths. If you are talking about the front paged linked to
http://www.example.com
you may edit $base_url in settings.php.
If you are talking about
Home
linking to
http://www.example.com
that has nothing to do with Drupal, though the Pathologic module mentioned by #sutch may help.