Skip to content

Commit

Permalink
Merge branch 'ethereum:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
iepn authored Mar 24, 2024
2 parents 88b618e + 505236a commit 4eb6a12
Show file tree
Hide file tree
Showing 33 changed files with 1,057 additions and 415 deletions.
21 changes: 20 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,8 @@
"avatar_url": "https://avatars2.githubusercontent.com/u/25974464?v=4",
"profile": "https://twitter.com/wslyvh",
"contributions": [
"content"
"content",
"infra"
]
},
{
Expand Down Expand Up @@ -11450,6 +11451,24 @@
"contributions": [
"doc"
]
},
{
"login": "niuhp",
"name": "niuhp",
"avatar_url": "https://avatars.githubusercontent.com/u/7373524?v=4",
"profile": "https://github.com/niuhp",
"contributions": [
"bug"
]
},
{
"login": "xivanc",
"name": "xivanc",
"avatar_url": "https://avatars.githubusercontent.com/u/91614446?v=4",
"profile": "https://github.com/xivanc",
"contributions": [
"tool"
]
}
],
"contributorsPerLine": 7,
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/import-community-events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Import community events

on:
schedule:
- cron: "0 0 * * SUN" # Runs every Sunday at midnight
workflow_dispatch:

jobs:
create_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn install
- run: yarn events-import
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
- uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "Update community events"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://www.yazkhoury.com"><img src="https://avatars2.githubusercontent.com/u/9094204?v=4?s=100" width="100px;" alt="Yaz Khoury"/><br /><sub><b>Yaz Khoury</b></sub></a><br /><a href="#content-YazzyYaz" title="Content">🖋</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://yos.io"><img src="https://avatars3.githubusercontent.com/u/1084226?v=4?s=100" width="100px;" alt="Yos Riady"/><br /><sub><b>Yos Riady</b></sub></a><br /><a href="#content-yosriady" title="Content">🖋</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://infura.io"><img src="https://avatars2.githubusercontent.com/u/1210802?v=4?s=100" width="100px;" alt="Andrew Cohen"/><br /><sub><b>Andrew Cohen</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Aandrewjcohen" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/wslyvh"><img src="https://avatars2.githubusercontent.com/u/25974464?v=4?s=100" width="100px;" alt="Wesley van Heije"/><br /><sub><b>Wesley van Heije</b></sub></a><br /><a href="#content-wslyvh" title="Content">🖋</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/wslyvh"><img src="https://avatars2.githubusercontent.com/u/25974464?v=4?s=100" width="100px;" alt="Wesley van Heije"/><br /><sub><b>Wesley van Heije</b></sub></a><br /><a href="#content-wslyvh" title="Content">🖋</a> <a href="#infra-wslyvh" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gr0uch0dev"><img src="https://avatars1.githubusercontent.com/u/17497722?v=4?s=100" width="100px;" alt="gr0uch0dev"/><br /><sub><b>gr0uch0dev</b></sub></a><br /><a href="#content-gr0uch0dev" title="Content">🖋</a></td>
Expand Down Expand Up @@ -1780,6 +1780,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://0x13.dev"><img src="https://avatars.githubusercontent.com/u/31336254?v=4?s=100" width="100px;" alt="Ogunsina Champion"/><br /><sub><b>Ogunsina Champion</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Aayofimihan" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://ardislu.dev"><img src="https://avatars.githubusercontent.com/u/29699850?v=4?s=100" width="100px;" alt="Ardis Lu"/><br /><sub><b>Ardis Lu</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=ardislu" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/niuhp"><img src="https://avatars.githubusercontent.com/u/7373524?v=4?s=100" width="100px;" alt="niuhp"/><br /><sub><b>niuhp</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Aniuhp" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xivanc"><img src="https://avatars.githubusercontent.com/u/91614446?v=4?s=100" width="100px;" alt="xivanc"/><br /><sub><b>xivanc</b></sub></a><br /><a href="#tool-xivanc" title="Tools">🔧</a></td>
</tr>
</tbody>
</table>
Expand Down
53 changes: 53 additions & 0 deletions docs/header-ids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Custom header IDs for markdown documents

Html ID attributes are used to create links to specific sections of a document. In markdown, **custom header IDs** should be assigned to all header lines (lines that begin with one-or-more hash marks, `#`).

## Markdown syntax

A custom heading ID should follow these rules:

- Placed at the end of a heading line, preceded by a space, followed by a line break
- Wrapped in curly braces
- Starts with a hash-mark
- Uses kebab-case string
- Unique for the current page

For example:

```markdown
## My heading {#my-heading}

### A subheading {#a-subheading}

#### Or a longer title that can be shortened {#long-heading}
```

Note that for short headers, simply lowercasing and using hyphens instead of spaces is sufficient. For longer headers, a shortened concise version of the header is encouraged. Must not repeat the same ID on the same page.

## How are these used?

When these headers are rendered, they come with a link icon attached to it that can be used to quickly link to that section of the document.

Extending the above example, if we wanted to link to the `A subheading` section of the above document (for example living at path `/docs`), you could use the link`/docs#a-subheading` to link directly to that section.

See a live example on ethereum.org: [https://ethereum.org/en/developers/docs/blocks/#block-anatomy](https://ethereum.org/en/developers/docs/blocks/#block-anatomy)

## When to use custom header IDs

### English content

These should be created for header on every new English markdown document.

### Translated content

English files are uploaded to Crowdin for translation. Header ID's should be _inherited_ from the English version, and remain unchanged during translation.

This is to ensure that the translated content can be linked to from other documents and external links, without breaking the path. This is similar to why path and filenames are not translated, but remain in English to simplify linking and referencing.

See a live example on ethereum.org: [https://ethereum.org/es/developers/docs/blocks/#block-anatomy](https://ethereum.org/en/developers/docs/blocks/#block-anatomy)

Notice the header ID is still in English (`#block-anatomy`), but links to the Spanish (`/es/`) version of the site, at the correct section.

## When are these not needed?

Markdown files in the repo `/docs` (such as this one) do not require custom header IDs, as they are not yet displayed on the website, and do not have translated versions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"chromatic": "chromatic --project-token fee8e66c9916",
"crowdin-clean": "rm -rf .crowdin && mkdir .crowdin",
"crowdin-import": "ts-node src/scripts/crowdin-import.ts",
"events-import": "ts-node -O '{ \"module\": \"commonjs\" }' src/scripts/events-import.ts",
"markdown-checker": "ts-node -O '{ \"module\": \"commonjs\" }' src/scripts/markdownChecker.ts"
},
"dependencies": {
Expand Down
5 changes: 5 additions & 0 deletions public/content/developers/docs/apis/backend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ These libraries abstract away much of the complexity of interacting directly wit
- [NOWNodes.io](https://nownodes.io/)
- [Documentation](https://documenter.getpostman.com/view/13630829/TVmFkLwy#intro)

**Node RPC - _Cost-effective EVM JSON RPC provider_**

- [noderpc.xyz](https://www.noderpc.xyz/)
- [Documentation](https://docs.noderpc.xyz/)

**Moralis -** **_Enterprise-Grade EVM API Provider._**

- [moralis.io](http://moralis.io)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ module.exports = {
}
```

## 步骤 14:编写合约 {#step-14-compile-our-contracts}
## 步骤 14:编译合约 {#step-14-compile-our-contracts}

为了确保一切正常,我们来编译一下合约。 `compile` 任务是安全帽的内部任务之一。

Expand Down
Binary file added public/fonts/inter/cyrillic-ext.woff2
Binary file not shown.
Binary file added public/fonts/inter/cyrillic.woff2
Binary file not shown.
Binary file added public/fonts/inter/greek-ext.woff2
Binary file not shown.
Binary file added public/fonts/inter/greek.woff2
Binary file not shown.
Binary file added public/fonts/inter/latin-ext.woff2
Binary file not shown.
Binary file added public/fonts/inter/latin.woff2
Binary file not shown.
Binary file added public/fonts/inter/vietnamese.woff2
Binary file not shown.
Binary file modified public/translation-program/pageviews-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/translation-program/pageviews-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/components/Glossary/GlossaryDefinition/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ const GlossaryDefinition = ({
transform={components}
/>
</OldHeading>
<Text {...textStyles}>
{/**
* `as="span"` prevents hydration warnings for strings that contain
* elements that cannot be nested inside `p` tags, like `ul` tags
* (found in some Glossary definition).
* TODO: Develop a better solution to handle this case.
*/}
<Text as="span" {...textStyles}>
<Translation
id={term + "-definition"}
options={options}
Expand Down
13 changes: 13 additions & 0 deletions src/components/Glossary/GlossaryTooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import React, { ReactNode } from "react"
import { useRouter } from "next/router"
import { Box, Text } from "@chakra-ui/react"

import GlossaryDefinition from "@/components/Glossary/GlossaryDefinition"
import Tooltip from "@/components/Tooltip"

import { trackCustomEvent } from "@/lib/utils/matomo"
import { cleanPath } from "@/lib/utils/url"

type GlossaryTooltipProps = {
children: ReactNode
termKey: string
}

const GlossaryTooltip = ({ children, termKey }: GlossaryTooltipProps) => {
const { asPath } = useRouter()

return (
<Box display="inline-block">
<Tooltip
Expand All @@ -20,6 +26,13 @@ const GlossaryTooltip = ({ children, termKey }: GlossaryTooltipProps) => {
options={{ ns: "glossary-tooltip" }}
/>
}
onOpen={() => {
trackCustomEvent({
eventCategory: "Glossary Tooltip",
eventAction: cleanPath(asPath),
eventName: termKey,
})
}}
>
<Text
as="u"
Expand Down
4 changes: 2 additions & 2 deletions src/components/UpcomingEventsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import InlineLink from "@/components/Link"

import { trackCustomEvent } from "@/lib/utils/matomo"

import communityConferences from "@/data/community-events"
import communityEvents from "@/data/community-events.json"

type OrderedUpcomingEvent = CommunityConference & {
date: string
Expand All @@ -37,7 +37,7 @@ const UpcomingEventsList = () => {
}

useEffect(() => {
const eventsList: CommunityConference[] = [...communityConferences]
const eventsList = communityEvents as CommunityConference[]
const yesterday = new Date()
yesterday.setDate(yesterday.getDate() - 1)

Expand Down
Loading

0 comments on commit 4eb6a12

Please sign in to comment.