Hugo configuration and theme for Hacks/Hackers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
themes/hackshackers-2017
.gitignore
.gitmodules
README.md
config.yml
convert-https.js
import-groups-csv.js
init-hugo-lunr.js
package.json

README.md

Hacks/Hackers

Overview

This site is built using Hugo, a static site generator written in Go.

This is the "main" repository, containing general site configuration, sample content, and the hackshackers-2017 theme. The theme contains all of the templates, CSS, and JS files.

All of the site's content pages are generated from Markdown files in hackshackers-hugo-content. Think of that repository as the database.

Setup

Install Hugo

Install Hugo if you haven't already.

The current production build uses v0.42.1. If your local build fails, use $ hugo version to see what's currently installed on your machine and upgrade if needed. If you can't get it to work, let us know!

Download the content

cd into the root of this repository and download the content into a directory called content:

$ cd hackshackers-hugo
$ git clone https://github.com/hackshackers/hackshackers-hugo-content.git content

Run a local dev site

$ hugo serve

This command starts the local Go server. It will watch for changes and reload the page in your browser. You'll see a message like:

Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)

Working with site assets

We use Webpack to "bundle" CSS and JavaScript files.

$ cd themes/hackshackers-2017
$ npm install
$ npm start

This will start Webpack and watch for changes in themes/hackshackers-2017/webpack-src/. Files in this directory should not be loaded directly; we use them only as to create the Webpack bundle.

themes/hackshackers-2017/static/ contains assets that can be referenced directly by HTML pages:

  • js/ - compiled Webpack files and other JS
  • images/ - images that belong to the theme (not content images
  • svg/ - SVG assets
  • other stuff as needed

Each of these subdirectories of themes/hackshackers-2017/static/ is copied to the root directory when a Hugo build happens. So you would include them with a root-relative URL like:

/themes/hackshackers-2017/static/images/work.png
...
<img src="/images/work.png">

Branching and pull requests

  1. Fork the repository
  2. Use hackshackers-hugo for updates to the Hugo site config and site theme.
  3. Use hackshackers-hugo-content to edit the content of existing pages or add new pages to the site.
  4. $ git checkout master && git pull origin master (ensures you have the latest updates)
  5. $ git checkout -b [my-feature-branch] (creates and checks out a new branch)
  6. Make your changes and test them locally
  7. $ git push origin [my-feature-branch]
  8. Go to GitHub and make a pull request to merge your changes into the master branch of hackshackers/hackshackers-hugo or hackshackers/hackshackers-hugo-content

Deployments

We have two development tiers to which we deploy automatically when new commits are received in a corresponding Github branch in hackshackers-hugo:

Branch Tier Usage
master hh-production
(hackshackers.com)
Restricted branch for the live site; this branch should only receive commits via pull request.
sandbox hh-sandbox This branch is never merged to master; use for testing unfinished work.

Deploying new/updated content

New commits on the master branch of hackshackers-hugo-content are automatically pulled into both the production and sandbox branches of hackshackers-hugo, which then deploy automatically to the production and sandbox tiers, respectively.