in _config.yml I setup permalink
but still in generating files i get '/' on start url
<a href="/........"
how removing this first '/' ?
Related
Is it possible to change the target URL when clicking on the value title defined in _config.yml ?
To define the context, I have my static HTML website hosted on GitHub, it's a one page website. I have on the same repository the Jekyll blog accessible on mysite.github.com/blog.
When I click on the header title, the Jekyll blog redirect me to / which is my website and I would like to be redirected in /blog.
What is the simpliest method ?
You need to rewrite the header.html of the minima theme template. The goal is to change the target of the link in the header.
To do that :
Create a folder _includes and a file header.html inside
Copy and paste the original code for the official repository
https://raw.githubusercontent.com/jekyll/minima/master/_includes/header.html into the header.html file
replace the content of href="{{ "/" | relative_url }}" by href="{{ "/blog" | relative_url }}"
Have you tried setting url and baseurl in the config for the blog? Baseurl should be used for the "home" page.
I have successfully hosted on Github Pages. Today I was trying to run the site through browser-sync so I could view my changes faster, and noticed that my urls were different when served locally than on the actual website. Here's what the local url looks like:
<a href="blog/post-title/">
Which when clicked on brings me to the page
http://localhost:3000/blog/blog/oven-baked-fajitas/
This same link, once it has been pushed to the Github repo and processed by them, turns into
<a href="/blog/blog-title/">
Which works correctly.
I link to individual posts in my archive like this:
<a href="{{ post.url }}">
And my _config.yml is as follows:
name: Adam Hammes
description: Adam Hammes' Website
author: Adam Hammes
url: http://hammes.io
permalink: blog/:title/
excerpt_separator: <!--more-->
exclude: ["README.md", "gulpfile.js", "package.json", "node_modules"]
What I have tried:
I added baseurl: "" to my _config.yml; no effect.
I added baseurl: "/"; no effect.
I added baseurl: "/", and changed the link format to {{ site.baseurl }}{{ post.url}}; this fixed the links locally, but resulted in 2 leading slashes live thus breaking the links.
I was using an old version of Ruby. By updating to Ruby 2 and then running gem install Jekyll I was able to get consistent behavior.
I'm a happy Jekyllbootstrap user, however the index.md template is compiled to index.html. This is expected, but for me undesired behaviour.
When the navigation links to the homepage it uses index.html on the anchor. I can get around this using an nginx redirect, but I don't want to have any links on my site that I'm "fixing" using 301 redirects. I'd like it to generate the correct link in the first place.
So to be clear. I don't want jekyll to ever link to index.html but instead link to /.
You can modify the variable HOME_PATH in _includes/JB/setup. By default it is {% assign HOME_PATH = "/" %}.
I found the answer to this. I had to set the following at the top of my index.md file:
---
layout: page
title: Home
group: navigation
permalink: /
---
The key part here being permalink: /
I'm having a hard time configuring permalinks for my blog posts. The way I have my blog set up is root/news/index .
I set my _config.yml to "./" so all my articles are on the same directory as my news index.html. But whenever I click on my article's permalinks on the news homepage, it redirects me to "mysite.com/article" instead of "mysite.com/news/article". I've also tried "./news/" but it only creates another news folder inside my original news folder. I've also tried the setting "pretty" but it still goes to "mysite.com/.." not "mysite.com/news/..."
In the _config file you can change the permalink to anything you like, for example mine is
permalink: /blog/:title
As for the date you can choose your own date using the YMAL front matter, again in mine i have
title:example date: you can pick what ever date you want
So in your case I would try this
permalink: /news/:title
I'm using Jekyll to create a blog/website. I have it setup so that it displays the URLs like this:
http://example.com/blog/title-of-post
I want to modify it to change the the "blog" part of the URL. For example:
http://example.com/writing/title-of-post
How can I do this?
You can do this by setting the permalink in your _config.yml file. For example:
permalink: /writing/:title
Note that this assumes that jekyll is building your entire site and isn't just powering the "blog" directory. If jekyll is only writing to your "blog" directory, then all you would need to do is rename that to "writing".