Giter Site home page Giter Site logo

jekyll / github-metadata Goto Github PK

View Code? Open in Web Editor NEW
274.0 274.0 125.0 538 KB

Jekyll plugin to propagate the `site.github` namespace and set default values for use with GitHub Pages.

Home Page: https://jekyll.github.io/github-metadata/

License: MIT License

Ruby 88.67% Shell 1.49% HTML 2.51% JavaScript 7.33%
github jekyll jekyll-plugin octokit ruby

github-metadata's Introduction

Gem Version Linux Build Status Windows Build status Backers on Open Collective Sponsors on Open Collective

Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind GitHub Pages, which you can use to host sites right from your GitHub repositories.

Philosophy

Jekyll does what you tell it to doΒ β€” no more, no less. It doesn't try to outsmart users by making bold assumptions, nor does it burden them with needless complexity and configuration. Put simply, Jekyll gets out of your way and allows you to concentrate on what truly matters: your content.

See: https://jekyllrb.com/philosophy

Getting Started

Diving In

Need help?

If you don't find the answer to your problem in our docs, or in the troubleshooting section, ask the community for help.

Code of Conduct

In order to have a more open and welcoming community, Jekyll adheres to a code of conduct adapted from the Ruby on Rails code of conduct.

Please adhere to this code of conduct in any interactions you have in the Jekyll community. It is strictly enforced on all official Jekyll repositories, websites, and resources. If you encounter someone violating these terms, please let one of our core team members know and we will address it as soon as possible.

Credits

Sponsors

Support this project by becoming a sponsor. Your logo will show up in this README with a link to your website. Become a sponsor! Jekyll Sponsor 0 Jekyll Sponsor 1 Jekyll Sponsor 2 Jekyll Sponsor 3 Jekyll Sponsor 4 Jekyll Sponsor 5 Jekyll Sponsor 6 Jekyll Sponsor 7 Jekyll Sponsor 8 Jekyll Sponsor 9

Contributors

This project exists thanks to all the people who contribute. Jekyll Contributors

Backers

Thank you to all our backers! πŸ™ Become a backer

Jekyll Backers

License

See the LICENSE file.

github-metadata's People

Contributors

9bow avatar ashmaroli avatar at-ishikawa avatar benbalter avatar cmbuckley avatar crunch09 avatar dependabot[bot] avatar dirtyf avatar dunkmann00 avatar filbranden avatar fingolfin avatar gicodewarrior avatar jamesmgreene avatar jdennes avatar jekyllbot avatar kenyonj avatar lardieri avatar mattr- avatar michaelcurrin avatar mlinksva avatar mrmanc avatar njt1982 avatar parkr avatar pilabio avatar satoryu avatar shegox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-metadata's Issues

Confusing message

Running this gem on a GitLab repo results in a strange error in the job log

   GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
   GitHub Metadata: Error processing value 'url':
  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. in /_layouts/base.html

For starters, url doesnt appear in https://gitlab.com/ciptamedia/ciptamedia-dev.gitlab.io/blob/8c6277532f/_layouts/base.html

I believe this is happening because this gem is trying to set site.url as it isnt set in the _config.yml. I also deploy to Netlify, and using https://github.com/jayvdb/jekyll-netlify to set the site.url on that platform, but nothing sets it on GitLab.

Add `site.github.public_repositories[].contributors` - contributors to each public repo

Right now the key contributors_url of the key public_repositories contains for example https://api.github.com/repos/bullgit/fuck-jquery/contributors. In that url we get something like this

[
  {
    "login": "Haroenv",
    "id": 6270048,
    "avatar_url": "https://avatars.githubusercontent.com/u/6270048?v=3",
    "gravatar_id": "",
    "url": "https://api.github.com/users/Haroenv",
    "html_url": "https://github.com/Haroenv",
    "followers_url": "https://api.github.com/users/Haroenv/followers",
    "following_url": "https://api.github.com/users/Haroenv/following{/other_user}",
    "gists_url": "https://api.github.com/users/Haroenv/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/Haroenv/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/Haroenv/subscriptions",
    "organizations_url": "https://api.github.com/users/Haroenv/orgs",
    "repos_url": "https://api.github.com/users/Haroenv/repos",
    "events_url": "https://api.github.com/users/Haroenv/events{/privacy}",
    "received_events_url": "https://api.github.com/users/Haroenv/received_events",
    "type": "User",
    "site_admin": false,
    "contributions": 68
  },
  {
    "login": "dervondenbergen",
    "id": 2054024,
    "avatar_url": "https://avatars.githubusercontent.com/u/2054024?v=3",
    "gravatar_id": "",
    "url": "https://api.github.com/users/dervondenbergen",
    "html_url": "https://github.com/dervondenbergen",
    "followers_url": "https://api.github.com/users/dervondenbergen/followers",
    "following_url": "https://api.github.com/users/dervondenbergen/following{/other_user}",
    "gists_url": "https://api.github.com/users/dervondenbergen/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/dervondenbergen/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/dervondenbergen/subscriptions",
    "organizations_url": "https://api.github.com/users/dervondenbergen/orgs",
    "repos_url": "https://api.github.com/users/dervondenbergen/repos",
    "events_url": "https://api.github.com/users/dervondenbergen/events{/privacy}",
    "received_events_url": "https://api.github.com/users/dervondenbergen/received_events",
    "type": "User",
    "site_admin": false,
    "contributions": 58
  },
...
]

It could be beneficial if this data is also returned by github-metadata

repo detection does not work with github enterprise

steps to reproduce:
Given a repo has a remote origin of https://ghe.mycompany.com/proj/repo

  1. do not specify a value for the env var PAGES_REPO_NWO
  2. do not specify a value for the site config repository
  3. set the env var PAGES_GITHUB_HOSTNAME to https://ghe.mycompany.com

running jekyll serve fails with error:

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. in /_layouts/default.html

expected results:
automatic detection of the repo name with owner should support reading from a github enterprise origin. It currently only supports origins of github.com
https://github.com/jekyll/github-metadata/blob/master/lib/jekyll-github-metadata/repository_finder.rb#L68

repositories that contain a period are parsed incorrectly

With the following Git remote:

$ git remote -v
origin  https://github.com/afeld/hackerhours.org.git (fetch)
origin  https://github.com/afeld/hackerhours.org.git (push)

{{ site.github.repository_url }} renders https://github.com/afeld/hackerhours, without the .org. Thanks!

Default PAGES_ENV should be development, not dotcom

So that when run locally, with no additional configuration, it works as expected, and in production, a more sophisticated environment, where it's easier to pass configuration variables, it can be overridden.

Required Oauth scopes

Hi, what are the required OAuth scopes to get all the site.github.* vars working ?

warning on non existing organization url

Hi all

I run bundle exec jekyll serve --verbose and i get in the trace:
GitHub Metadata: Initializing...
GitHub Metadata: Generating for david-gang/david-gang.github.io
GitHub Metadata: Calling @client.pages("david-gang/david-gang.github.io", {})
GitHub Metadata: Generating for david-gang/david-gang.github.io
GitHub Metadata: Calling @client.pages("david-gang/david-gang.github.io", {})
GitHub Metadata: Calling @client.contributors("david-gang/david-gang.github.io")
GitHub Metadata: Calling @client.contributors("david-gang/david-gang.github.io")
GitHub Metadata: Calling @client.repository("david-gang/david-gang.github.io")
GitHub Metadata: Calling @client.repository("david-gang/david-gang.github.io")
GitHub Metadata: Calling @client.organization("david-gang")
GitHub Metadata: GET https://api.github.com/orgs/david-gang: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: Calling @client.organization("david-gang")
GitHub Metadata: GET https://api.github.com/orgs/david-gang: 404 - Not Found // See: https://developer.github.com/v3
GitHub Metadata: Calling @client.list_repos("david-gang", {"type"=>"public"})
GitHub Metadata: Calling @client.list_repos("david-gang", {"type"=>"public"})
GitHub Metadata: Calling @client.releases("david-gang/david-gang.github.io")
GitHub Metadata: Calling @client.releases("david-gang/david-gang.github.io")

I don't understand why it tries to acess:
https://api.github.com/orgs/david-gang
It should be
https://api.github.com/users/david-gang

If this is ok that the organization page does not exist it should not write an error message.
Is this a misconfiguration on my side or a defect

I asked this question in jekyll talk but no one answered me
https://talk.jekyllrb.com/t/github-metadata-not-found-it-think-that-i-am-an-organization/3417

so i assume it is a defect
Thanks,
David

Time for a new release

Hello, maintainers! πŸ‘‹

By my calculations, it's time for a new release of github-metadata. It's been over 2 months since the last release, v2.9.3.

What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.

Thanks! πŸ’ž ✨

Silently setting site.baseurl breaks htmlproofer

PR #76 implemented code that silently sets site.url and site.baseurl if site.baseurl is "unset:" and JEKYLL_ENV="production":

        # Set `site.url` and `site.baseurl` if unset and in production mode.
        if Jekyll.env == "production"
          site.config["url"] ||= drop.url
          site.config["baseurl"] = drop.baseurl if site.config["baseurl"].to_s.empty?
        end

Per the Jekyll docs on continuous integration, I'm running htmlproof. I'd like to validate using JEKYLL_ENV="production", using the following script:

#!/usr/bin/env bash
set -e # halt script on error

# set environment for production builds
PAGES_REPO_NWO="information-safety/information-safety.github.io" \
JEKYLL_ENV="production" \
bundle exec jekyll build
bundle exec htmlproofer --check-favicon --check-html --check-opengraph ./_site

Since site.baseurl is set as "" in my _config.yml, executing this script changes the site.baseurl to /pages/information-safety which causes breakage in site generation and htmlproofer:

Running ["ScriptCheck", "OpenGraphCheck", "LinkCheck", "FaviconCheck", "ImageCheck", "HtmlCheck"] on ["./_site"] on *.html... 


Checking 25 external links...
Ran on 11 files!


- ./_site/2015/11/20/information-safety-launch/index.html
  *  internal image /pages/information-safety/public/iso-7010-w001.svg does not exist (line 24)
  *  internally linking to /pages/information-safety/, which does not exist (line 36)
     <a href="/pages/information-safety/">Blog</a>
  *  internally linking to /pages/information-safety/, which does not exist (line 27)
     <a href="/pages/information-safety/" title="Home">Infomation Safety</a>
  *  internally linking to /pages/information-safety/2015/11/21/stamp-stpa-2016/, which does not exist 
(line 84)
... snip ...
htmlproofer 3.4.0 | Error:  HTML-Proofer found 142 failures!

I've been trying to find a workaround to disable the github-metadata gem but haven't found it. Building with JEKYLL_ENV="production" used to work for me before GitHub added github-metadata to the github-pages dependencies.

Add ability to retrieve contributors to a page

We can get all of the contributors to the repository, but it would be really nice if there were a way to retrieve all of the contributors to a page as well. That would allow the contributors to be shown, for example, on an individual blog post. This is similar to what GitHub already shows when browsing the code for a file.

Public Repos (and other collections) only have first 30 results?

In my markdown files, I am trying to display the names of all public repositories for a particular organization, but it appears that the collection values available in site.github only contain 30 entries (likely based on the API's spec that says it [by default] only returns 30).

{% for repository in site.github.public_repositories %}
        <li>{{ repository.full_name }}</li>
{% endfor %}

Is there anyway to access more than 30? Or what is the common approach for paginating these results? Is it something I do in Liquid or do I need to write some Ruby, etc.?

I am having a hard time finding information about this because "paginating" already has some relevance as Jekyll feature.

Thanks

Time for a new release

Hello, maintainers! πŸ‘‹

By my calculations, it's time for a new release of github-metadata. It's been over 2 months since the last release, v2.9.4.

What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.

Thanks! πŸ’ž ✨

Potential error when github-metadata and jekyll-redirect-from are used on the same site

When a site includes both github-metadata and jekyll-redirect-from on the same site, it seems that the two gems can interfere and cause build errors.

The error occurs when a site includes the GH metadata gem and builds any page that contains a redirect_from attribute in the frontmatter. The full error text and trace are linked to below; long story short, the redirect gem is getting something of type Jekyll::GitHubMetadata::Value and attempting to join() it with a string.

I can repro this on both Windows and Ubuntu (clean install) using my test repo here. I also have a full terminal session log from initial boot of a new Ubuntu VM to the site build throwing errors that you can see here. The latter link includes the full error trace.

It seems that this is somewhat environment-dependent, as I can repro it on some machines but not others. But given that this happens on a completely empty VM, I can be pretty sure that the problem is not isolated to something specific to my PCs.

Make it easier to use GitHub metadata with GitHub Enterprise

Right now, if I want to use this plugin with GitHub Enterprise, it looks like I need to set the following environmental variables:

  • JEKYLL_GITHUB_TOKEN - unavoidable
  • SSL - this should be detected from another variable's scheme
  • OCTOKIT_WEB_ENDPOINT -
  • OCTOKIT_API_ENDPOINT and PAGES_API_URL -
  • PAGES_PAGES_HOSTNAME and PAGES_GITHUB_HOSTNAME - oddly named, should be determined from Enterprise hostname
  • PAGES_ENV - should be development, should not require "enteprise" as it does now

Not documented, but I may also need to set:

  • SUBDOMAIN_ISOLATION

Instead, I should set:

  • JEKYLL_GITHUB_TOKEN
  • PAGES_ENDPOINT (or something similar)
  • (and if necessary) SUBDOMAIN_ISOLATION

From there, the plugin should pull SSL from the scheme, set Octokit's endpoint, know the API endpoint /api/v3/, know the Pages hostname, and should default the env to development.

In any event, right now, it's really painful to use this Gem with Enterprise, so the documentation could use a bit of ❀️.

*.github.com domains should have a HTTPS scheme, not HTTP

Perhaps the repo can have an HTTPS flag, which would look to the CNAME, but could be later expanded to look for other conditions.

To note, github_repo? is necessary, but not sufficient, as for example, choosealicense.com is not HTTPS.

Problem when adding github-pages gem into a group

If github-pages gem is inside a group (gem "github-pages", group: :jekyll_plugins) I get an error on this gem: No GitHub API authentication could be found. Some fields may be missing or have incorrect data. Also, because of this, build time is way longer.

Here is the full log:

[2016-09-04 15:36:41] INFO  WEBrick 1.3.1
[2016-09-04 15:36:41] INFO  ruby 2.3.1 (2016-04-26) [x86_64-linux]
[2016-09-04 15:36:41] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[2016-09-04 15:36:41] DEBUG unmount .
[2016-09-04 15:36:41] DEBUG Jekyll::Commands::Serve::Servlet is mounted on .
    Server address: http://127.0.0.1:4000/
[2016-09-04 15:36:41] INFO  WEBrick::HTTPServer#start: pid=9315 port=4000
  Server running... press ctrl-c to stop.
      Regenerating: 1 file(s) changed at 2016-09-04 15:36:46    GitHub Metadata: Initializing...
   GitHub Metadata: Generating for tanoabeleyra/olioli
   GitHub Metadata: Generating for tanoabeleyra/olioli
   GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
   GitHub Metadata: Calling @client.contributors("tanoabeleyra/olioli")
   GitHub Metadata: Calling @client.contributors("tanoabeleyra/olioli")
   GitHub Metadata: Calling @client.repository("tanoabeleyra/olioli")
   GitHub Metadata: Calling @client.repository("tanoabeleyra/olioli")
   GitHub Metadata: Calling @client.organization("tanoabeleyra")
   GitHub Metadata: Calling @client.organization("tanoabeleyra")
   GitHub Metadata: Calling @client.list_repos("tanoabeleyra", {"type"=>"public"})
   GitHub Metadata: Calling @client.list_repos("tanoabeleyra", {"type"=>"public"})
   GitHub Metadata: Calling @client.releases("tanoabeleyra/olioli")
   GitHub Metadata: Calling @client.releases("tanoabeleyra/olioli")
   GitHub Metadata: Calling @client.pages("tanoabeleyra/olioli", {})
   GitHub Metadata: Calling @client.repository?("tanoabeleyra/tanoabeleyra.github.io")
   GitHub Metadata: Calling @client.repository?("tanoabeleyra/tanoabeleyra.github.com")
   GitHub Metadata: Calling @client.pages("tanoabeleyra/olioli", {})
   GitHub Metadata: Calling @client.repository?("tanoabeleyra/tanoabeleyra.github.io")
   GitHub Metadata: Calling @client.repository?("tanoabeleyra/tanoabeleyra.github.com")
        Generating: Jekyll::GitHubMetadata::GHPMetadataGenerator finished in 17.858106224 seconds.
        Generating: Jekyll::Paginate::Pagination finished in 1.6086e-05 seconds.

Improve error message if git not in path

On a windows box that does not have git on the path (standard github desktop install), running jekyll build resulted in the following error:

D:\github\rajsite.github.io>jekyll build
Configuration file: D:/github/rajsite.github.io/_config.yml
            Source: D:/github/rajsite.github.io
       Destination: D:/github/rajsite.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
jekyll 3.0.5 | Error:  No such file or directory - git remote --verbose

Adding the verbose flag gave a little more context

D:\github\rajsite.github.io>jekyll build --verbose
  Logging at level: debug
Configuration file: D:/github/rajsite.github.io/_config.yml
      GitHub Pages: github-pages v78
      GitHub Pages: jekyll v3.0.5
     PluginManager: Requiring jekyll-paginate
     PluginManager: Requiring jekyll-coffeescript
     PluginManager: Requiring jekyll-gist
     PluginManager: Requiring jekyll-github-metadata
            Source: D:/github/rajsite.github.io
       Destination: D:/github/rajsite.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
           Reading: _posts/2016-03-08-example-post.md
           Reading: _posts/2016-03-13-my-new-post.md
         Generator: Calling GHPMetadataGenerator
jekyll 3.0.5 | Error:  No such file or directory - git remote --verbose

Some light Googling landed here:

# Public: fetches the repository name with owner to fetch metadata for.
# In order of precedence, this method uses:
# 1. the environment variable $PAGES_REPO_NWO
# 2. 'repository' variable in the site config
# 3. the 'origin' git remote's URL
#
# site - the Jekyll::Site being processed
#
# Return the name with owner (e.g. 'parkr/my-repo') or raises an
# error if one cannot be found.

And the going back to the project root I saw the ability to add repository: username/repo-name to config and all was well: https://github.com/jekyll/github-metadata/tree/4b94b3693ca40ae3583e7f3e389e6d83e35e66b7#usage

A nicer error message may have saved a few steps :)

Access both user and organisation metadata

I was wondering if it was possible to list both a user's and an organisation's metadata? Currently it seems like one can only list one of them and not both.

I use it to list all my personal repositories and would like to list the ones in my organisation as well.

For now I have worked around it by loading the organisation's repositories using javascript: Lauszus/lauszus.github.io@3f8cb39.

Enterprise-specific Values

Hey @benbalter!

So for things like hostname, how would you like this program to fetch those? ENV vars? Hypothetically we can write in enterprise? ? 'ghe.io' : 'github.com' but that doesn't give very much flexibility.

The variables that are custom based on the env are:

  • hostname
  • pages_hostname
  • api_url
  • environment

How do you want this public code to handle that stuff?

Test: Say I create an issue...

Say I create an issue. One of the maintainers has replied to me and assigned the "pending feedback" label to notify others that my issue requires more information from me.

Right now, if I comment back, the label is not removed. The signal is lost.

I just taught @jekyllbot to unlabel. This is a test issue.

Project sites for users with custom domains return the default domain

I have benbalter/benbalter.github.com cname'd to ben.balter.com. When used to build benbalter/benbalter.github.com, I properly get http://ben.balter.com for site.url.

If I also have benbalter/project-site, with no CNAME, the site is published at http://ben.balter.com/project-site, however, site.url is generated as http://benbalter.github.io/project-site.

For sites without CNAMEs, we'll need to check for username/username.github.(io|com)'s cname, if any. It may make sense to update the Page API to return the page's domain (and potentially full URL) in all cases.

Docs: use plugins config key

πŸ†•πŸ₯☝ First Timers Only.

This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you πŸ’

About First Timers Only.

πŸŽƒπŸ’»πŸ‘• Hacktoberfest: Trick or Treat!

If you haven’t yet, sign up for Hacktoberfest to earn an exclusive T-Shirt. Plus I’m sure we can teach you a cool trick or two in the process

πŸ€” What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

πŸ“‹ Step by Step

  • πŸ™‹ Claim this issue: Comment below.

    Once claimed we add you as contributor to this repository.

  • πŸ‘Œ Accept our invitation to this repository. Once accepted, assign yourself to this issue

  • πŸ“ Update the file README.md in the github-metadata repository (press the little pen Icon) and edit the line as shown below.

@@ -10,15 +10,18 @@ Access `site.github` metadata anywhere (...you have an internet connection).
 Usage of this gem is pretty straight-forward. Add it to your bundle like this:
 
 ```ruby
-gem 'jekyll-github-metadata'
+gem "jekyll-github-metadata"

Now add it to your _config.yml:

-gems: ['jekyll-github-metadata']
+plugins:
+  - "jekyll-github-metadata"

+:warning: If you are using Jekyll < 3.5.0 use the gems key instead of plugins.
+
Then go ahead and run bundle install. Once you've done that jekyll-github-metadata will run when you run Jekyll.

In order for jekyll-github-metadata to know what metadata to fetch it must



- [ ] πŸ’Ύ **Commit** your changes

- [ ] πŸ”€ **Start a Pull Request**. There are two ways how you can start a pull request:

1. If you are familiar with the terminal or would like to learn it, [here is a great tutorial](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) on how to send a pull request using the terminal.

2. You can [edit files directly in your browser](https://help.github.com/articles/editing-files-in-your-repository/)

- [ ] 🏁 **Done** Ask in comments for a review :)

### πŸ€”β“ Questions

Leave a comment below!


This issue was created by [First-Timers-Bot](https://github.com/hoodiehq/first-timers-bot).

Branch point to gh-pages on user pages

After change my layouts to use i see the the url generated point to the gh-pages branch, than not exist.

My blog is a user blog and only contains master as relevant branch.

I can't see in the documentation how set up the branch

Failure to use remote info in repo cloned from GitHub Enterprise.

Running Jekyll on a GitHub Pages compatible site (e.g. documentation-theme-jekyll) fails with this error message ** even when there is an origin remote defined **.

             Error: 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.
$ git remote -v
origin	git@<elided>.com:<elided>/computing-portal.git (fetch)
origin	git@<elided>.com:<elided>/computing-portal.git (push)

This happens because around line 103 of metadata_drop.rb this snippet of code tries to match the "url" (it's not a URL, but that's another issue...) against a pattern that's hardwired for the public github.

matches = git_remote_url.chomp(".git").match %r!github.com(:|/)([\w-]+)/([\w\.-]+)!

One fix would be to use a library like git-remote-parser and combine it's owner and repo attributes.

If there's an objection pulling in the entire gem, one could either borrow bits (in a way that honor'ed its MIT license) or reimplement them.

Can someone comment on the following?

  • Is there any effort to make this gem more useful GitHub Enterprise customers (in which case this issue could tag along on that effort)?

  • Would a PR with a fix that used git-remote-parser be acceptable?

  • Failing the above, what constraints are there on coding up a fix?

Thanks!

Fail gracefully without network access

Currently, trying to bundle exec jekyll serve a page not even using jekyll-github-metadata fails, because the jekyll-github-metadata plugin is (unconditionally, afaict) pulled in as a dependency of github-pages.

The failure mode is like this:

% bundle exec jekyll serve       
Configuration file: /home/user/qubesos.github.io/_config.yml
Configuration file: /home/user/qubesos.github.io/_config.yml
            Source: /home/user/qubesos.github.io
       Destination: /home/user/qubesos.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 9.53 seconds.
 Auto-regeneration: enabled for '/home/user/qubesos.github.io'
Configuration file: /home/user/qubesos.github.io/_config.yml
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
      Regenerating: 1 file(s) changed at 2016-12-11 08:05:11    GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No route to host - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No route to host - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No route to host - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No route to host - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No route to host - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No route to host - connect(2) for "api.github.com" port 443)

See also: github/pages-gem#364

Github metadata out of date

I'm using Jekyll/github-metadata to populate projects on my personal website hosted on Github Pages,
gkiar.github.io, and notice that the metadata is almost permanently out-of-date.

Is there a workaround for this?

Option to disable GitHub metadata when running locally

We use Jekyll to build documentation locally using the github-pages gem. We often don't need Github metadata and the warnings or errors often throw our content writers.

Is it possible to provide a way of disabling Github metadata so that the warnings don't appear on local builds?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.