GithubHelp home page GithubHelp logo

matheusrocha89 / wercker-step-hugo-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arjenschwarz/wercker-step-hugo-build

0.0 2.0 1.0 57 KB

Wercker Step for building Hugo sites

Shell 100.00%

wercker-step-hugo-build's Introduction

Wercker Step Hugo Build

wercker status

This step will download the specified version of Hugo and run this over the source code to generate the static version of your site. This can then automatically be deployed using other steps.

Since version 1.9.0, the step has the latest two versions of Hugo already installed thereby skipping the download part of the step.

Tutorial

If you are new to Wercker, there is a full tutorial on how to use this step in combination with an automatic deployment step in the Hugo documentation.

Requirements

This step does not require any specific Wercker box or container, and should work on both the classic and Docker versions.

Parameters

version (optional/recommended)

Specifies the version of Hugo to be used, by default this is "0.17". It is recommended to set this, so you don't accidentally build you site with a version it isn't ready for. Due to Wercker not being able to properly handle 0.x version numbers, you will need to put quotes around the version number.

Note that you don't have to provide a version if you already have Hugo installed. If you wish to install a specific version regardless of what is running on your container, you can override this using the force_install parameter.

HEAD support

New in version 1.8 is support for the HEAD version. This will pull in the latest version from GitHub and compile it. This requires you to provide the version as below. Take note that this means using a version of Hugo that is not released and might be unstable, so use this at your own risk.

box: golang:latest
build:
  steps:
    - arjen/hugo-build:
        version: "HEAD"

theme (optional)

Specifies the theme to be used for the generation of the site. When this isn't defined no theme will be used.

config (optional)

If you wish to use a different config file than the default config.toml|yaml|json you can provide the relative path and name of this file here.

flags (optional)

Apart from the theme and config file, other flags can be provided as a single string. These flags will be provided exactly as set.

force_install (optional)

If you already have Hugo installed in your container, this step will use the installed version. To override this behaviour, set force_install to true.

disable_pygments (optional)

If you don't need support for pygments, you can speed up the build process by not installing it. Set disable_pygments to true to disable support for pygments.

dev_flags, prod_branches and dev_branches (optional)

These 3 optional parameters allow you to use different build flags for production and development branches. This setting will override the config, flags and theme parameters in builds on your development branches.

basedir (optional)

The basedir flag allows you to set a different directory than the root of the project as your Hugo source directory.

How does it work?

First, set dev_flags to the flags you would like to use for your development branches. Your production branches will still use config, flags and theme.

Next, set either prod_branches or dev_branches.

prod_branches should contain a space delimited list of branches that you would like to mark as production branches.

dev_branches should contain a space delimited list of branches that you would like to mark as development branches.

E.g. with git flow:

box: debian
build:
  steps:
    - arjen/hugo-build:
        version: "0.17"
        theme: redlounge
        config: my-production-config.toml
        dev_flags: -D -F
        prod_branches: master

Example wercker.yml (Docker)

box: debian
build:
  steps:
    - arjen/hugo-build:
        version: "0.17"
        theme: redlounge
        config: second-config.toml
        flags: --disableSitemap=true

Example wercker.yml (Classic)

box: wercker/default
build:
  steps:
    - arjen/hugo-build:
        version: "0.17"
        theme: redlounge
        config: second-config.toml
        flags: --disableSitemap=true

wercker-step-hugo-build's People

Contributors

arjenschwarz avatar sdebruyn avatar alrayyes avatar fale avatar jrbasso avatar sword42 avatar

Watchers

James Cloos avatar Matheus Cruz Rocha avatar

Forkers

xenoterracide

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.