Skip to content

Commit d233d6a

Browse files
authored
Merge branch 'main' into doc_crowdin
2 parents b01e7b8 + 5d3476b commit d233d6a

File tree

122 files changed

+5053
-2130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+5053
-2130
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Create Translations PR
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
language_code:
7+
description: 'Crowdin language code for the language of interest'
8+
required: true
9+
10+
jobs:
11+
create-translations-pr:
12+
runs-on: ubuntu-latest
13+
# Run only on main branch in upstream repo.
14+
if: ${{ github.repository == 'numpy/numpy.org' && github.ref == 'refs/heads/main' }}
15+
steps:
16+
- name: Checkout numpy.org
17+
uses: actions/checkout@v4
18+
with:
19+
repository: 'numpy/numpy.org'
20+
path: 'numpy.org'
21+
ref: 'main'
22+
fetch-depth: 0 # Gets full github history.
23+
# Full history is needed for the scripted interactive rebase
24+
# which takes place in create_branch_for_language.sh below.
25+
persist-credentials: false
26+
27+
- name: Checkout scientific-python-translations automations
28+
uses: actions/checkout@v4
29+
with:
30+
repository: 'scientific-python-translations/automations'
31+
path: 'automations'
32+
ref: 'main'
33+
persist-credentials: false
34+
35+
- name: Create translations branch for language of interest
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
LANG: ${{ github.event.inputs.language_code }}
39+
run: |
40+
git config --global user.email "[email protected]"
41+
git config --global user.name "GitHub Actions"
42+
../automations/scripts/create_branch_for_language.sh origin main l10n_main "$LANG"
43+
branch_name=$(git rev-parse --abbrev-ref HEAD)
44+
git push -u origin "$branch_name"
45+
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
46+
working-directory: ./numpy.org
47+
48+
- name: Create Pull Request
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
52+
LANG: ${{ github.event.inputs.language_code }}
53+
run: |
54+
language_name=$(../automations/scripts/get_language_name.sh "$LANG")
55+
gh pr create --base main --head "$BRANCH_NAME" --title "Update translations for $language_name" \
56+
--body "This PR to update translations for $language_name was generated by the GitHub workflow, \
57+
auto-translations-pr.yml and includes all commits from this repo's Crowdin branch for the language \
58+
of interest. A final check of the rendered docs is needed to identify if there are any formatting \
59+
errors due to incorrect string segmentation by Crowdin. If there are such formatting errors, they \
60+
should be fixed directly on this branch, not through Crowdin."
61+
working-directory: ./numpy.org

.github/workflows/gh-pages.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,44 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
with:
26+
persist-credentials: false
2627
submodules: recursive
2728
fetch-depth: 0
2829

2930
- name: Read Hugo version
3031
id: hugo-version
3132
run: cat netlify.toml | grep HUGO_VERSION | tr -d ' "' >> "$GITHUB_OUTPUT"
3233

34+
- name: Read DART SASS version
35+
id: dart-sass-version
36+
run: cat netlify.toml | grep --max-count=1 DART_SASS_VERSION | tr -d ' "' >> "$GITHUB_OUTPUT"
37+
3338
- name: Install Hugo CLI
3439
env:
3540
HUGO_VERSION: ${{ steps.hugo-version.outputs.HUGO_VERSION }}
3641
run: |
37-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
38-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
42+
wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
43+
&& sudo dpkg -i /tmp/hugo.deb
44+
45+
- name: Install Dart Sass
46+
env:
47+
DART_SASS_VERSION: ${{ steps.dart-sass-version.outputs.DART_SASS_VERSION }}
48+
DART_SASS_URL: "https://github.com/sass/dart-sass/releases/download/"
49+
run: |
50+
export DART_SASS_TARBALL="dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" && \
51+
curl -LJO ${DART_SASS_URL}/${DART_SASS_VERSION}/${DART_SASS_TARBALL} && \
52+
tar -xf ${DART_SASS_TARBALL} && \
53+
rm ${DART_SASS_TARBALL}
3954
4055
- name: Generate config
4156
run: python gen_config.py
4257

4358
- name: Build with Hugo
44-
run: hugo --gc --minify
59+
run: |
60+
export PATH=$(pwd)/dart-sass:$PATH
61+
hugo --gc --minify
4562
4663
- name: Deploy pages
4764
uses: JamesIves/github-pages-deploy-action@releases/v4

Makefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,29 @@ prepare:
1818
git submodule update --init
1919
python gen_config.py
2020

21-
TEAMS_DIR = static/gallery
21+
# All translations share the <team>.toml files in the en translation
22+
TEAMS_DIR = content/en/teams
2223
TEAMS = emeritus-maintainers maintainers docs-team triage-team survey-team web-team
2324
TEAMS_QUERY = python themes/scientific-python-hugo-theme/tools/team_query.py
2425

25-
$(TEAMS_DIR):
26-
mkdir -p $(TEAMS_DIR)
27-
28-
$(TEAMS_DIR)/%.md: $(TEAMS_DIR)
29-
$(TEAMS_QUERY) --org numpy --team "$*" > $(TEAMS_DIR)/$*.html
26+
$(TEAMS_DIR)/%.toml:
27+
$(TEAMS_QUERY) --org numpy --team "$*" > $(TEAMS_DIR)/$*.toml
3028

3129
teams-clean: prepare
3230
for team in $(TEAMS); do \
33-
rm -f $(TEAMS_DIR)/$${team}.html ;\
31+
rm -f $(TEAMS_DIR)/$${team}.toml ;\
3432
done
3533

36-
teams: | teams-clean $(patsubst %,$(TEAMS_DIR)/%.md,$(TEAMS)) ## generates numpy.org team gallery pages
34+
teams: | teams-clean $(patsubst %,$(TEAMS_DIR)/%.toml,$(TEAMS)) ## generates numpy.org team gallery pages
3735

3836
serve: prepare ## serve the website
3937
hugo $(BASEURLARG) --printI18nWarnings server -D
4038

39+
# Serve the site for development purposes (leaving submodules as-is, etc).
40+
serve-dev:
41+
python gen_config.py
42+
hugo $(BASEURLARG) --printI18nWarnings server --buildDrafts --disableFastRender --poll 1000ms
43+
4144
html: prepare ## build the website in ./public
4245
hugo $(BASEURLARG)
4346

assets/css/casestudies.css

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
padding: 30px;
33
}
44

5-
.casestudies a:hover {
6-
text-decoration: none;
7-
color:black
8-
}
9-
105
.casestudies-title {
116
display: flex;
127
justify-content: center;
@@ -28,10 +23,6 @@
2823
border-radius: 3px;
2924
}
3025

31-
.casestudies a {
32-
color: var(--colorPrimaryDark) !important;
33-
}
34-
3526
.casestudies-box-title {
3627
margin: 15px;
3728
font-size: 16px;
@@ -58,11 +49,10 @@
5849

5950
.casestudies-underline {
6051
display: inline-block;
61-
vertical-align: middle;
6252
-webkit-transform: perspective(1px) translateZ(0);
6353
transform: perspective(1px) translateZ(0);
64-
/* Black, with 10% opacity */
65-
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
54+
border: .02em solid var(--pst-color-border);
55+
box-shadow: 0 .2rem .5rem var(--pst-color-shadow),0 0 .0625rem var(--pst-color-shadow);
6656
position: relative;
6757
overflow: hidden;
6858
}
@@ -74,7 +64,6 @@
7464
left: 0;
7565
right: 100%;
7666
bottom: 0;
77-
background: var(--colorPrimaryDark);
7867
height: 4px;
7968
-webkit-transition-property: right;
8069
transition-property: right;

assets/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.hero-title,
2+
.navbar-logo-text {
3+
font-family: "Lato";
4+
}

assets/css/mailchimp.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,29 @@
1111
}
1212

1313
.sign-up-image {
14+
height: 35px;
1415
padding: 5px 10px 6px 10px;
15-
border-right: 1px solid var(--colorSecondary);
16-
background-color: var(--colorSecondary);
16+
border-right: 1px solid var(--spht-color-dark);
17+
background-color: var(--spht-color-light);
1718
border-radius: 5px 0 0 5px;
1819
}
1920

2021
#footer .sign-up-image svg.icon {
21-
fill: var(--colorPrimaryDark);
22+
fill: var(--spht-color-dark);
2223
width: 1.25rem;
2324
height: 1.25rem;
2425
padding-bottom: 2px;
2526
}
2627

2728
.sign-up-input {
28-
background-color: var(--colorSecondary);
29+
background-color: var(--spht-color-light);
2930
border-radius: 0 5px 5px 0;
3031
border: none;
3132
width: 75%;
3233
height: 35px;
3334
padding-left: 5px;
3435
font-size: 14px;
35-
color: var(--colorPrimaryDark);
36+
color: var(--spht-color-dark);
3637
}
3738

3839
.submission-instructions {
@@ -47,7 +48,7 @@
4748
}
4849

4950
#footer .signup-button svg.icon {
50-
fill: var(--colorPrimaryDark);
51+
fill: var(--spht-color-dark);
5152
width: 1.6rem;
5253
height: 1.6rem;
5354
padding-bottom: 2px;
@@ -57,9 +58,9 @@
5758
.thank-you {
5859
display: none;
5960
height: 75px;
60-
color: var(--colorSecondary);
61+
color: var(--spht-color-light);
6162
align-items: center;
62-
color: var(--colorSecondary);
63+
color: var(--spht-color-light);
6364
}
6465

6566
@media only screen and (max-width: 1150px) {

assets/css/shell.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
.hero-right {
22
display: flex;
33
flex-direction: column;
4-
/* Black, with 10% opacity */
5-
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
6-
background: rgb(238, 238, 238);
74
padding: 15px;
5+
background: var(--pst-color-surface);
86
}
97

108
.numpy-shell-canvas {
@@ -24,7 +22,7 @@
2422

2523
.numpy-shell {
2624
flex: 2;
27-
padding: 0 15px;
25+
border: 1px solid var(--pst-color-border);
2826
}
2927

3028
.shell-title-container {
@@ -48,9 +46,14 @@
4846
}
4947

5048
.shell-lesson .highlight pre {
49+
background-color: var(--pst-gray-800);
5150
height: 100%;
5251
}
5352

53+
.shell-lesson .highlight pre code{
54+
color: #f3c7ee;
55+
}
56+
5457
.shell-lesson > p {
5558
margin: 2px 0 2px 0;
5659
}

0 commit comments

Comments
 (0)