Skip to content

Commit b94300d

Browse files
committed
feat: add partner community links section
1 parent 23e0fd2 commit b94300d

4 files changed

Lines changed: 34 additions & 6 deletions

File tree

assets/css/site.css

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/site.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
const COPY = {
99
pt: {
1010
about: 'Sobre', nextMeetups: 'Próximos encontros', seeEvents: 'Ver eventos no Meetup ↗', seeMoreEvents: 'Ver mais no Meetup ↗',
11-
community: 'Comunidade', members: 'Membros', events: 'Eventos', projects: 'Projetos',
11+
community: 'Comunidade', partners: 'Conheça também', members: 'Membros', events: 'Eventos', projects: 'Projetos',
1212
conduct: 'Código de conduta', fullConduct: 'Ver Código de Conduta completo ↗', blog: 'Blog', upcoming: 'Próximos', past: 'Eventos anteriores',
1313
eventsIntro: 'Nos encontramos para trocar conhecimento. A agenda é mantida em data/events.json.',
1414
noEvents: 'Nenhum evento cadastrado no momento.', noMembers: 'Nenhum membro cadastrado ainda.', noPosts: 'Nenhum post publicado ainda.'
1515
},
1616
en: {
1717
about: 'About', nextMeetups: 'Next meetups', seeEvents: 'View events on Meetup ↗', seeMoreEvents: 'View more on Meetup ↗',
18-
community: 'Community', members: 'Members', events: 'Events', projects: 'Projects',
18+
community: 'Community', partners: 'Discover also', members: 'Members', events: 'Events', projects: 'Projects',
1919
conduct: 'Code of conduct', fullConduct: 'View the full Code of Conduct ↗', blog: 'Blog', upcoming: 'Upcoming', past: 'Past events',
2020
eventsIntro: 'We get together to share knowledge. The schedule lives in data/events.json.',
2121
noEvents: 'No events have been added yet.', noMembers: 'No members have been added yet.', noPosts: 'No posts have been published yet.'
2222
}
2323
};
24-
const SECTIONS = ['comunidade', 'membros', 'eventos', 'projetos', 'blog', 'conduta'];
24+
const SECTIONS = ['comunidade', 'conheca-tambem', 'membros', 'eventos', 'projetos', 'blog', 'conduta'];
2525
let lang = 'pt';
2626
let state = {};
2727

@@ -124,7 +124,7 @@
124124
const nav = byId('navegacao');
125125
clear(nav);
126126
[
127-
['comunidade', text('community')], ['membros', text('members')],
127+
['comunidade', text('community')], ['conheca-tambem', text('partners')], ['membros', text('members')],
128128
['eventos', text('events')], ['projetos', text('projects')], ['blog', text('blog')], ['conduta', text('conduct')]
129129
].forEach(([id, label]) => nav.append(element('a', { href: `#${id}`, text: label, 'data-section': id })));
130130
}
@@ -180,6 +180,20 @@
180180
});
181181
}
182182

183+
function renderPartners() {
184+
byId('partners-title').textContent = text('partners');
185+
byId('partners-intro').textContent = pick(state.site.partnersIntro);
186+
const container = byId('partner-cards');
187+
clear(container);
188+
(state.site.partners || []).forEach((partner) => {
189+
const card = element('article', { class: 'card' });
190+
const links = element('div', { class: 'card-links' });
191+
links.append(external(partner.href, pick(partner.linkText), 'pill'));
192+
card.append(element('h3', { text: pick(partner.title) }), element('p', { text: pick(partner.text) }), links);
193+
container.append(card);
194+
});
195+
}
196+
183197
function renderMembers() {
184198
const container = byId('members-list');
185199
clear(container);
@@ -285,7 +299,7 @@
285299
const events = state.events.map(eventView);
286300
const upcoming = events.filter(isUpcoming).sort((a, b) => a.date - b.date);
287301
const past = events.filter((event) => !isUpcoming(event)).sort((a, b) => b.date - a.date);
288-
renderNavigation(); renderHome(upcoming); renderCommunity(); renderMembers();
302+
renderNavigation(); renderHome(upcoming); renderCommunity(); renderPartners(); renderMembers();
289303
renderEvents(upcoming, past); renderProjectsAndConduct(); renderPosts(); renderFooter(); observeSections();
290304
}
291305

data/site.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
{ "title": { "pt": "Mídias sociais", "en": "Social media" }, "text": { "pt": "Acompanhe encontros, novidades e publicações da comunidade.", "en": "Follow meetups, news and community posts." }, "links": [{ "text": "Instagram", "href": "https://www.instagram.com/python.mg" }, { "text": "YouTube", "href": "https://www.youtube.com/c/PythonMinasGerais" }, { "text": "Telegram", "href": "https://telegram.me/pythonmg" }, { "text": "Twitter", "href": "https://twitter.com/PythonMG" }, { "text": "Facebook", "href": "https://facebook.com/uaipython" }] },
2121
{ "title": { "pt": "Meetup", "en": "Meetup" }, "text": { "pt": "Nos encontramos regularmente para trocar conhecimento e experiências.", "en": "We meet regularly to share knowledge and experience." }, "links": [{ "text": "Meetup", "href": "https://www.meetup.com/pythonmg/events" }] }
2222
],
23+
"partnersIntro": { "pt": "Eventos, instituições e comunidades que fortalecem o ecossistema Python.", "en": "Events, organisations, and communities that strengthen the Python ecosystem." },
24+
"partners": [
25+
{ "title": { "pt": "Evento regional", "en": "Regional event" }, "text": { "pt": "Python Sudeste reúne comunidades da região Sudeste.", "en": "Python Sudeste brings together communities from Southeast Brazil." }, "linkText": { "pt": "Python Sudeste", "en": "Python Sudeste" }, "href": "https://sudeste.python.org.br" },
26+
{ "title": { "pt": "Evento nacional", "en": "National event" }, "text": { "pt": "Python Brasil é o encontro nacional da comunidade Python.", "en": "Python Brasil is the national gathering of the Python community." }, "linkText": { "pt": "Python Brasil", "en": "Python Brasil" }, "href": "https://pythonbrasil.org.br/" },
27+
{ "title": { "pt": "Associação Python Brasil", "en": "Python Brasil Association" }, "text": { "pt": "A APyB apoia e representa a comunidade Python no Brasil.", "en": "APyB supports and represents the Python community in Brazil." }, "linkText": { "pt": "Conheça a APyB", "en": "Meet APyB" }, "href": "https://apyb.python.org.br/" },
28+
{ "title": { "pt": "Outras comunidades locais", "en": "Other local communities" }, "text": { "pt": "Encontre grupos Python em outras cidades e regiões do país.", "en": "Find Python groups in other cities and regions across Brazil." }, "linkText": { "pt": "Ver comunidades locais", "en": "View local communities" }, "href": "https://python.org.br/comunidades-locais/" }
29+
],
2330
"projects": [
2431
{ "title": "Traduções do Django docs", "text": { "pt": "Tradução colaborativa da documentação oficial do Django para o português.", "en": "Collaborative translation of the official Django documentation into Portuguese." } },
2532
{ "title": "Python on Campus", "text": { "pt": "Palestras e oficinas que levam Python para universidades de Minas Gerais.", "en": "Talks and workshops that bring Python to universities in Minas Gerais." } }

index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ <h1 id="hero-title">Python-MG</h1>
5656
<div class="card-grid" id="community-cards"></div>
5757
</section>
5858

59+
<section class="section" id="conheca-tambem" aria-labelledby="partners-title">
60+
<div class="section-heading"><h2 id="partners-title"></h2><span></span></div>
61+
<p class="section-intro" id="partners-intro"></p>
62+
<div class="card-grid partner-grid" id="partner-cards"></div>
63+
</section>
64+
5965
<section class="section" id="membros" aria-labelledby="members-title">
6066
<div class="section-heading"><h2 id="members-title"></h2><span></span></div>
6167
<p class="data-source">data/members.json</p>

0 commit comments

Comments
 (0)