Skip to content

Commit fe10628

Browse files
Fix all csp non-complaint issues (#1114)
* Fix all csp non-complaint issues * Bump sphinx_airflow_theme to 0.2.1 * fix pre-commit issues
1 parent 51b3378 commit fe10628

Some content is hidden

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

79 files changed

+307
-76
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
import os
19+
import requests
20+
import json
21+
def refresh_committer_pmc_images(file_path):
22+
23+
with open(file_path) as f:
24+
pmc_committer_data = json.load(f)
25+
for data in pmc_committer_data:
26+
github_url = data.get("github")
27+
username = github_url.split("/")[-1]
28+
image_url = github_url+'.png'
29+
response = requests.get(image_url)
30+
if response.status_code == 200:
31+
with open(f'landing-pages/site/static/external/profiles/{username}.png', 'wb') as f:
32+
f.write(response.content)
33+
else:
34+
print(f"Failed to download image for {data.get('name')}")
35+
36+
37+
if __name__ == "__main__":
38+
pmc_committer_files = os.environ.get("PMC_COMMITTERS_FILES")
39+
if pmc_committer_files:
40+
file_paths = pmc_committer_files.split(",")
41+
for file_path in file_paths:
42+
refresh_committer_pmc_images(file_path)

.github/workflows/build.yml

+5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ jobs:
134134
rm -rf node_modules
135135
sudo rm -rf "$AGENT_TOOLSDIRECTORY/node"
136136
/mnt/airflow-site/.github/scripts/print_df.sh
137+
- name: 🔄Refresh PMC/COMMITTERS profiles
138+
env:
139+
PMC_COMMITTERS_FILES: landing-pages/site/data/committers.json,landing-pages/site/data/pmc.json
140+
run: |
141+
python3 ./.github/scripts/refresh_pmc_committer_images.py
137142
- name: 🚀 Amend gh-pages branch and deploy it with force (replacing previous pages)
138143
if: ${{ github.event_name == 'push' }}
139144
working-directory: dist

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ default_stages: [commit, push]
1919
default_language_version:
2020
# force all unspecified python hooks to run python3
2121
python: python3
22-
exclude: ^(docs-archive|landing-pages/site/static/external|landing-pages/site/layouts/partials/scripts.html)
22+
exclude: ^(docs-archive|landing-pages/site/static/external|landing-pages/site/layouts/partials/scripts.html|landing-pages/site/assets/scss/_variables.scss)
2323

2424
repos:
2525
- repo: meta
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
@fa-font-path : "../webfonts";
21+
22+
// Bootstrap flags. For more, see https://getbootstrap.com/docs/4.0/getting-started/theming/
23+
$enable-gradients: true;
24+
$enable-rounded: true;
25+
$enable-shadows: true;
26+
27+
// Theme flags.
28+
29+
$td-enable-google-fonts: true !default;
30+
31+
// Theme colors
32+
33+
$primary: #30638E !default;
34+
$primary-light: lighten($primary, 75%) !default;
35+
$secondary: #FFA630 !default;
36+
$success: #3772FF !default;
37+
$info: #C0E0DE !default;
38+
$warning: #ED6A5A !default;
39+
$danger: #ED6A5A !default;
40+
$white: #fff !default;
41+
$light: #D3F3EE !default;
42+
43+
$dark: #403F4C !default;
44+
$blue: #72A1E5 !default;
45+
$orange: #BA5A31 !default;
46+
$gray-100: #f8f9fa !default;
47+
$gray-200: #eee !default;
48+
$gray-300: #dee2e6 !default;
49+
$gray-400: #ccc !default;
50+
$gray-500: #adb5bd !default;
51+
$gray-600: #888 !default;
52+
$gray-700: #495057 !default;
53+
$gray-800: #333 !default;
54+
$gray-900: #222 !default;
55+
$black: #000 !default;
56+
57+
$code-color: darken($secondary, 20%) !default;
58+
59+
// UI element colors
60+
61+
$border-color: $gray-300 !default;
62+
$td-sidebar-bg-color: rgba($primary, 0.03) !default;
63+
$td-sidebar-border-color: $border-color !default;
64+
65+
// Background colors for the sections on home page etc. It is a paint by number system, starting at 0, where the number is taken from the shortcode's ordinal
66+
// if not provided by the user.
67+
// These colors are all part of the theme palette, but the mix is fairly random to create variation. This can be overridden by the project if needed.
68+
$td-box-colors: $dark, $primary, $secondary, $info, $primary-light, $gray-600, $success, $warning, $dark, $danger, $primary, $secondary, $primary-light, $info;
69+
70+
$link-color: darken($blue, 15%) !default;
71+
$link-decoration: none !default;
72+
$link-hover-color: darken($link-color, 15%) !default;
73+
$link-hover-decoration: none !default;
74+
75+
// Fonts
76+
77+
$google_font_name: "Open Sans" !default;
78+
$google_font_family: "Open+Sans:300,300i,400,400i,700,700i" !default;
79+
$web-font-path: "/external/css/OpenSans.css";
80+
81+
$td-fonts-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
82+
83+
@if $td-enable-google-fonts {
84+
$td-fonts-serif: prepend($td-fonts-serif, "#{$google_font_name}");
85+
}
86+
87+
$font-family-sans-serif: $td-fonts-serif !default;
88+
89+
$font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default;
90+
$font-family-base: $font-family-sans-serif !default;
91+
$font-size-base: 1rem !default;
92+
93+
// Font weights
94+
95+
$font-weight-light: 300 !default;
96+
$font-weight-normal: 400 !default;
97+
$font-weight-medium: 500 !default;
98+
$font-weight-bold: 700 !default;
99+
100+
$font-weight-body-text: $font-weight-normal !default;
101+
$headings-font-weight: $font-weight-medium !default;
102+
103+
// Heading sizes
104+
105+
$h1-font-size: $font-size-base * 2.25 !default;
106+
$h2-font-size: $font-size-base * 2 !default;
107+
$h3-font-size: $font-size-base * 1.5 !default;
108+
$h4-font-size: $font-size-base * 1.35 !default;
109+
$h5-font-size: $font-size-base * 1.15 !default;
110+
$h6-font-size: $font-size-base !default;
111+
112+
// Display styles
113+
114+
$display1-weight: $font-weight-bold !default;
115+
$display2-weight: $font-weight-bold !default;
116+
$display3-weight: $font-weight-bold !default;
117+
$display4-weight: $font-weight-bold !default;
118+
$display1-size: 3rem !default;
119+
$display2-size: 2.5rem !default;
120+
$display3-size: 2rem !default;
121+
$display4-size: 1.75rem !default;
122+
123+
// Space
124+
125+
$spacer: 1rem;
126+
$td-block-space-top-base: 4 * $spacer;
127+
$td-block-space-bottom-base: 4 * $spacer;
128+
129+
// Pagination
130+
131+
$pagination-color: $gray-600 !default;
132+
$pagination-border-color: rgba($black, 0.1) !default;
133+
$pagination-active-border-color: darken($primary, 5%) !default;
134+
$pagination-disabled-color: $gray-300 !default;
135+
136+
// Navbar
137+
138+
$navbar-dark-color: rgba($white, 0.75) !default;
139+
$navbar-dark-hover-color: rgba($white, 0.5) !default;
140+
$navbar-dark-active-color: $white !default;
141+
$navbar-dark-disabled-color: rgba($white, 0.25) !default;
142+
143+
// The yiq lightness value that determines when the lightness of color changes from "dark" to "light".
144+
$yiq-contrasted-threshold: 200 !default;

0 commit comments

Comments
 (0)