npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

docpad-plugin-ghpages

v2.8.0

Published

Deploy to Github Pages easily via `docpad deploy-ghpages`

Downloads

50

Readme

GitHub Pages Deployer Plugin for DocPad

Deploy to Github Pages easily via docpad deploy-ghpages

Usage

Project Pages

This plugin works with GitHub Pages for Projects (e.g. http://username.github.io/project via gh-pages branch on https://github.com/username/project) with no configuration or setup required.

Simply run docpad deploy-ghpages --env static to deploy the contents of your out directory directly to your repository's gh-pages branch.

Profile/Organisation Pages

This plugin also works with GitHub Pages for Profiles and Organisations (e.g. http://username.github.io via master branch on https://github.com/username/username.github.io) via any of the following options:

Two Repositories

Setup one repository called username.github.io which will be your target repository, and one called website which will be your source repository.

Inside your website repository, add the following to your docpad configuration file:

plugins:
	ghpages:
		deployRemote: 'target'
		deployBranch: 'master'

And run the following in terminal:

git remote add target https://github.com/username/username.github.io.git

Then when you run docpad deploy-ghpages --env static inside your website repository, the generated out directory will be pushed up to your target repository's master branch.

Multiple Branches

If you would like to have your source and generated site on the same repository, you can do this by the following.

Move the source of your website to the branch source, and the following to your docpad configuration file:

plugins:
	ghpages:
		deployRemote: 'origin'
		deployBranch: 'master'

Then when you run docpad deploy-ghpages --env static inside your website repository's source branch, the generated out directory will be pushed up to same repository's master branch.

Polluting the Root Directory

The final option is to not use this plugin and have the out directory be your website's root directory, so instead of say your-website/src/documents/index.html being outputted to your-website/out/index.html, instead it will be outputted to you-website/index.html. This is the way Jekyll works, however we don't recommend it as it is very messy and commits the out files into your repository.

To do this, add the following to your docpad configuration file:

outPath: '.'

Custom Domains

If you're using GitHub Pages Custom Domains:

  • Place your CNAME file at src/files/CNAME so it gets copied over to out/CNAME upon generation and consequently to the root of the gh-pages branch upon deployment
  • Use a DocPad version 6.48.1 or higher

Debugging

Depending on circumstances, the github pages plugin might not work and you'll see an error. You can debug this by running the deploy with the -d flag like so docpad deploy-ghpages -d. That will tell you at which step the deploy failed.

  • If the deploy fails fetching the origin remote, it means that you do not have the remote "origin", you will need to add it, or update the deployRemote setting to reflect your desired remote.

  • If the deploy fails on the push to github pages, you may need to specify your username and password within the remote. You can do this by running:

    node -e "console.log('https://'+encodeURI('USERNAME')+':'+encodeURI('PASSWORD')+'@github.com/REPO_OWNER/REPO_NAME.git')"

    Replace the words in capitals with their actual values and press enter. This will then output the new remote URL, you then want to copy it and run git remote rm origin and git remote add origin THE_NEW_URL and try the deploy again.

    On OSX you may be able to avoid this step by running git config --global credential.helper osxkeychain to tell git to save the passwords to the OSX keychain rather than asking for them every single time.

  • If you get EPERM or unlink errors, it means that DocPad does not have permission to clean up the git directory that it creates in the out folder. You must clean this up manually yourself by running rm -Rf ./out/.git

Install this DocPad plugin by entering docpad install ghpages into your terminal.

Discover the release history by heading on over to the HISTORY.md file.

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

These amazing people are maintaining this project:

No sponsors yet! Will you be the first?

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Unless stated otherwise all works are:

and licensed under: