-
Notifications
You must be signed in to change notification settings - Fork 35
Tips for forked repos
cdmgtri edited this page Feb 10, 2021
·
1 revision
Default root-relative links will not work for viewing pages on a forked repo.
<link rel="stylesheet" href="/assets/css/main.css"> <!-- breaks -->
<link rel="stylesheet" href="assets/css/main.css"> <!-- works -->
<a href="/iepd-starter-kit/"> <!-- breaks -->
<a href="iepd-starter-kit/"> <!-- works -->
Use a relative link if possible.
Remove the initial /
.
Set baseurl
in _config.yml
baseurl: "NIEM.github.io"
Use a Jekyll template to prepend the baseurl to links:
{{ "myurl" | relative_url }}
Examples:
<a class="navbar-brand" href="{{ '/' | relative_url }}'">
[Title]({{ "/model/concepts/" | relative_url }})
Do not commit baseurl value to NIEM repo
Add _config.yml to .gitignore.
Override baseurl when viewing the pages on local development server
bundle exec jekyll serve --baseurl ''