Skip to content

Commit 59f4fd4

Browse files
committed
Update environment.md
1 parent c336deb commit 59f4fd4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

cheatsheets/jekyll/environment.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,40 @@
33

44
{% raw %}
55

6+
## Production builds
7+
8+
Some plugins or includes blocks as around Jekyll Analytics will only run when using prod env - locally or through GH Pages.
9+
10+
GH Pages will set this as production value for you when it builds.
11+
612
```sh
713
JEKYLL_ENV=production bundle exec jekyll build
814
```
915

16+
Example use:
17+
1018
```liquid
1119
{% if jekyll.environment == 'production' and site.google_analytics %}
1220
{% include google-analytics.html %}
1321
{% endif %}
1422
```
1523

24+
25+
## GitHub metadata
26+
27+
When using the GitHub Metadata plugin to get data for your GH profile and repos, you will this error when doing a prod build locally, outside of GH Pages. Even if your remote is set, which is what is requests:
28+
29+
```
30+
Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.
31+
```
32+
33+
You can solve this by setting your "NWO" (name with owner) in your config file.
34+
35+
```yaml
36+
repository: username/repo-name
37+
```
38+
39+
See [Configuration](https://jekyll.github.io/github-metadata/configuration/) help page for the GH Metadata plugin.
40+
41+
1642
{% endraw %}

0 commit comments

Comments
 (0)