Improved the SEO of the documentation#15
Conversation
This commit updates the Docusaurus configuration to set the default color mode to dark and disable respecting the user's prefers-color-scheme setting.
Key changes:
- **docs/docusaurus.config.ts**:
- Added `colorMode` configuration within `themeConfig`.
- Set `defaultMode` to `'dark'`.
- Set `respectPrefersColorScheme` to `false`.
This commit updates the Docusaurus configuration and the homepage metadata for better SEO and user experience.
Key changes:
- **docs/docusaurus.config.ts**:
- `respectPrefersColorScheme` is now set to `true` to honor the user's system preference.
- Added `metadata` array with:
- `keywords` for search engine optimization.
- `twitter:card` pointing to the project banner image.
- `canonical` link to the main project URL.
- **docs/src/pages/index.tsx**:
- Updated the layout `description` to be more informative: "TriggerX is a modular, developer-friendly alarm execution library for Android".
This commit updates the `release.yaml` GitHub Actions workflow to prevent the creation of duplicate releases if a version tag already exists.
Key changes:
- **.github/workflows/release.yaml**:
- Added a `fetch-depth: 0` to the checkout action to ensure all history is available for tag checking.
- Introduced a new step "Check if version tag exists":
- This step checks if a Git tag corresponding to the `env.VERSION_NAME` already exists.
- Sets an output `version_exists` to `true` or `false`.
- All subsequent steps in the release process (Setup gradle.properties, Set up JDK, Build Library, Extract Version, Generate Changelog, Create Git Tag, Create GitHub Release, Upload Release Artifact) are now conditionally executed based on `steps.check_version.outputs.version_exists == 'false'`.
- Corrected a minor formatting issue with extra space in the `pull_request.types` trigger.
- Removed an unnecessary blank line.
WalkthroughThe updates include enhancements to the release workflow to prevent duplicate releases by checking for existing version tags before proceeding. Documentation configuration was improved by adding dark mode support and SEO metadata, and the homepage meta description was updated for better clarity and search engine optimization. Changes
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
docs/docusaurus.config.ts (1)
64-68: Correct Twitter card metadata
The canonical link and keywords tags are correctly configured. However,twitter:cardshould specify a valid card type (e.g.,summary_large_image), and you need a separatetwitter:imagetag for the banner URL..github/workflows/release.yaml (1)
88-97: Use updated release action
actions/create-release@v1works fine but consider upgrading to the latestactions/create-releaseminor version (v1.x or v2) for new features and fixes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/release.yaml(5 hunks)docs/docusaurus.config.ts(1 hunks)docs/src/pages/index.tsx(1 hunks)
🔇 Additional comments (11)
docs/src/pages/index.tsx (1)
37-37: Good SEO description update
The new meta description is concise, under 160 characters, and accurately conveys the library’s purpose.docs/docusaurus.config.ts (1)
60-63: Enable dark mode respecting user preference
ThecolorModesettings default to dark and honor system preferences, improving UX for users with dark-theme environments..github/workflows/release.yaml (9)
22-22: Fetch full git history for tag checks
Usingfetch-depth: 0ensures all tags and commits are available for the subsequent existence check.
24-35: Prevent duplicate releases by checking existing tags
Thecheck_versionstep correctly setsversion_existsbased on the presence ofv${{ env.VERSION_NAME }}.
38-43: Conditional gradle.properties setup
Gating the creation ofgradle.propertiesonversion_exists == 'false'is implemented correctly.
45-50: Conditional Java setup step
Skipping JDK setup when the version tag exists avoids unnecessary actions.
51-54: Conditional build step
Building only for new versions prevents redundant artifact compilation.
55-63: Extract version dynamically
ParsingVERSION_NAMEfromgradle.propertiesand exporting it asenv.versionis correct and consistent.
64-79: Generate changelog from git history
The fallback to the initial commit and thegit logformatting produce a concise changelog.
80-87: Tag creation and push
Configuring Git user and pushing the annotated tag only for new versions is sound.
103-112: Upload artifact with proper content type
Theupload-release-assetstep correctly usesapplication/octet-streamfor the AAR.
This commit updates the GitHub Actions workflow for releases to ensure it only runs when a pull request is merged.
Key changes:
- **.github/workflows/release.yaml**:
- Added a condition `if: github.event.pull_request.merged == true` to the `release` job.
Summary by CodeRabbit