Skip to content

Commit 3a2df76

Browse files
committed
Resolve incorrect HOME_PATH/BASE_PATH settings
JB/setup needs to account for being falsy. Also add better usage instructions for BASE_PATH. Fixes #30
1 parent eb40808 commit 3a2df76

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

Diff for: _config.yml

+20-6
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,28 @@ JB :
3434
version : 0.2.0
3535

3636
# All links will be namespaced by BASE_PATH if defined.
37-
# This is required for hosting GitHub Project Pages.
38-
# If you are deploying this website for one of your GitHub projects
39-
# you must set BASE_PATH to the name of your GitHub project.
37+
# Links in your website should always be prefixed with {{BASE_PATH}}
38+
# however this value will be dynamically changed depending on your deployment situation.
4039
#
41-
# Leave this blank if you have defined a CNAME for your site (pages.github.com)
42-
# NOTE: When in localhost, your site will run from root "/" regardless of BASE_PATH
40+
# CNAME (http://yourcustomdomain.com)
41+
# DO NOT SET BASE_PATH
42+
# (urls will be prefixed with "/" and work relatively)
4343
#
44-
BASE_PATH : ""
44+
# GitHub Pages (http://username.github.com)
45+
# DO NOT SET BASE_PATH
46+
# (urls will be prefixed with "/" and work relatively)
47+
#
48+
# GitHub Project Pages (http://username.github.com/project-name)
49+
#
50+
# A GitHub Project site exists in the `gh-pages` branch of one of your repositories.
51+
# REQUIRED! Set BASE_PATH to: http://username.github.com/project-name
52+
#
53+
# CAUTION:
54+
# - When in Localhost, your site will run from root "/" regardless of BASE_PATH
55+
# - Only the following values are falsy: ["", null, false]
56+
# - When setting BASE_PATH it must be a valid url.
57+
# This means always setting the protocol (http|https) or prefixing with "/"
58+
BASE_PATH : false
4559

4660
# By default, the asset_path is automatically defined relative to BASE_PATH plus the enabled theme.
4761
# ex: [BASE_PATH]/assets/themes/[THEME-NAME]

Diff for: _includes/JB/setup

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% if site.JB.setup.provider == "custom" %}
66
{% include custom/setup %}
77
{% else %}
8-
{% if site.safe and site.JB.BASE_PATH %}
8+
{% if site.safe and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
99
{% assign BASE_PATH = site.JB.BASE_PATH %}
1010
{% assign HOME_PATH = site.JB.BASE_PATH %}
1111
{% else %}

0 commit comments

Comments
 (0)