GitHub Pages (ghpages) is a Drupal 7 module allowing users to add their content to a shared "gh-pages" branch, which can then be pushed to and hosted on GitHub.
Initially designed to allow seamless cloud-hosted visualizations for the forthcoming VizCloud Drupal distribution, it supplies a bit of functionality that isn't available anywhere else in the Drupal module ecosystem. As such, this makes it a good candidate to be released as a module unto itself.
There are two major reasons why saving nodes on GitHub is cool:
- With VizCloud, this means a user can generate a complex Views query to feed into a JavaScript-based interactive graphic, save that as a static version, and then serve that effortlessly without having to worry about optimizing a Drupal installation to accommodate high levels of traffic. Creating interactive graphics that can cope with excessive levels of traffic is a constant challenge for data journalists — this is one way around it.
- It provides a way for a basic Drupal installation to be used as an offline content creation and management tool (Somewhat like the FrontPages and Dreamweavers of yore) — users create content using a local installation, which is then hosted independently on GitHub Pages. This may be preferable in some situations where a user wants to leverage Drupal's advanced tools (Views, Panels, etc.) for a particular task, even if there's no possibility of that Drupal installation ever being used to host content itself (I.e., it's behind a corporate firewall).
Usage is simple: an admin configures a central repository, which gets added to every time a user with appropriate permissions clicks the big "Push to GitHub" button on the edit node page.
Some code is based off SaveToFTP -- http://drupal.org/project/savetoftp
Upcoming features
- User repos -- push to the shared central repo, or define a personal GitHub repo to push to.
- Integration with GitHub Connect.
Project Page: http://drupal.org/sandbox/aendrew/1914226
PAReview.sh results: http://ventral.org/pareview/httpgitdrupalorgsandboxaendrew1914226git
git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/aendrew/1914226.git github_pages
Many thanks!
Reviewed proposals
http://drupal.org/node/1857646#comment-7056904
http://drupal.org/node/1879654#comment-7057010
http://drupal.org/node/1358354#comment-7057482
Round two!
http://drupal.org/node/1927636#comment-7116274
http://drupal.org/node/1928682#comment-7120224
http://drupal.org/node/1909634#comment-7138714
Comments
Comment #0.0
aendra CreditAttribution: aendra commentedFixed link.
Comment #0.1
aendra CreditAttribution: aendra commentedadding PAReview stuff.
Comment #0.2
aendra CreditAttribution: aendra commentedAdded another review.
Comment #1
aendra CreditAttribution: aendra commentedAdding PAReview bonus tag...
Comment #2
JosefFriedrich CreditAttribution: JosefFriedrich commentedHallo Aendrew!
Congratulation to your very nice module!
1. The backup_migrate module is not listet in your README.txt file under Requirements. But it is a dependency for installation.
2. I would be very nice if your module throw out a message via drupa_set_message, if the file git.php is not installed or not in the right place.
3. Is there a way to remove this two module_load_include functions?
The two pages are loaded every time the module is invoced. So it makes no sense to split the ghpages.module. You reduce no load time.
One way i know is to use following line in the hook_menu function:
'file' => 'yourfile.inc',
Dear Josef Friedrich
Comment #3
JosefFriedrich CreditAttribution: JosefFriedrich commentedHallo aendrew!
Sorry I forgot:
It would be very nice, if you implement the hook_help() function. You can put in there same help text and the links to configuration pages.
Comment #4
aendra CreditAttribution: aendra commented@JosefFriedrich -- Thank you for the helpful review! I have:
Comment #5
PawelR CreditAttribution: PawelR commentedHi,
I believe you forgot to commit ghpages.admin.inc file, also you should implement hook_uninstall and delete variables your module creates.
Comment #6
aendra CreditAttribution: aendra commented@PawelR -- Ah, whoops! I've added that, as well as implemented hook_uninstall. Thanks for the note!
Comment #7
klausiThanks you for your nice reviews!
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #8
aendra CreditAttribution: aendra commentedMade changes:
1. Defines now have GHPAGES_ prefixed.
2. hook_menu updated to use the second permission ("administer save to github")
3. Unused $github_server var removed.
4. Superfluous check_plain calls removed.
5. ghpages_publish_form() and ghpages_publish_form_submit() documentation improved.
Comment #8.0
aendra CreditAttribution: aendra commentedAdded another review.
Comment #8.1
aendra CreditAttribution: aendra commentedadded more bonus links.
Comment #8.2
aendra CreditAttribution: aendra commentedadded another bonus review.
Comment #9
aendra CreditAttribution: aendra commentedDone another three reviews, re-adding tag.
Comment #10
tenken CreditAttribution: tenken commentedOh cool module! Here's my review.
Automated Review
No errors.
Manual Review
Most importanly this error message included my actual github password I supplied in the admin area on the screen as placetext. please dont do that in a status message
The "Couldnt resolve host" appeared to be using my password, instead of my github username.
Comment #11
tenken CreditAttribution: tenken commentedoops forgot to change status in #10.
Comment #12
aendra CreditAttribution: aendra commented@tenken -- Thanks for the feedback!
a. By your nitpick, you mean "the name of the module as it appears in the .info file"? I've changed that to ghpages.
b. Updated that bit of code to use $repo_name
c. re: ghpages.functions.inc -- I've never heard that, mind pointing me towards some documentation? Regardless, put most helper functions into their own file.
d. Notices are fixed now.
e. I do a check now and replace the password with asterisks if returned via an error.
Are you using the https:// version of the Git URL, and does the repo in question have a gh-pages branch? Should work if so! I've also added some validation to the admin form asking for the https:// version.
Comment #13
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
require_once 'mymodule.inc';
Comment #14
aendra CreditAttribution: aendra commented@Klausi -- Gah, forgot to add it. I've now pushed that file to the repo. I've also fixed the automated review notices. Mind looking at it again?
Comment #15
aendra CreditAttribution: aendra commentedComment #16
klausimanual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to Michelle as she might have time to take a final look at this.
Comment #17
jthorson CreditAttribution: jthorson commentedThanks for your contribution, aendrew!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #18
aendra CreditAttribution: aendra commentedTerrific! Thanks, jthorson! Huge thanks also to everyone who reviewed my project (JosefFriedrich, PawelR, klausi and tenken)!
Comment #19.0
(not verified) CreditAttribution: commentedadded another review