Contributing to devopsdays-web
This document contains the technical details on how to set up Hugo (to see your edits locally before pushing them to GitHub), and how to prepare a pull request to make changes to content on the devopsdays website.
If you'd like to assist in contributing to the code itself (as opposed to the content) of the website, please see the devopsdays-theme CONTRIBUTING guidelines.
If you'd like to edit a specific devopsdays event site (and/or contribute code), here's how to get started:
- Install Hugo. Use the Hugo version that we use in .circleci/config.yml file. (Quick Install) Examples of hugo installation with a version:
brew install email@example.com
brew install firstname.lastname@example.org
choco install hugo -confirm --version 0.67.1 --allow-downgrade
- Fork this repo and clone a copy locally.
View site locally
To watch for changes and rebuild on the fly, open a new terminal, change directories to your fork of the repo, and execute the following:
hugo server -w --baseUrl="http://localhost:1313"
http://localhost:1313 in a browser and navigate to the content that you're editing - voilà! Note: hugo's
watch is not going to catch every change, so if you're making structural/file or date changes, consider Control-C and restart of the
macOS Specific Issues
When running the
hugo server -w command listed above, you may get an error about "too many open files". To solve this, run the following commands in your terminal:
hugo check ulimit sudo sysctl -w kern.maxfiles=65536 sudo sysctl -w kern.maxfilesperproc=65536 ulimit -n 65536 65536
Note that these changes will not persist past a reboot of your computer, so you'll need to run them again if you restart.
Setting your fork up the first time
Make your own fork of the
Add the source repository as a remote called "upstream":
git remote add upstream email@example.com:devopsdays/devopsdays-web.git
git remote add upstream https://github.com/devopsdays/devopsdays-web.git
You only need to create your fork once, as long as you don't delete it.
Editing your site
- Before starting any new change, it is essential that you
rebaseyour local repository from the upstream. You may think that working from your fork is enough, but sometimes upstream changes will affect your work in ways you may not anticipate, so you'll want to stay current. Issue these commands:
git checkout master
git pull upstream master --rebase
This confirms you are on the master branch locally, and then applies the changes from the upstream to your copy.
- Create a new local branch for your changes. This helps to keep things tidy!
$ git checkout -b fix_that_thing
fix_that_thing with a quick description of your actual change.)
- Make your changes, test them locally (see above - the
watchcommand sometimes needs a restart), then push that branch up to
originon your fork.
$ git push origin fix_that_thing
- Submit a Pull Request for the branch you just pushed. Please title the pull request according to the event affected, i.e.,
[CHI-2017] Add Bluth Company as a sponsor
- Optionally, open your pull request in a browser and look at the preview that
Netlify(a build tool) built.
- You can mention on devopsdays Slack's #website if you'd like a PR merged quickly. (Availability of maintainers varies.)
- When a commit is merged to
masteron GitHub, Netlify will automatically build the site and publish it to https://www.devopsdays.org.
- Code changes for devopsdays-theme should be made in a different PR from event content updates.
- We use github issues to track work, so feel free to create new issues if you like (or read/comment/work on existing ones).
- If you are proposing a change that affects the overall site, and is not tied to an existing issue, please open a new issue so that it can be discussed by the team, prior to submitting a pull request.
- If you're using CRLF line terminators (like on Windows), the site won't build correctly if the first
+++line of frontmatter in speaker and program files ends in a space like
+++. The workaround is to remove the trailing space.
How Changes are Merged
- A maintainer will merge the PR if it is mergable, as soon as the checks pass.
- If you do not want your PR merged immediately, in most cases you should not open the PR.
- Our workflow guide provides solutions to most
WIPuse cases without opening a PR.
- Questions about specific cases not covered in the guide can be asked in the #website channel on devopsdays Slack.
- In general, only make changes to event content files. "Event content" means anything inside the
- Changes to event-specific content should be submitted in a separate PR from changes to more general content for the whole site.
Minimal large files
Generally speaking, you should avoid storing any files other than logos or small images inside the repo itself (out of consideration for your fellow devopsdays organizers who have to pull down this repo). Please follow these guidelines:
- Do not upload presentations or other artifacts from your event into this repo. Either link to the presentation on Speakerdeck/Slideshare from the presenter, or even better, create a Speakerdeck account for your event and put the presos there.
- Small web images are fine (logos, etc). If you have high-resolution versions of your logo to share with others, please do not host them on the devopsdays-web repo.
- It is acceptable to add in a single PDF for your sponsor prospectus if you desire (in
static/events/YYYY-city), but please keep this file under 3 MB. It is better to host it on Google Drive or something similar, and then link to it from your site.
- OPTIONAL - you can host your PDFs for prospectus, etc, in the repo at devopsdays/devopsdays-assets and then link to them from there. Files in that repo are presented under their relative URL at https://assets.devopsdays.org. For example, the file located at
devopsdays/devopsdays-assetsrepo will be presented at
If you have permissions to merge PRs on this repo, here are a few guidelines to consider:
- Is the requestor authorized to make changes for that event? They need to appear on the contact list for the year and city they're editing.
- Do not allow any PRs that change files outside of the above-mentioned "content" directories. Especially watch out for
config-windows.toml, and anything in the
themesdirectory. GitHub will require a review from certain maintainers/admins if specific non-content files/directories are included. See CODEOWNERS for specifics.
- Check to see if the tests pass, but use your judgement on merging something that fails (see "PR Tests" below for guidance)
- If you are unsure about merging a PR, please use the "request a review" button on the PR to request one from other maintainers.
- If you're reviewing all the details of a PR before merging or are communicating with the Submitter, add yourself to Assignees so that others know someone is waiting on a response or reviewing all the details of the PR thoroughly. Be sure to also add a comment into the PR that you are reviewing it, and if you need a change from the Submitter prior to merge, be sure to label the PR as
The following tests run when a PR is submitted:
- CircleCI - this test confirms that the site can be built with Hugo on linux, and it runs an
html-mingulp task which will identify if there is any invalid HTML in the site. This protects the final build, so if the CircleCI build or test jobs fail, please take a look as to why they failed.
- Appveyor - this test builds Hugo on Windows, to ensure that no Windows-incompatible files have been included. If Appveyor tests fail, merge at your own discretion, based upon the failure reason.
- Netlify - this test builds the site, and hosts an ephemeral preview version of it (viewable by clicking on the "details" link next to the test once it has turned green). It's a good idea to view this "deploy preview" if the PR has changed anything significant (adding a sponsor, etc, probably not...but changing content in a large way? Yes.)
Sharing local changes with Netlify Dev
If you wish to show someone else your local changes without creating a pull request or committing you could utilize netlify dev.
Firstly make sure
netlify dev is installed
npm install netlify-cli -g
If you're not authenticated with netlify, do so with the following command. Note that you may need an account.
netlify dev to share your local changes
netlify dev --live
You'll then be given a URL to share:
Waiting for localhost:1313. Connected! ◈ Installing Live Tunnel Client ◈ Creating Live Tunnel for 33459a04-9379-473d-8517-a25a208ef36a ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ ◈ Server now ready on https://devopsdays-web-936f59.netlify.live │ │ │ └──────────────────────────────────────────────────────────────────────┘