diff --git a/.github/workflows/create-jira-issue.yml b/.github/workflows/create-jira-issue.yml new file mode 100644 index 0000000..3615af1 --- /dev/null +++ b/.github/workflows/create-jira-issue.yml @@ -0,0 +1,15 @@ +name: Create Jira issue + +on: + issues: + types: [labeled] + +jobs: + call-create-jira-issue-workflow: + uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.8.2 + secrets: + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }} + JIRA_FIELDS: ${{ secrets.JIRA_FIELDS }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index db5df4d..209c902 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -3,35 +3,5 @@ name: Static analysis on: push jobs: - gitleaks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Scan for secrets with gitleaks - uses: zricethezav/gitleaks-action@master - - - trufflehog: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - - name: Install dependencies - run: | - python -m pip install trufflehog gitdb2=="2.*" - - - name: Scan for secrets with trufflehog - run: | - git fetch origin +refs/tags/*:refs/tags/* - export LAST_TAG_HASH=$(git show-ref --hash -- $(git describe --abbrev=0)) - trufflehog --regex --entropy True --since_commit "${LAST_TAG_HASH}" \ - --exclude_paths .trufflehog.txt file://"${PWD}" + call-secrets-analysis-workflow: + uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.8.2 diff --git a/.github/workflows/tag-and-distribute.yml b/.github/workflows/tag-and-distribute.yml index d69eb96..351b24e 100644 --- a/.github/workflows/tag-and-distribute.yml +++ b/.github/workflows/tag-and-distribute.yml @@ -98,4 +98,6 @@ jobs: - name: Pip install ${{ needs.package.outputs.SDIST_VERSION }} shell: bash -l {0} run: | + sleep 30s + python -m pip install --upgrade pip python -m pip install mkdocs-asf-theme==${{ needs.package.outputs.SDIST_VERSION }} diff --git a/.gitleaks.toml b/.gitleaks.toml deleted file mode 100644 index cddfcd7..0000000 --- a/.gitleaks.toml +++ /dev/null @@ -1,55 +0,0 @@ -title = "gitleaks config" -[[rules]] - description = "AWS Manager ID" - regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' - tags = ["key", "AWS"] -[[rules]] - description = "AWS Secret Key" - regex = '''(?i)aws(.{0,20})?(?-i)[0-9a-zA-Z\/+]{40}''' - tags = ["key", "AWS"] -[[rules]] - description = "AWS MWS key" - regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''' - tags = ["key", "AWS", "MWS"] -[[rules]] - description = "Github" - regex = '''(?i)github(.{0,20})?(?-i)[0-9a-zA-Z]{35,40}''' - tags = ["key", "Github"] -[[rules]] - description = "Asymmetric Private Key" - regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----''' - tags = ["key", "AsymmetricPrivateKey"] -[[rules]] - description = "Generic Credential" - regex = '''(?i)(api_key|apikey|secret|password|pass|pw|key)(.{0,20})?[0-9a-zA-Z]{16,45}''' - tags = ["key", "API", "generic"] - [[rules.whitelist]] - regex = '''KeyChecking.no.*''' - description = "Ignore ssh settings for GitLab tools-bot" -[[rules]] - description = "Google API key" - regex = '''AIza[0-9A-Za-z\\-_]{35}''' - tags = ["key", "Google"] -[[rules]] - description = "Google (GCP) Service Account" - regex = '''"type": "service_account"''' - tags = ["key", "Google"] -[[rules]] - description = "Heroku API key" - regex = '''(?i)heroku(.{0,20})?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''' - tags = ["key", "Heroku"] -[[rules]] - description = "MailChimp API key" - regex = '''(?i)(mailchimp|mc)(.{0,20})?[0-9a-f]{32}-us[0-9]{1,2}''' - tags = ["key", "Mailchimp"] -[[rules]] - description = "Mailgun API key" - regex = '''((?i)(mailgun|mg)(.{0,20})?)?key-[0-9a-z]{32}''' - tags = ["key", "Mailgun"] -[[rules]] - description = "Slack Webhook" - regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}''' - tags = ["key", "slack"] -[whitelist] - description = "Whitelisted files" - files = ['''(^.*gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)$)'''] diff --git a/.trufflehog.txt b/.trufflehog.txt index a68ca36..5701147 100644 --- a/.trufflehog.txt +++ b/.trufflehog.txt @@ -1,2 +1 @@ -.*gitleaks.toml$ .*mkdocs_theme.yml$ diff --git a/CHANGELOG.md b/CHANGELOG.md index d99d21e..3c0e2ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.0] + +### Changed +- Upgraded `mkdocs-material` to v9.4.2. We have updated our templates in [asf_theme/partials](./asf_theme/partials) to match the [upstream versions](https://github.com/squidfunk/mkdocs-material/tree/9.4.2/src/templates/partials) as closely as possible. This introduces breaking changes. In particular: + - If you want a footer, you should make the following change to your website's `mkdocs.yml` file: + ```diff + theme: + features: + + - navigation.footer + ``` + - You should carefully review your website to confirm that everything still renders and functions as expected. + - If anything does not work as expected, you may want to read the [`mkdocs-material` upgrade guide](https://squidfunk.github.io/mkdocs-material/upgrade/) starting at [Upgrading from 6.x to 7.x](https://squidfunk.github.io/mkdocs-material/upgrade/#upgrading-from-6x-to-7x) for any other important changes that may apply to your website. + +### Removed +- Analytics is no longer provided by default. You should follow to enable analytics for your website. + +### Fixed +- Fixed by upgrading `mkdocs-material`. ## [0.2.4](https://github.com/ASFHyP3/mkdocs-asf-theme/compare/v0.2.3...v0.2.4) @@ -17,7 +35,6 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - ASF logo and background map now appear correctly in "Project" or repo level sites - ## [0.2.2](https://github.com/ASFHyP3/mkdocs-asf-theme/compare/v0.2.1...v0.2.2) ### Changed diff --git a/README.md b/README.md index a623c03..7293f50 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ which generates [ASF HyP3's documentation](https://hyp3-docs.asf.alaska.edu/). ## Customization +> [!WARNING] +> You should NOT include the `navigation.instant` feature in your `mkdocs.yml`. +> See for more information. + This theme has been developed with sensible defaults to be used out-of-the-box by ASF documentation sites. While sections below describe how to customize the ASF-specific features of this theme, we hope most users won't need them. @@ -42,21 +46,8 @@ consider either: ### Analytics -This theme will provide Google Analytics integration for an ASF documentation site. -However, analytics can be customized in your `mkdocs.yml` with -```yaml -google_analytics: - - UA-XXXXXXXX-X - - auto # or a specific site URL -``` - -To turn off analytics entirely, remove the site level `google_analytics` -configuration and clear the theme one with -```yaml -theme: - name: asf-theme - google_analytics: -``` +You can follow +to enable analytics for your site. ### Logos @@ -145,3 +136,29 @@ theme: - icon: fontawesome/brands/gitter link: https://gitter.im/ASFHyP3/community ``` + +## Development + +### Upgrading `mkdocs-material` to a new major version + +When upgrading the `mkdocs-material` dependency to a new major version, +you should reference the [upgrade guide](https://squidfunk.github.io/mkdocs-material/upgrade/) +for any important changes. + +In particular, you should update each template `.html` file in [asf_theme/partials](./asf_theme/partials) +to match the latest upstream version as closely as possible. +Each template file should include a comment near the top of the file +with a link to the upstream version upon which it was based. +When updating a particular template file, +you can `diff` it against the linked upstream version to see what changes were made. +Then you can apply those changes to the *latest* upstream version of the file. + +For example, when updating `header.html` from major version 9 to 10, +you can `diff` our version of `header.html` against the `9.x.x` upstream version linked near the top of the file. +Then you can download the latest `10.x.x` upstream version from +and apply the `diff` changes, adapting them as necessary for the latest version of `mkdocs-material`. + +You may also have to update +[asf_theme/assets/stylesheets/asf.css](./asf_theme/assets/stylesheets/asf.css), +[asf_theme/main.html](./asf_theme/main.html), +and [asf_theme/mkdocs_theme.yml](./asf_theme/mkdocs_theme.yml) as appropriate. diff --git a/asf_theme/assets/stylesheets/asf.css b/asf_theme/assets/stylesheets/asf.css index 2f28529..f9b0ed8 100644 --- a/asf_theme/assets/stylesheets/asf.css +++ b/asf_theme/assets/stylesheets/asf.css @@ -11,29 +11,38 @@ a { } .md-header, .md-footer { - background: rgb(101, 102, 92); - background: linear-gradient(180deg, rgba(101, 102, 92, 1) 0%, rgba(106, 106, 106, 1) 100%); box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.5); transition: background 0.3s, border 0.3s, border-radius 0.3s, box-shadow 0.3s; - } -.md-header-nav__button.md-logo img { - height: 2.0rem; - width: auto; - display: inline-block; - margin-top: -7px; +.md-header { + background: rgb(101, 102, 92); + background: linear-gradient(180deg, rgba(101, 102, 92, 1) 0%, rgba(106, 106, 106, 1) 100%); } -.md-footer-nav { +.md-footer { + background: rgb(106, 106, 106); background-image: url("../images/map.png"); background-repeat: no-repeat; background-size: cover; background-position: center center; - min-height: 510px; + min-height: 574px; border-top: 58px solid #ffcd00; } +.md-header__button.md-logo img { + height: 2.0rem; + width: auto; + display: inline-block; + margin-top: -7px; +} + +.md-footer-meta.md-typeset { + position: absolute; + bottom: 0; + width: 100%; +} + .md-footer-container { display: flex; flex-direction: row; @@ -82,14 +91,28 @@ a { background-color: black; } -.md-footer-copyright-link { +.md-copyright-link { color: #1bb0ce !important; } -.md-footer-copyright { +.md-copyright { margin-left: 0; } +.md-nav__title { + color: black; +} + +.md-nav--primary .md-nav__title { + background: #f8f8f8; + box-shadow: none; +} + +.md-nav--secondary .md-nav__title { + background: #f8f8f8; + box-shadow: none; +} + .expert-rec-search { margin-top: 10px; } diff --git a/asf_theme/main.html b/asf_theme/main.html index b0bfb27..3a44f2b 100644 --- a/asf_theme/main.html +++ b/asf_theme/main.html @@ -1,3 +1,4 @@ + {% extends "base.html" %} {% block styles %} {{ super() }} @@ -19,11 +20,6 @@ data-current-daac="ASF DAAC"> {% endblock %} -{% block analytics %} - {% if config.google_analytics or config.theme.google_analytics %} - {% include "partials/integrations/analytics.html" %} - {% endif %} -{% endblock %} {% block scripts %} {{ super() }} diff --git a/asf_theme/mkdocs_theme.yml b/asf_theme/mkdocs_theme.yml index cab50c7..d33df7c 100644 --- a/asf_theme/mkdocs_theme.yml +++ b/asf_theme/mkdocs_theme.yml @@ -24,8 +24,3 @@ social: link: https://twitter.com/Ak_Satellite - icon: fontawesome/brands/youtube link: https://www.youtube.com/channel/UChCfI0oVWw4qDwEidnDskJQ - -# ASF's Google Analytics -google_analytics: - - UA-991100-5 - - search.asf.alaska.edu diff --git a/asf_theme/partials/logo.html b/asf_theme/partials/copyright.html similarity index 51% rename from asf_theme/partials/logo.html rename to asf_theme/partials/copyright.html index 59844c9..48310b2 100644 --- a/asf_theme/partials/logo.html +++ b/asf_theme/partials/copyright.html @@ -1,5 +1,5 @@ - -{% if config.theme.logo %} - -{% elif config.theme.icon.logo %} - {% include ".icons/" ~ config.theme.icon.logo ~ ".svg" %} -{% endif %} + + + + + + {% if config.copyright or config.theme.copyright %} + © + + {{ config.copyright if config.copyright else config.theme.copyright}} + {% endif %} + + + + UA is an AA/EO employer and educational institution and prohibits + illegal discrimination against any individual + + + diff --git a/asf_theme/partials/footer.html b/asf_theme/partials/footer.html index 46c1b4a..2fc460e 100644 --- a/asf_theme/partials/footer.html +++ b/asf_theme/partials/footer.html @@ -1,5 +1,5 @@ -{% import "partials/language.html" as lang with context %} + - +