-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get github-metadata gem working on Netlify #227
Comments
I've written a Netlify Build plugin (98a812b) to generate a |
Okay, I've dug in a lot deeper to the
Very nearly there! |
…faulting to site.github branch This is necessary because `site.github.source.branch` refers to the upstream repo's branch, not the fork. See #227.
All right, I've reported the branch issue on the github-metadata repo, and implemented a workaround: the Netlify Build Plugin now saves the name of the branch being deployed to So, just to recap, we've essentially made the github-metadata gem "get out of the way" when deploying to Netlify. We do this by generating a supplemental I think once we switch the GitHub Pages approach to using Actions, we should explore moving away from the github-metadata gem (because we can have the Action generate a |
Now that we use a more complex build command in netlify (which is specified in netlify.toml), this is no longer correct. See #227.
We use the github-metadata gem to provide a few things to Jekyll like the repository name (used by Netlify CMS config) and the 'Edit on GitHub' links. We may be able to get it working on Netlify; alternatively, we'll have to remove the dependency on the gem.
Detected issues:
site.github.source.branch
resolves togh-pages
ineditor/index.html
absolute_url
filter returns nil ineditor/index.html
editor/index.html
setslocal_backend
totrue
becauseJEKYLL_ENV
env var is not set toproduction
. Setting it toproduction
breaks the build because the github-metadata gem no longer falls back to the git remote origin to detect repository information, but instead expects the git repo passed to thePAGES_REPO_NWO
env var in the format ofowner/repo
. Netlify's built-in env vars only include the full repo url.JEKYLL_ENV
toproduction
makes the github-metadata gem setsite.url
tohttps://github.com/pages/<owner>/<repo>
for some reason{{ github-edit-link }}
tag uses default branch of upstream repo instead of whatever branch of the fork was deployedIdeas so far:
PAGES_REPO_NWO=$(sed . . . $REPOSITORY_URL) jekyll build
_config_override.yml
at build time file and change the build command innetlify.toml
tojekyll build --config _config.yml,_config_override.yml
The text was updated successfully, but these errors were encountered: