From 8c6d9184ce1fe75f1dbe92caaf73e7ef600c8192 Mon Sep 17 00:00:00 2001 From: Bridget Kromhout Date: Sat, 7 May 2016 17:52:53 -0500 Subject: [PATCH] Bulk migrate --- events-to-migrate | 51 ++++++++++++++++++++++++++++++++++++++++++++++ migrate-city.yml | 30 +++++++++++++++++++++++++++ migrate-events.sh | 33 ++++++++++++++++++++++++++++++ migrate-welcome.md | 10 +++++++++ 4 files changed, 124 insertions(+) create mode 100644 events-to-migrate create mode 100644 migrate-city.yml create mode 100755 migrate-events.sh create mode 100644 migrate-welcome.md diff --git a/events-to-migrate b/events-to-migrate new file mode 100644 index 00000000000..6b17dccaff2 --- /dev/null +++ b/events-to-migrate @@ -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 diff --git a/migrate-city.yml b/migrate-city.yml new file mode 100644 index 00000000000..935e6d6de8b --- /dev/null +++ b/migrate-city.yml @@ -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 + diff --git a/migrate-events.sh b/migrate-events.sh new file mode 100755 index 00000000000..b70ae387922 --- /dev/null +++ b/migrate-events.sh @@ -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" diff --git a/migrate-welcome.md b/migrate-welcome.md new file mode 100644 index 00000000000..8b19552f164 --- /dev/null +++ b/migrate-welcome.md @@ -0,0 +1,10 @@ ++++ +date = "2016-01-01T01:01:01-06:00" +title = "welcome" +type = "event" +aliases = ["/events/YYYY-city"] +draft = true + ++++ + +OLD