Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ If you'd like to edit a specific devopsdays event site (and/or contribute code),
1. Have the ability to run Hugo. This can be done locally or through
Docker.
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repo and clone a copy locally.
1. Check out the available [utility scripts](./utilities/README.md) to help organize your event.

#### Run Hugo with Docker (Recommended)

Expand Down
14 changes: 14 additions & 0 deletions utilities/add_new_event.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ twitter=$(echo $twitter | sed 's/@//')
# We use the term event_slug in the hugo files too
event_slug=$year-$city_slug

# Check if the event directory already exists
if [ -d "../content/events/$event_slug" ]; then
echo "The event content directory already exists:"
echo "./content/events/$event_slug"
exit 1
fi

# Update the redirection for a previous year of this event to the desired year
if grep -q "^/$city_slug" "../static/_redirects";
then
Expand All @@ -46,6 +53,13 @@ else
echo "/$city_slug/* /events/$event_slug/:splat 302" >> "../static/_redirects"
fi

# Check if the event directory already exists
if [ -d "../data/events/$year/$city_slug" ]; then
echo "The event data directory already exists:"
echo "./data/events/$year/$city_slug"
exit 1
fi

# Create data directory for the event
mkdir -p ../data/events/$year/$city_slug
# Create default event datafile
Expand Down