Documentation

Deploy

Depending on the version of CollectionBuilder you’re using, there are two ways to generate the site:

  • GH users will need to turn on the GitHub Pages option via the settings page of their repository on GitHub.com.

  • CDM and SA users will need to use a Jekyll command.

Both of these approaches are described below.


Enabling GitHub Pages

  1. In your GitHub account, click on the “Settings” button at the top right of your repository page
  2. When you’re on the settings page, scroll down to the “GitHub Pages” section.
  3. Change the “source” dropdown button from “none” to “main” (or “master” if that is your default branch) which will cause the page to refresh.
  4. Scroll back down to the GitHub Pages section. You’ll see a blue alert that indicates your website is being built.
  5. Wait a couple minutes, then refresh the page (or just refresh constantly). The alert will change to green when the site is ready. When it does, click on the URL that appears in the GitHub Pages box to check out your site!!!
  6. To make your site’s URL easy to access in the future, copy the site URL and go back to your repository’s main page.
  7. At the right-hand side of the top of the page, click on the “Edit” button.
  8. Add your copied URL to the website section and click “Save” – This will let you easily access the generated site whenever you come to edit the page.

Congratulations! Your site is now live. GH users can now move on to the Advanced Topics section.


1. Building the Site

So … Where are the files???!!!

Jekyll creates the web like it’s 1999, outputting a folder of HTML, CSS, and other static assets as a complete site–but on first using the generator, it’s hard to know where those files actually are and how you might move them to another server. Let’s lift the veil:

Jekyll outputs the complete website in a directory called “_site” while generating the files for development or for production. When you’re generating a test site using jekyll s on the commandline, Jekyll automatically builds all the pages with links based on the development server, by default using urls that start with http://127.0.0.1:4000/.

To build the site for production, you’ll need to bundle exec jekyll build instead. In contrast to the development server, bundle exec jekyll build generates the complete site using the real world URLs configured in your _config.yml.

However, CollectionBuilder only adds some features when the site is built using the Jekyll “production” environment (which is the default when generated on GitHub Pages). The environment can be added to the commandline, as JEKYLL_ENV=production bundle exec jekyll build, but to make it easier to use CollectionBuilder provides the rake deploy command as an alternative.

Build using “rake deploy”

When you are ready to build your site, go to your terminal and click CTRL C to stop the development server.

Then, type rake deploy into the terminal and push ‘Enter’ on your keyboard. This does three important things:

  1. It builds the site with the appropriate (full) links.
    • (so https://www.lib.uidaho.edu/digital/boxing/browse.html rather than http://127.0.0.1:4000/digital/boxing/browse.html)
  2. It add rich meta markup for items pages including Open Graph, Dublin Core, and Schema (as configured in config-metadata.csv).
  3. It adds Google Analytics code if you have added a google-analytics-id in the _config.yml file.
    • Waiting until final deployment to add the analytics prevents false hits on your analytics account.

2. Moving the _site Files to Your Web Server

Once you’ve completed the build process, the web files you need will all be in your _site directory.

  1. Open the _site directory using your file explorer or finder.
  2. Copy everything you’d like to move into a production site.
  3. Paste the copied files and folders into the directory on your web server you’d like to serve this site from.

Note: If you’d like to serve this up from a GitHub Pages enabled repository, that is also possible. Talk to us.


« Finish Back to Top Advanced Topics »