_content,cmd: remove events section from homepage and get started page
The upcoming changes to the navbar will feature the meetup events
page. We can remove these sections instead of rebuilding the
integration with the GraphQL API.
Fixes golang/go#54796.
Change-Id: Ic29d9031f9359714d0b90fafbaff289a1ae9c877
Reviewed-on: https://go-review.googlesource.com/c/website/+/429577
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Jamal Carvalho <jamal@golang.org>
diff --git a/_content/events.yaml b/_content/events.yaml
deleted file mode 100644
index 6e47b92..0000000
--- a/_content/events.yaml
+++ /dev/null
@@ -1,250 +0,0 @@
-# DO NOT EDIT: Autogenerated from cmd/events.
-# To update, run:
-# go run ./cmd/events > _content/events.yaml
-all:
-- city: Eugene
- country: USA
- description: "All Gophers and curious software professionals are welcome to come discuss Go and related topics.<br/>\nGo is a Google-funded language for massively-scalable distributed systems that is statically typed and compiled. It has quickly stabilized and is running head-to-head with C++, Java, C#, etc. (<a href=\"https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/go.html\" rel=\"nofollow\">The Computer Language Benchmarks Game - Go</a>). However, a larger-than-expected portion of new Gophers is made up of dynamic/interpreted language users who tend to be seeking relief from the cruft in their current languages and/or a more clear future within the horizontally-growing landscape of modern computing.<br/>\nIf you're building web apps, designing APIs, thrive on scalability, or you're simply curious about this fun new(ish) language, let's meetup.<br/>\n• More resources are available at <a href=\"http://www.euggo.org\" rel=\"nofollow\">www.euggo.org</a> "
- id: tddnrrycclbwb
- local_date: Aug 17, 2021
- local_time: "2021-08-17T18:30:00-07:00"
- localizedcountry: USA
- localizedlocation: Eugene, OR
- name: Contribution > OpenBoard Check-in
- photourl: https://secure.meetupstatic.com/photos/event/2/8/1/600_453660641.jpeg
- state: OR
- thumbnailurl: https://secure.meetupstatic.com/photos/event/2/8/1/thumb_453660641.jpeg
- url: https://www.meetup.com/EUG-Go/events/tddnrrycclbwb
-- city: Berlin
- country: Germany
- description: |-
- We are a group of Golang users. Our aim is to meet like minded people, share our experience with others and to promote the use of Go.<br/>
- As Gophers and as Berliners, even if just visiting, we follow the Code of Conduct to make this a pleasant and inclusive environment for everyone: <br><br/>
- <a href="/conduct" rel="nofollow">https://go.dev/conduct</a> <br><a href="http://berlincodeofconduct.org/" rel="nofollow">http://berlincodeofconduct.org</a><br/>
- Follow us on twitter: <a href="https://twitter.com/gdgberlingolang" rel="nofollow">@GDGBerlinGolang</a><br/>
- You can get our special group swag here: <a href="https://shop.spreadshirt.de/gdg-golang-berlin" rel="nofollow">https://shop.spreadshirt.de/gdg-golang-berlin</a><br>
- id: "279891693"
- local_date: Aug 18, 2021
- local_time: "2021-08-18T19:00:00+02:00"
- localizedcountry: Germany
- localizedlocation: Berlin, Germany
- name: '[online] August Golang meetup'
- photourl: https://secure.meetupstatic.com/photos/event/9/8/b/1/600_465459089.jpeg
- state: ""
- thumbnailurl: https://secure.meetupstatic.com/photos/event/9/8/b/1/thumb_465459089.jpeg
- url: https://www.meetup.com/golang-users-berlin/events/279891693
-- city: Reston
- country: USA
- description: |-
- (from golang.org) <br><br/>
- <br/>
- The Go programming language is an open source project to make programmers more productive. Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
- id: cblrmsycclbxb
- local_date: Aug 18, 2021
- local_time: "2021-08-18T19:00:00-04:00"
- localizedcountry: USA
- localizedlocation: Reston, VA
- name: Golang Reston Monthly Meetup
- photourl: https://secure.meetupstatic.com/photos/event/7/f/7/600_433982039.jpeg
- state: VA
- thumbnailurl: https://secure.meetupstatic.com/photos/event/7/f/7/thumb_433982039.jpeg
- url: https://www.meetup.com/Golang-Reston/events/cblrmsycclbxb
-- city: Minneapolis
- country: USA
- description: |-
- A meetup group to discuss the Go Programming Language.<br><br/>
- <br/>
- <br/>
- <br><br/>
- <br/>
- <br/>
- What is Go?<br><br/>
- <br/>
- <br/>
- (from golang.org) The Go programming language is an open source project to make programmers more productive. Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
- id: "280071866"
- local_date: Aug 18, 2021
- local_time: "2021-08-18T18:00:00-05:00"
- localizedcountry: USA
- localizedlocation: Minneapolis, MN
- name: August GoMN Meetup (in-person and virtual)
- photourl: https://secure.meetupstatic.com/photos/event/8/a/0/4/600_380555332.jpeg
- state: MN
- thumbnailurl: https://secure.meetupstatic.com/photos/event/8/a/0/4/thumb_380555332.jpeg
- url: https://www.meetup.com/golangmn/events/280071866
-- city: New York
- country: USA
- description: |
- Go Language meetups and more in the greatest city in the world! <br/>
- <br/>
- Our purpose is to help build the Go community within NYC. We are here to support individuals by providing a safe platform for them to speak, listen, and learn. When not hosting a meetup, we will help promote and support our partner groups and events to help build awareness for all things Go in NYC.<br/>
- Follow us on twitter at <a href="https://twitter.com/golangnyc" rel="nofollow">@golangnyc</a>.<br/>
- Events are Free for the Community <br/>
- id: "279593118"
- local_date: Aug 18, 2021
- local_time: "2021-08-18T19:00:00-04:00"
- localizedcountry: USA
- localizedlocation: New York, NY
- name: JWTs - What Golang Developers Need to Know by Dan Moore
- photourl: https://secure.meetupstatic.com/photos/event/7/d/3/1/600_464912049.jpeg
- state: NY
- thumbnailurl: https://secure.meetupstatic.com/photos/event/7/d/3/1/thumb_464912049.jpeg
- url: https://www.meetup.com/golanguagenewyork/events/279593118
-- city: Toronto
- country: Canada
- description: |-
- Women Who Go Toronto is a community of women and non-binary Go (Golang) developers committed to learning and sharing intermediate and advanced Go programming topics in an open and inclusive environment. <br/>
- <br><br/>
- Is this meetup for me?<br/>
- <br/>
- <br><br/>
- <br><br/>
- Women Who Go Toronto Mascot<br/>
- Our gopher friend, Meg, is designed by <a href="https://www.instagram.com/ellenpix" rel="nofollow">Ellen Hsiang</a>. The inspiration behind this mascot comes from the well-known photo of software pioneer Margaret Hamilton standing next to her team's tower of code for the Apollo Project. She was a champion of computer programming as a legitimate discipline, and is credited with coining the term software engineering.<br/>
- Behind Meg is the distinctive Toronto City Hall. In contrast to that other famous but pointier Toronto landmark, City Hall is a curvy harmony of parts. Two towers wrap around the saucer-like council chamber, hinting at standing figures gathering for an intimate chat. It is also the literal meeting place for City Council. Both the building and the meetings are open to the public.<br/>
- Passionate software engineers, gophers, and a welcoming community? What else but Women Who Go Toronto.<br/>
- <br><br/>
- Code of Conduct<br/>
- All members agree to adhere to the <a href="https://github.com/gobridge/about-us/blob/master/coc.md" rel="nofollow">Women Who Go Code of Conduct</a>. <br><br/>
- <br>
- id: "280080819"
- local_date: Aug 19, 2021
- local_time: "2021-08-19T12:00:00-04:00"
- localizedcountry: Canada
- localizedlocation: Toronto, ON
- name: 'Reading Club: Inlined defers in Go'
- photourl: ""
- state: "ON"
- thumbnailurl: ""
- url: https://www.meetup.com/women-who-go-toronto/events/280080819
-- city: Boulder
- country: USA
- description: Come meet and learn from other Boulder-based gophers!
- id: rbjqgrycclbzb
- local_date: Aug 19, 2021
- local_time: "2021-08-19T17:30:00-06:00"
- localizedcountry: USA
- localizedlocation: Boulder, CO
- name: Boulder Monthly Go Meetup
- photourl: https://secure.meetupstatic.com/photos/event/4/a/e/f/600_460759183.jpeg
- state: CO
- thumbnailurl: https://secure.meetupstatic.com/photos/event/4/a/e/f/thumb_460759183.jpeg
- url: https://www.meetup.com/Boulder-Gophers/events/rbjqgrycclbzb
-- city: Newcastle Upon Tyne
- country: United Kingdom
- description: This is a group for anyone in the North East of England who's interested in the Go programming language. We usually meet up in Newcastle on the fourth Tuesday of every month at Campus North, Carliol Square.
- id: mzwncsycclbgc
- local_date: Aug 24, 2021
- local_time: "2021-08-24T19:30:00+01:00"
- localizedcountry: United Kingdom
- localizedlocation: Newcastle Upon Tyne, United Kingdom
- name: Go meetup
- photourl: ""
- state: ""
- thumbnailurl: ""
- url: https://www.meetup.com/Golang-North-East/events/mzwncsycclbgc
-- city: Denver
- country: USA
- description: This is a group for anyone that is interested in learning more about the Go programming language. We invite novice developers to experienced developers to attend. We will make sure we have appropriate topics and presentations for all groups. Our focus will be on how GO compares to other languages, paths for moving from Rails to Go, Go Concurrency Examples, and many many more real world examples and tech talks.
- id: jjvnnsycclbjc
- local_date: Aug 25, 2021
- local_time: "2021-08-25T17:30:00-06:00"
- localizedcountry: USA
- localizedlocation: Denver, CO
- name: Denver Monthly Go Meetup
- photourl: https://secure.meetupstatic.com/photos/event/9/2/f/f/600_459337631.jpeg
- state: CO
- thumbnailurl: https://secure.meetupstatic.com/photos/event/9/2/f/f/thumb_459337631.jpeg
- url: https://www.meetup.com/Denver-Go-Language-User-Group/events/jjvnnsycclbjc
-- city: Chennai
- country: India
- description: |-
- A group for anyone using (want to use) golang for programming and development of software or engineering applications.<br/>
- We are on slack #chennaigolang
- id: "280073876"
- local_date: Aug 28, 2021
- local_time: "2021-08-28T11:00:00+05:30"
- localizedcountry: India
- localizedlocation: Chennai, India
- name: '[Remote] August Go Meetup'
- photourl: https://secure.meetupstatic.com/photos/event/5/0/0/c/600_491060492.jpeg
- state: ""
- thumbnailurl: https://secure.meetupstatic.com/photos/event/5/0/0/c/thumb_491060492.jpeg
- url: https://www.meetup.com/Chennai-golang-Meetup/events/280073876
-- city: Canberra
- country: Australia
- description: Canberra Gophers will meet every month to talk about software development using the Go programming language. Please join if you have an interest in Go or if you are using Go in your work.
- id: "279961436"
- local_date: Sep 1, 2021
- local_time: "2021-09-01T18:00:00+10:00"
- localizedcountry: Australia
- localizedlocation: Canberra, Australia
- name: Canberra Gophers September 2021
- photourl: ""
- state: ""
- thumbnailurl: ""
- url: https://www.meetup.com/Canberra-Gophers/events/279961436
-- city: Tel Aviv-Yafo
- country: Israel
- description: |-
- This is the group for programmers who are interested in the High Performance, Scalable, lightweight, cross platform development tool that also promises ease of programming, agility and the fun you don't usually get using a low-level language. Welcome to the Israeli Go language Group.<br/>
- If you'd like to give a talk, please add yourself to <a href="https://trello.com/b/xbSxWRpG/go-israel-talks" rel="nofollow">the trello board</a>
- id: kjvczlyccmbcb
- local_date: Sep 1, 2021
- local_time: "2021-09-01T18:00:00+03:00"
- localizedcountry: Israel
- localizedlocation: Tel Aviv-Yafo, Israel
- name: November Meetup (TBD)
- photourl: https://secure.meetupstatic.com/photos/event/a/9/6/9/600_477523369.jpeg
- state: ""
- thumbnailurl: https://secure.meetupstatic.com/photos/event/a/9/6/9/thumb_477523369.jpeg
- url: https://www.meetup.com/Go-Israel/events/kjvczlyccmbcb
-- city: Sheffield
- country: United Kingdom
- description: |-
- We meet the first Thursday of every month to discuss interesting topics about the Go programming language.<br/>
- <br><br/>
- Twitter: <a href="https://twitter.com/GolangSheffield" rel="nofollow">https://twitter.com/GolangSheffield</a><br/>
- GitHub: <a href="https://github.com/gosheffield" rel="nofollow">https://github.com/gosheffield</a><br/>
- YouTube: <a href="https://www.youtube.com/channel/UCqCNEC4iEwT9L1GzyosuZ4Q" rel="nofollow">https://www.youtube.com/channel/UCqCNEC4iEwT9L1GzyosuZ4Q</a> <br>
- id: "280091930"
- local_date: Sep 2, 2021
- local_time: "2021-09-02T18:30:00+01:00"
- localizedcountry: United Kingdom
- localizedlocation: Sheffield, United Kingdom
- name: GoSheffield - September
- photourl: ""
- state: ""
- thumbnailurl: ""
- url: https://www.meetup.com/GoSheffield/events/280091930
-- city: Baltimore
- country: USA
- description: If you're interested in the Go Programming Language (aka Golang), newbie, experienced or just curious, this is the meetup for you. We're an inclusive group that aims for diversity in our membership, the talks we select every month and your ideas for making this group thrive. Let's build an awesome Go community in the Baltimore Metro Area.
- id: twgcdqyccmbkb
- local_date: Sep 7, 2021
- local_time: "2021-09-07T18:30:00-04:00"
- localizedcountry: USA
- localizedlocation: Baltimore, MD
- name: Baltimore Go Monthly Meeting
- photourl: https://secure.meetupstatic.com/photos/event/5/2/1/5/600_485661013.jpeg
- state: MD
- thumbnailurl: https://secure.meetupstatic.com/photos/event/5/2/1/5/thumb_485661013.jpeg
- url: https://www.meetup.com/BaltimoreGolang/events/twgcdqyccmbkb
-- city: Lehi
- country: USA
- description: |-
- Any person can attend this meetup regardless of gender. We strive to help all people learn about the Go programming language. We hope these skills will help them at work, home, and in passion projects. We also strive to enable women in the workplace!<br><br/>
- This is a Utah based chapter of the Women Who Go group (<a href="https://www.womenwhogo.org/" rel="nofollow">https://www.womenwhogo.org/</a>). <br/>
- Find us in twitter: @wwgutah<br/>
- Contact:miriah@theforge.tech<br/>
- CFP: <a href="https://www.papercall.io/events/3901" rel="nofollow">https://www.papercall.io/events/3901</a>
- id: htjjnsyccmbkb
- local_date: Sep 7, 2021
- local_time: "2021-09-07T18:15:00-06:00"
- localizedcountry: USA
- localizedlocation: Lehi, UT
- name: 'Full Stack Code Gen: Using go gen and Other Tools'
- photourl: https://secure.meetupstatic.com/photos/event/4/d/4/c/600_489379788.jpeg
- state: UT
- thumbnailurl: https://secure.meetupstatic.com/photos/event/4/d/4/c/thumb_489379788.jpeg
- url: https://www.meetup.com/Women-Who-Go-Utah/events/htjjnsyccmbkb
diff --git a/_content/index.md b/_content/index.md
index 5088a0c..b223091 100644
--- a/_content/index.md
+++ b/_content/index.md
@@ -249,53 +249,6 @@
</ul>
</div>
</section>
-<section class="LearnGo">
- <div class="GoCarousel" id="LearnGo-carousel">
- <div class="GoCarousel-controlsContainer">
- <div class="GoCarousel-eventsWrapper">
- <ul class="js-goCarouselEventsSlides GoCarousel-eventsSlides">
- {{- range $index, $element := (data "/events.yaml").all}}
- <li
- class="GoCarousel-eventGroup"
- id="event_slide{{$index}}">
- <div class="GoCarousel-eventThumbnail">
- {{- if .thumbnailurl}}
- <img
- loading="lazy"
- src="{{.thumbnailurl}}"
- alt="{{.name}} group photo">
- {{- else}}
- <img
- loading="lazy"
- src="/images/meetup.svg"
- alt="meetup logo">
- {{- end}}
- </div>
- <div class="GoCarousel-eventBody">
- <div class="GoCarousel-eventText">
- <div class="GoCarousel-eventHeader">Upcoming Events</div>
- <h4 class="GoCarousel-eventName">
- <a href="{{.url}}">{{.name}}</a>
- </h4>
- <div class="GoCarousel-eventDate">
- <p>{{.local_date}} | {{.city}}, {{.state}} {{.country}}</p>
- </div>
- <p class="GoCarousel-viewMore"><a href="{{.url}}">Learn more</a></p>
- </div>
- </div>
- </li>
- {{- end}}
- </ul>
- </div>
- <button class="js-eventsCarouselPrev GoCarousel-controlPrev" hidden>
- <i class="GoCarousel-icon material-icons">navigate_before</i>
- </button>
- <button class="js-eventsCarouselNext GoCarousel-controlNext">
- <i class="GoCarousel-icon material-icons">navigate_next</i>
- </button>
- </div>
- </div>
-</section>
<section class="GettingStartedGo">
<div class="GettingStartedGo-gridContainer">
<div class="GettingStartedGo-header">
diff --git a/_content/learn/index.md b/_content/learn/index.md
index 0f91bc0..248fb92 100644
--- a/_content/learn/index.md
+++ b/_content/learn/index.md
@@ -164,52 +164,6 @@
</div>
</section>
-<section class="Learn-meetups">
- <div class="Container">
- <div class="Learn-subHeader">
- <h2>Meetups</h2>
- <p class="Learn-viewMore">
- <a href="https://www.meetup.com/pro/go">View more events ></a>
- </p>
- </div>
- <ul class="Learn-events">
- {{- range first 3 (data "/events.yaml").all}}
- <li class="Learn-eventItem">
- <div
- class="Learn-eventThumbnail {{if not .photourl}}Learn-eventThumbnail--noimage{{end}}"
- >
- {{- if .photourl}}
- <img alt="{{.name}} group photo" src="{{.photourl}}" />
- {{- else}}
- <img src="/images/meetup.svg" alt="meetup logo" />
- {{- end}}
- </div>
- <div class="Learn-eventBody">
- <div class="Learn-eventDate">
- <p>{{.local_date}} · {{.city}}, {{.state}} {{.country}}</p>
- </div>
- <div class="Learn-eventText">
- <h4 class="Learn-eventName">
- <a href="{{.url}}">{{.name}}</a>
- </h4>
- <p class="Learn-eventDescription">{{raw .description}}</p>
- </div>
- <div class="Learn-eventAttendees">
- {{- with .attendees }}
- {{- range first 5 .}}
- <div class="Learn-eventAttendeesItem">
- <img src="{{.thumb_link}}" alt="{{.name}}"/>
- </div>
- {{- end}}
- {{- end}}
- </div>
- </div>
- </li>
- {{- end}}
- </ul>
- </div>
-</section>
-
{{define "learn-card"}}
<div class="Card">
<div class="Card-inner">
diff --git a/cmd/events/main.go b/cmd/events/main.go
deleted file mode 100644
index 892e495..0000000
--- a/cmd/events/main.go
+++ /dev/null
@@ -1,304 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-package main
-
-import (
- "encoding/json"
- "fmt"
- "log"
- "net/http"
- "os"
- "path"
- "strings"
- "time"
-
- "github.com/microcosm-cc/bluemonday"
- "gopkg.in/yaml.v2"
-)
-
-const (
- // eventLimit is the maximum number of events that will be output.
- eventLimit = 15
- // groupsSummaryPath is an API endpoint that returns global Go groups.
- // Fetching from this API path allows to sort groups by next upcoming event.
- groupsSummaryPath = "/pro/go/es_groups_summary?location=global&order=next_event&desc=false"
- // eventsHeader is a header comment for the output content.
- eventsHeader = `# DO NOT EDIT: Autogenerated from cmd/events.
-# To update, run:
-# go run ./cmd/events > _content/events.yaml`
-)
-
-func main() {
- c := &meetupAPI{
- baseURL: "https://api.meetup.com",
- }
- ue, err := getUpcomingEvents(c)
- if err != nil {
- log.Fatal(err)
- }
- printYAML(ue)
-}
-
-type client interface {
- getGroupsSummary() (*GroupsSummary, error)
- getGroup(urlName string) (*Group, error)
-}
-
-// getUpcomingEvents returns upcoming events globally.
-func getUpcomingEvents(c client) (*UpcomingEvents, error) {
- summary, err := c.getGroupsSummary()
- if err != nil {
- return nil, err
- }
- p := bluemonday.NewPolicy()
- p.AllowStandardURLs()
- p.AllowAttrs("href").OnElements("a")
- p.AllowElements("br")
- // Work around messy newlines in content.
- r := strings.NewReplacer("\n", "<br/>\n", "<br>", "<br/>\n")
- var events []EventData
- for _, chapter := range summary.Chapters {
- if len(events) >= eventLimit {
- break
- }
- group, err := c.getGroup(chapter.URLName)
- if err != nil || group.NextEvent == nil {
- continue
- }
- tz, err := time.LoadLocation(group.Timezone)
- if err != nil {
- tz = time.UTC
- }
- // group.NextEvent.Time is in milliseconds since UTC epoch.
- nextEventTime := time.Unix(group.NextEvent.Time/1000, 0).In(tz)
- events = append(events, EventData{
- City: chapter.City,
- Country: chapter.Country,
- Description: r.Replace(p.Sanitize(chapter.Description)), // Event descriptions are often blank, use Group description.
- ID: group.NextEvent.ID,
- LocalDate: nextEventTime.Format("Jan 2, 2006"),
- LocalTime: nextEventTime.Format(time.RFC3339),
- LocalizedCountry: group.LocalizedCountryName,
- LocalizedLocation: group.LocalizedLocation,
- Name: group.NextEvent.Name,
- PhotoURL: chapter.GroupPhoto.PhotoLink,
- State: chapter.State,
- ThumbnailURL: chapter.GroupPhoto.ThumbLink,
- URL: "https://www.meetup.com/" + path.Join(chapter.URLName, "events", group.NextEvent.ID),
- })
- }
- return &UpcomingEvents{All: events}, nil
-}
-
-type meetupAPI struct {
- baseURL string
-}
-
-func (c *meetupAPI) getGroupsSummary() (*GroupsSummary, error) {
- resp, err := http.Get(c.baseURL + groupsSummaryPath)
- if err != nil {
- return nil, fmt.Errorf("failed to get events from %q: %v", groupsSummaryPath, err)
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("failed to get events from %q: %v", groupsSummaryPath, resp.Status)
- }
- var summary *GroupsSummary
- d := json.NewDecoder(resp.Body)
- if err := d.Decode(&summary); err != nil {
- return summary, fmt.Errorf("failed to decode events from %q: %w", groupsSummaryPath, err)
- }
- return summary, nil
-}
-
-// getGroup fetches group details, which are useful for getting details of the next upcoming event, and timezones.
-func (c *meetupAPI) getGroup(urlName string) (*Group, error) {
- u := c.baseURL + "/" + urlName
- resp, err := http.Get(u)
- if err != nil {
- return nil, fmt.Errorf("failed to fetch group details from %q: %w", u, err)
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("failed to fetch group details from %q: %v", u, resp.Status)
- }
-
- var group Group
- d := json.NewDecoder(resp.Body)
- if err := d.Decode(&group); err != nil {
- return nil, fmt.Errorf("failed to decode group from %q: %w", u, err)
- }
- return &group, nil
-}
-
-func printYAML(v interface{}) {
- fmt.Println(eventsHeader)
- e := yaml.NewEncoder(os.Stdout)
- defer e.Close()
- if err := e.Encode(v); err != nil {
- log.Fatalf("failed to encode event yaml: %v", err)
- }
-}
-
-// UpcomingEvents is a list of EventData written out to YAML for rendering in Hugo.
-type UpcomingEvents struct {
- All []EventData
-}
-
-// EventData is the structure written out to YAML for rendering in Hugo.
-type EventData struct {
- City string
- Country string
- Description string
- ID string
- LocalDate string `yaml:"local_date"`
- LocalTime string `yaml:"local_time"`
- LocalizedCountry string
- LocalizedLocation string
- Name string
- PhotoURL string
- State string
- ThumbnailURL string
- URL string
-}
-
-// GroupsSummary is the structure returned from /pro/go/es_groups_summary.
-type GroupsSummary struct {
- Chapters []*Chapter
-}
-
-type Event struct {
- Created int `json:"created"`
- Description string `json:"description"`
- Duration int `json:"duration"`
- Fee *Fee `json:"fee"`
- Group *Group `json:"group"`
- LocalDate string `json:"local_date"`
- LocalTime string `json:"local_time"`
- ID string `json:"id"`
- Link string `json:"link"`
- Name string `json:"name"`
- RSVPLimit int `json:"rsvp_limit"`
- Status string `json:"status"`
- Time int64 `json:"time"`
- UTCOffset int `json:"utc_offset"`
- Updated int `json:"updated"`
- Venue *Venue `json:"venue"`
- WaitlistCount int `json:"waitlist_count"`
- YesRSVPCount int `json:"yes_rsvp_count"`
-}
-
-type Venue struct {
- Address1 string `json:"address_1"`
- Address2 string `json:"address_2"`
- Address3 string `json:"address_3"`
- City string `json:"city"`
- Country string `json:"country"`
- ID int `json:"id"`
- Lat float64 `json:"lat"`
- LocalizedCountryName string `json:"localized_country_name"`
- Lon float64 `json:"lon"`
- Name string `json:"name"`
- Repinned bool `json:"repinned"`
- State string `json:"state"`
- Zip string `json:"zip"`
-}
-
-type Group struct {
- Country string `json:"country"`
- Created int `json:"created"`
- Description string `json:"description"`
- ID int `json:"id"`
- JoinMode string `json:"join_mode"`
- Lat float64 `json:"lat"`
- LocalizedLocation string `json:"localized_location"`
- LocalizedCountryName string `json:"localized_country_name"`
- Lon float64 `json:"lon"`
- Name string `json:"name"`
- NextEvent *Event `json:"next_event"`
- Region string `json:"region"`
- Timezone string `json:"timezone"`
- URLName string `json:"urlname"`
- Who string `json:"who"`
-}
-
-type Fee struct {
- Accepts string `json:"accepts"`
- Amount float64 `json:"amount"`
- Currency string `json:"currency"`
- Description string `json:"description"`
- Label string `json:"label"`
- Required bool `json:"required"`
-}
-
-type Chapter struct {
- AverageAge float64 `json:"average_age"`
- Category []Category `json:"category"`
- City string `json:"city"`
- Country string `json:"country"`
- Description string `json:"description"`
- FoundedDate int64 `json:"founded_date"`
- GenderFemale float64 `json:"gender_female"`
- GenderMale float64 `json:"gender_male"`
- GenderOther float64 `json:"gender_other"`
- GenderUnknown float64 `json:"gender_unknown"`
- GroupPhoto GroupPhoto `json:"group_photo"`
- ID int `json:"id"`
- LastEvent int64 `json:"last_event"`
- Lat float64 `json:"lat"`
- Lon float64 `json:"lon"`
- MemberCount int `json:"member_count"`
- Name string `json:"name"`
- NextEvent int64 `json:"next_event"`
- OrganizerPhoto OrganizerPhoto `json:"organizer_photo"`
- Organizers []Organizer `json:"organizers"`
- PastEvents int `json:"past_events"`
- PastRSVPs int `json:"past_rsvps"`
- ProJoinDate int64 `json:"pro_join_date"`
- RSVPsPerEvent float64 `json:"rsvps_per_event"`
- RepeatRSVPers int `json:"repeat_rsvpers"`
- State string `json:"state"`
- Status string `json:"status"`
- Topics []Topic `json:"topics"`
- URLName string `json:"urlname"`
- UpcomingEvents int `json:"upcoming_events"`
-}
-
-type Topic struct {
- ID int `json:"id"`
- Name string `json:"name"`
- URLkey string `json:"urlkey"`
- Lang string `json:"lang"`
-}
-
-type Category struct {
- ID int `json:"id"`
- Name string `json:"name"`
- Shortname string `json:"shortname"`
- SortName string `json:"sort_name"`
-}
-
-type Organizer struct {
- Name string `json:"name"`
- MemberID int `json:"member_id"`
- Permission string `json:"permission"`
-}
-
-type OrganizerPhoto struct {
- BaseURL string `json:"base_url"`
- HighresLink string `json:"highres_link"`
- ID int `json:"id"`
- PhotoLink string `json:"photo_link"`
- ThumbLink string `json:"thumb_link"`
- Type string `json:"type"`
-}
-
-type GroupPhoto struct {
- BaseURL string `json:"base_url"`
- HighresLink string `json:"highres_link"`
- ID int `json:"id"`
- PhotoLink string `json:"photo_link"`
- ThumbLink string `json:"thumb_link"`
- Type string `json:"type"`
-}
diff --git a/cmd/events/main_test.go b/cmd/events/main_test.go
deleted file mode 100644
index 949887e..0000000
--- a/cmd/events/main_test.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package main
-
-import (
- "fmt"
- "testing"
-
- "github.com/google/go-cmp/cmp"
-)
-
-var (
- noEventGroup = &Group{Name: "no event group"}
- upcomingEventGroup = &Group{
- Name: "Upcoming Event Group",
- Timezone: "Europe/Oslo",
- NextEvent: &Event{
- ID: "12345",
- Name: "Upcoming Event",
- Time: 1262976000000,
- },
- }
- fakeGroups = map[string]*Group{
- "noEvent": noEventGroup,
- "ueg": upcomingEventGroup,
- }
-)
-
-type fakeClient struct{}
-
-func (f fakeClient) getGroupsSummary() (*GroupsSummary, error) {
- return &GroupsSummary{Chapters: []*Chapter{
- {URLName: "noEvent"},
- {
- URLName: "ueg",
- Description: "We host our own events\n",
- },
- }}, nil
-}
-
-func (f fakeClient) getGroup(urlName string) (*Group, error) {
- g, ok := fakeGroups[urlName]
- if !ok {
- return nil, fmt.Errorf("no group %q", urlName)
- }
- return g, nil
-}
-
-func TestGetUpcomingEvents(t *testing.T) {
- want := &UpcomingEvents{All: []EventData{
- {
- Name: "Upcoming Event",
- ID: "12345",
- Description: "We host our own events<br/>\n",
- LocalDate: "Jan 8, 2010",
- LocalTime: "2010-01-08T19:40:00+01:00",
- URL: "https://www.meetup.com/ueg/events/12345",
- },
- }}
- f := fakeClient{}
- got, err := getUpcomingEvents(f)
- if err != nil {
- t.Fatalf("getUpcomingEvents(%v) error = %v, wanted no error", f, err)
- }
- if diff := cmp.Diff(want, got); diff != "" {
- t.Errorf("getUpcomingEvents(%v) mismatch (-want +got):\n%s", f, diff)
- }
-}
diff --git a/cmd/golangorg/cloudbuild.yaml b/cmd/golangorg/cloudbuild.yaml
index 4b50df1..f2652fc 100644
--- a/cmd/golangorg/cloudbuild.yaml
+++ b/cmd/golangorg/cloudbuild.yaml
@@ -12,9 +12,6 @@
args: ["rm", "-rf", "_gotmp"]
- name: golang
args: ["go", "test", "./..."]
- # TODO(go.dev/issue/54796): Fix event step
- # - name: golang
- # args: ["bash", "-c", "go run ./cmd/events > ./_content/events.yaml"]
- name: golang
args: ["go", "run", "./cmd/locktrigger", "--project=$PROJECT_ID",
"--build=$BUILD_ID", "--repo=https://go.googlesource.com/website"]
diff --git a/cmd/screentest/testdata/godev.txt b/cmd/screentest/testdata/godev.txt
index aff8ea0..2b6e197 100644
--- a/cmd/screentest/testdata/godev.txt
+++ b/cmd/screentest/testdata/godev.txt
@@ -3,8 +3,6 @@
test homepage
pathname /
-# The data in _content/events.yaml is stale, hide this section from the screenshots.
-eval document.querySelector('.LearnGo').style.display = 'none';
capture fullscreen
capture fullscreen 540x1080
@@ -20,8 +18,6 @@
test getting started
pathname /learn/
-# The data in _content/events.yaml is stale, hide this section from the screenshots.
-eval document.querySelector('.Learn-meetups').style.display = 'none';
capture fullscreen
capture fullscreen 540x1080