Skip to content
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

Could use_github_pages() turn on GitHub Pages? #224

Closed
charliejhadley opened this issue Jan 22, 2018 · 5 comments · Fixed by #1271
Closed

Could use_github_pages() turn on GitHub Pages? #224

charliejhadley opened this issue Jan 22, 2018 · 5 comments · Fixed by #1271
Labels
feature a feature request or enhancement git git, GitHub, and CI in general

Comments

@charliejhadley
Copy link
Contributor

There is already support for use_github_labels in usethis, it would be great to programmatically turn on GitHub Pages for a repo without having to visit the settings page.

use_github_pages(source.branch = "master")
# Your site is published at https://username.github.io/repo

If the provided source.branch cannot be found then return the following error (a la http://style.tidyverse.org/error-messages.html#hints):

use_github_pages(source.branch = "not-a-real-branch")
#> Can't find branch 'not-a-real-branch' in the list of branches for GitHub repo 'my-repo'.
#> Refer to https://github.com/username/my-repo/settings for further settings.
@jennybc
Copy link
Member

jennybc commented Jan 22, 2018

I see this:

https://developer.github.com/v3/repos/pages/#pages

It's not immediately clear to me if activation via API is possible.

More docs:

https://help.github.com/categories/github-pages-basics/

@jennybc jennybc added the feature a feature request or enhancement label Jan 22, 2018
@jennybc jennybc changed the title Feature Request: use_github_pages to activate GitHub Pages building Could use_github_pages() turn on GitHub Pages? Feb 26, 2018
@hadley
Copy link
Member

hadley commented Nov 24, 2018

Given this only needs to happen once per repo, and there are options that might differ from package to package, I don't think it's a good fit for usethis.

@hadley hadley closed this as completed Nov 24, 2018
@krlmlr
Copy link
Member

krlmlr commented Sep 3, 2020

Seems we can turn on via https://docs.github.com/en/rest/reference/repos#update-information-about-a-github-pages-site. use_github_pages() would:

Saves a lot of clicks, even if it's done only once. Could also help existing repositories.

@hadley
Copy link
Member

hadley commented Sep 3, 2020

Yeah, that seems reasonable, although I'd make use_github_pages() a simple function that just sets pages status, and then move the other logic in use use_pkgdown() (adding a url argument).

@hadley hadley reopened this Sep 3, 2020
@hadley
Copy link
Member

hadley commented Sep 4, 2020

And should also add url to front of Url field in DESCRIPTION

@jennybc jennybc added this to the v2.0.0 milestone Oct 28, 2020
@jennybc jennybc added the git git, GitHub, and CI in general label Oct 29, 2020
jennybc added a commit that referenced this issue Nov 11, 2020
jennybc added a commit that referenced this issue Nov 12, 2020
jennybc added a commit that referenced this issue Nov 12, 2020
jennybc added a commit that referenced this issue Nov 12, 2020
* Introduce use_github_pages()

Closes #224

* CNAME details

* Logo modernization

* Introduce use_tidy_pkgdown()

* Might as well update use_pkgdown_travis()

* Update pkgdown config

* Fix an Rd link

* Another Rd link

* Work on docs, soften `path` enforcement

* Tweaks based on more manual testing

* Suggestions from code review

* Update WORDLIST

* Re-document()

* Rework handling of CNAME

* Tweaks re: editing pkgdown config

* Return site metadata

* Don't expose cname/URL stuff in use_tidy_pkgdown()

* Update WORDLIST

* Polishing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement git git, GitHub, and CI in general
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants