Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk migrate #290

Merged
merged 1 commit into from
May 8, 2016
Merged
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
51 changes: 51 additions & 0 deletions events-to-migrate
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
2013-atlanta
2013-austin
2013-barcelona
2013-berlin
2013-downunder
2013-london
2013-london-spring
2013-mountainview
2013-newyork
2013-newzealand
2013-paris
2013-portland
2013-telaviv
2013-template
2013-tokyo
2013-vancouver
2014-amsterdam
2014-austin
2014-bangalore
2014-belgium
2014-berlin
2014-boston
2014-brisbane
2014-chicago
2014-denver
2014-helsinki
2014-ljubljana
2014-newyork
2014-pittsburgh
2014-raleigh
2014-siliconvalley
2014-telaviv
2014-toronto
2014-vancouver
2014-warsaw
2015-charlotte
2015-chicago
2015-denver
2015-derby
2015-detroit
2015-ljubljana
2015-melbourne
2015-newyork
2015-perth
2015-pittsburgh
2015-siliconvalley
2015-singapore
2015-telaviv
2015-toronto
2015-warsaw
2015-washington-dc
30 changes: 30 additions & 0 deletions migrate-city.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "yyyy-city" # The name of the event. Four digit year with the city name in lower-case, with no spaces.
year: YYYY # The year of the event. Make sure it is in quotes.
city: "City" # The city name of the event. Capitalize it.
friendly: "yyyy-city" # Four digit year and the city name in lower-case. Don't forget the dash!
status: "past" # Options are "past" or "current". Use "current" for upcoming.

# All dates are in unquoted YYYY-MM-DD, like this: variable: 2016-01-05
startdate: 2010-01-01
enddate: 2010-01-02
# Leave CFP dates blank if you don't know yet, or set all three at once.
cfp_date_start: # start accepting talk proposals.
cfp_date_end: # close your call for proposals.
cfp_date_announce: # inform proposers of status

# Location
#
coordinates: "41.882219, -87.640530" # The coordinates of your city. Get Latitude and Longitude of a Point: http://itouchmap.com/latlong.html
location: "yourlocation" # Defaults to city, but you can make it the venue name.
#

nav_elements: # List of pages you want to show up in the navigation of your page.
- name: welcome
- name: program
- name: propose
- name: location
- name: registration
- name: sponsor
- name: contact
- name: conduct

33 changes: 33 additions & 0 deletions migrate-events.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

WEBBY="/Users/bridget/github/devopsdays-webby/"
set -e

IFS=- read year city

cityname="$(tr '[:lower:]' '[:upper:]' <<< ${city:0:1})${city:1}"

event_slug=$year-$city


cp migrate-city.yml data/events/$event_slug.yml
sed -i '' "s/YYYY/$year/" data/events/$event_slug.yml
sed -i '' "s/City/$cityname/" data/events/$event_slug.yml
sed -i '' "s/yyyy-city/$event_slug/" data/events/$event_slug.yml

rm -rf content/events/$event_slug/ | true
mkdir -p content/events/$event_slug/
cp migrate-welcome.md content/events/$event_slug/welcome.md

sed -i '' '/draft = true/d' content/events/$event_slug/welcome.md

# setting the creation date at the time the event is instantiated
datestamp=$(date +%Y-%m-%dT%H:%M:%S%z | sed 's/^\(.\{22\}\)/\1:/')
sed -i '' "s/2000-01-01T01:01:01-06:00/$datestamp/" content/events/$event_slug/welcome.md
sed -i '' "s/YYYY-city/$event_slug/" content/events/$event_slug/welcome.md

cp -r $WEBBY/site/output/events/$event_slug static/events/

cat $WEBBY/site/output/events/$event_slug/index.html >> content/events/$event_slug/welcome.md

echo "Migrated $event_slug"
10 changes: 10 additions & 0 deletions migrate-welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
date = "2016-01-01T01:01:01-06:00"
title = "welcome"
type = "event"
aliases = ["/events/YYYY-city"]
draft = true

+++

OLD