Skip to content
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
11 changes: 8 additions & 3 deletions app/[locale]/developers/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@ export const getVideoCourses = async (): Promise<VideoCourse[]> => {
export const getHackathons = async (): Promise<EventItem[]> => {
const events = await getEventsData()
if (!events) return []
return events.filter(
(e) =>
const now = new Date()
return events.filter((e) => {
const isHackathon =
e.eventTypes?.includes("hackathon") ||
e.tags?.some((tag) => tag.toLowerCase() === "hackathon")
)
if (!isHackathon) return false
// Guard against stale cached data showing past events
const cutoff = e.endTime ? new Date(e.endTime) : new Date(e.startTime)
return cutoff >= now
})
}
2 changes: 1 addition & 1 deletion src/intl/en/page-developers-index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"page-developer-meta-title": "Ethereum Developer Resources",
"page-developer-meta-title": "Ethereum Developer Resources | ethereum.org",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nloureiro I see we're using this pattern inconsistently -- I think a cleaner solution would be to bake this into the src/lib/utils/metadata.ts getMetadata helper function. We have siteTitle in there which displays ethereum.org, which we could automatically append to the end of the titles on all pages.

  • Avoids repeating ourselves
  • Avoids unnecessary intl complications
  • Avoids inconsistency for any new pages

The homepage uses "Ethereum - The complete guide from Ethereum.org" which 1- we should lowercase "ethereum.org", and 2- we can simply opt that page out of automatically appending | ethereum.org to the end since it'd be redundant.

If you're okay with that, perhaps we revert these from this PR, merge in the hackathon changes, and we can set up an issue to fix up the og:title metadata in a separate PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue #18185 posted with refactor summary -- No harm in just pulling these in and a follow-up task can address more completely.

"page-developers-account-desc": "Contracts or people on the network",
"page-developers-accounts-link": "Accounts",
"page-developers-api-desc": "Using libraries to interact with smart contracts",
Expand Down
2 changes: 1 addition & 1 deletion src/intl/en/page-get-eth.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"page-get-eth-hero-image-alt": "Get ETH hero image",
"page-get-eth-keep-it-safe": "Keeping your ETH safe",
"page-get-eth-meta-description": "Ways to get ETH: buy on an exchange, swap on a DEX, earn from DAOs, receive from peers, or earn staking rewards. Find the best option based on where you live.",
"page-get-eth-meta-title": "How to get Ethereum (ETH)",
"page-get-eth-meta-title": "How to get Ethereum (ETH) | ethereum.org",
"page-get-eth-need-wallet": "You will need a wallet to use a DEX.",
"page-get-eth-new-to-eth": "New to ETH? Here's an overview to get you started.",
"page-get-eth-other-cryptos": "Buy with other crypto",
Expand Down
2 changes: 1 addition & 1 deletion src/intl/en/page-layer-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"page-layer-2-calloutCard-2-description": "Whether you are making a quick payment or engaging in decentralized finance (DeFi), all transactions take only a few seconds.",
"page-layer-2-calloutCard-3-title": "Backed by Ethereum",
"page-layer-2-calloutCard-3-description": "Ethereum's time-proven and decentralized blockchain functions as the settlement layer for other newer networks.",
"page-layer-2-meta-title": "Intro to Ethereum Layer 2: benefits and uses",
"page-layer-2-meta-title": "Intro to Ethereum Layer 2: benefits and uses | ethereum.org",
"page-layer-2-meta-description": "Learn about Ethereum layer 2 networks: what they are, how they help improve the Ethereum experience, and where to get started exploring",
"page-layer-2-powered-by-ethereum-title": "Powered by Ethereum",
"page-layer-2-powered-by-ethereum-description-1": "<a href=\"/\">Ethereum</a> is no longer just a single network.",
Expand Down
Loading