Gitbook not linking to root directory - anchor

In my markdown in gitbook, I have a link from a file in one folder to another page in a different folder:
in /folder2/file.md:
![](/example-folder/example-file.html#example-link)
In the gitbook editor's live preview, this link works as expected and goes to the correct page and location.
In the command line gitbook build, however, the html generated drops the initial slash and results in the html:
<a href="example-folder/example-file.html#example-link">
Without the initial slash, the link is no longer pointing to the root directory where the desired file is, and instead is trying to find /folder2/example-folder/
I have tried using a ./ at the beginning of the path, and get the same result.
Any suggestions for what I'm doing wrong or how I can fix it? Thank you!

Related

How to make eleventy include assets such as CSS and images in the output?

I'm trying out the eleventy static site generator for the first time. Whenever I build, the content files are generated just fine, but none of the assets (CSS, JS, images, etc.) end up in the output directory - all that appears is the HTML, with broken links to the assets.
For now I'm using the default directory structure:
project/
_includes/
_site/
css/
index.html
node_modules/
package-lock.json
package.json
I've tried building it just like it is above, and I've tried putting the css in the _includes directory. I also tried putting the css in the output folder (_site/), and that worked, but it seems wrong to have to edit a source file in the output.
I've searched around, but none of the tutorials I've found ever address things like including CSS.
Is there a proper way to go about this that I'm missing, or are you really supposed to edit files in both the source and the output?
The solution was to use passthrough file copy. I hadn't looked into that before because, as a beginner, it seemed like an advanced topic, and I figured something as basic as getting your CSS into the output directory should be some simple setting that's turned on by default. It is simple once you know how to do it, but it's not a default for some reason.
Here's the code that fixed my problem. "_src/assets" is the folder holding all the CSS and images, relative to the project root.
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("_src/assets");
return {
dir: {
includes: "_templates",
input: "_src",
output: "_site"
}
};
};

How to make relative links work in a .rmd file?

I am finishing an online tutorial created by Jeniffer Bryan. There is a section about relative links in Git markdown files. I tried and looked at examples, but it never works in my .rmd file.
I tried to use branch names and the whole path, but the result is always "/rmd_output/1/master/ds.md not found" and "No image at path plot.jpg."
[a link](master/ds.md)
[a link](hwsf/ds.md)
![image1](plot.jpg)
When you click on "a link," you should be directed to another page, namely "ds.md." I am asking this question, because I've ensured that the documents ds.md and plot.jpg are in the desired directory.

In Laravel 5.6, how do I create relative links?

I'm new to Laravel (using 5.6) and can't get my links to work.
My directory structure is: resources/views/pages/samples
In the samples directory, I have 10 blade files I want to link to (named "sample1.blade.php", etc.). I have a "master" links page in the pages directory (one level up from samples).
I've tried the following but can't get any of them to work correctly...
Sample 1
Sample 1
Sample 1
Sample 1
...and a few other variations.
I've also tried adding a base tag to the HTML header but that doesn't help.
Every time I click a link, it says "Sorry, the page you are looking for could not be found."
What am I missing?
Thanks #happymacarts, I didn't realize I had to add a path for every single page in my site.
After adding the paths, the links are working.
I will get into the practice of updating the paths every time I add a page.

Existence of .inputrc breaks paste shortcut

I recently created an .inputrc file in the root directory of my Windows (Vista) user, to override the default history behavior. Today I realized that the 'Insert' key doesn't work for pasting text any more - a tilde character is pasted instead. I found out that this is caused by the .inputrc file being there (an empty file is sufficient). Without the file, insert works just fine.
I tried to restore the insert behavior in the inputrc file, but I don't understand it well enough to make it work. I'm not even sure if I have to override "\e[1~", "\e[2~", or if I have to set some other variable.
Any ideas on how to use both 'Insert' for pasting and .inputrc?
Adding the line
"\e[2~": paste-from-clipboard
to your .inputrc should do it, see How can I copy and paste into Cygwin console windows? You'll probably also need mappings for the Home, End and Delete keys as show under Why don't the Home and End keys work in rxvt and vim?

URLRewriter.net fails relative paths when using more than one substring in URL

I have installed the URLRewriter on my server, and it works fine, but I have a rather big problem.
Relative links in hyperlinks, CSS-links, images etc. doesn't work when I have URLs with more than one substring.
E.g. (sorry, no http:// in front, as I do not have enough reputation):
website.com/Leje-og-udlejning-arbejdskraft leads to the path website.com/Workers.aspx and works just fine.
But
website.com/Leje-og-udlejning-arbejdskraft/Midtjylland leads to website.com/Workers.aspx?Region=Midtjylland using this line in the Web.config:
<rewrite url="~/Leje-og-udlejning-arbejdskraft/(.+)" to="~/Workers.aspx?Region=$1"/>
It rewrites just fine, but my relative links doesn't work anymore. CSS, Images, links and so on thinks my root is now http://website.com/Leje-og-udlejning-arbejdskraft, which of course doesn't exist.
Can't this be fixed?
All my links are correctly set using the ~/, like this:
<asp:HyperLink ID="HyperLink3" CssClass="black_text" NavigateUrl="~/Forgot-Password"
runat="server">I have forgotten my password</asp:HyperLink>
For now, my solution was to add the following in my head-tag:
<base href="http://website.com/">
However, I hope you have some better suggestions, as I constantly move the project between localhost and online server, and have to correct it each time.

Resources