Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .ci/scripts/check-support-links.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
# Check for non-standard InfluxData support links.
#
# Allowed URLs:
# https://support.influxdata.com (Support home)
# https://support.influxdata.com/s/contactsupport (Contact Support)
#
# Usage:
# check-support-links.sh [file ...]
# - With args: check only the given files
# - Without args: check all content/**/*.md

set -euo pipefail

# Step 1: find lines containing support.influxdata.com with any path
FIND_PATTERN='https://support\.influxdata\.com/'

# Step 2: exclude the one allowed path (/s/contactsupport not followed by more path)
ALLOW_PATTERN='https://support\.influxdata\.com/s/contactsupport([^[:alnum:]/]|$)'

# Run grep on explicit file args or default to find + grep
if [[ $# -gt 0 ]]; then
md_files=()
for f in "$@"; do
[[ -f "$f" && "$f" == *.md ]] && md_files+=("$f")
done
if [[ ${#md_files[@]} -eq 0 ]]; then
echo "No markdown files to check."
exit 0
fi
MATCHES=$(grep -Hn "$FIND_PATTERN" "${md_files[@]}" || true)
else
MATCHES=$(find content -name '*.md' -type f -print0 \
| xargs -0 grep -Hn "$FIND_PATTERN" || true)
fi

# Filter out the allowed contact support URL
MATCHES=$(echo "$MATCHES" | grep -vE "$ALLOW_PATTERN" || true)

if [[ -n "$MATCHES" ]]; then
echo "$MATCHES"
echo ""
echo "ERROR: Found non-standard support.influxdata.com URLs."
echo "Allowed URLs:"
echo " https://support.influxdata.com"
echo " https://support.influxdata.com/s/contactsupport"
echo "See DOCS-CONTRIBUTING.md for details."
exit 1
fi
6 changes: 6 additions & 0 deletions .github/workflows/pr-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ jobs:
echo "No content changes detected in this PR - skipping link check"
echo "✅ **No content changes detected** - link check skipped" >> $GITHUB_STEP_SUMMARY

- name: Validate support links
if: steps.detect.outputs.has-changes == 'true'
run: |
echo "${{ steps.detect.outputs.changed-content }}" | tr ' ' '\n' | \
xargs -r .ci/scripts/check-support-links.sh

- name: Setup Node.js
if: steps.detect.outputs.has-changes == 'true'
uses: actions/setup-node@v4
Expand Down
65 changes: 45 additions & 20 deletions DOCS-CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Contributing to InfluxData Documentation

<!-- agent:instruct: essential -->

## Quick Start

Ready to contribute?
Expand All @@ -14,7 +15,7 @@ Ready to contribute?

For detailed setup and reference information, see the sections below.

---
***

## Legal & Getting Started

Expand All @@ -27,18 +28,19 @@ What constitutes a "substantial" change is at the discretion of InfluxData docum

[Sign the InfluxData CLA](https://www.influxdata.com/legal/cla/)

_**Note:** Typo and broken link fixes are greatly appreciated and do not require signing the CLA._
***Note:** Typo and broken link fixes are greatly appreciated and do not require signing the CLA.*

_If you're new to contributing or you're looking for an easy update, see [`docs-v2` good-first-issues](https://github.com/influxdata/docs-v2/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue)._
*If you're new to contributing or you're looking for an easy update, see [`docs-v2` good-first-issues](https://github.com/influxdata/docs-v2/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue).*

### Fork and clone InfluxData Documentation Repository

[Fork this repository](https://help.github.com/articles/fork-a-repo/) and
[clone it](https://help.github.com/articles/cloning-a-repository/) to your local machine.

---
***

<!-- agent:instruct: condense -->

## Development Environment Setup

### Prerequisites
Expand Down Expand Up @@ -76,9 +78,9 @@ dev dependencies used in pre-commit hooks for linting, syntax-checking, and test
Dev dependencies include:

- [Lefthook](https://github.com/evilmartians/lefthook): configures and
manages git pre-commit and pre-push hooks for linting and testing Markdown content.
manages git pre-commit and pre-push hooks for linting and testing Markdown content.
- [prettier](https://prettier.io/docs/en/): formats code, including Markdown, according to style rules for consistency
- [Cypress]: e2e testing for UI elements and URLs in content
- \[Cypress]: e2e testing for UI elements and URLs in content

### Install Vale (style linting)

Expand Down Expand Up @@ -114,11 +116,11 @@ docs-v2 contains a `./.vscode/settings.json` that configures the following exten
- Vale: shows linter errors and suggestions in the editor.
- YAML Schemas: validates frontmatter attributes.

---
***

<!-- agent:instruct: condense -->
## Making Changes

## Making Changes

### Style Guidelines

Expand All @@ -130,7 +132,7 @@ Content follows Google Developer Documentation Style Guide and YouTube API docum

Most docs-v2 documentation content uses [Markdown](https://en.wikipedia.org/wiki/Markdown).

_Some parts of the documentation, such as `./api-docs`, contain Markdown within YAML and rely on additional tooling._
*Some parts of the documentation, such as `./api-docs`, contain Markdown within YAML and rely on additional tooling.*

#### Semantic line feeds

Expand Down Expand Up @@ -166,6 +168,23 @@ Save images using the following naming format: `project/version-context-descript
For example, `influxdb/2-0-visualizations-line-graph.png` or `influxdb/2-0-tasks-add-new.png`.
Specify a version other than 2.0 only if the image is specific to that version.

#### InfluxData Support links

When linking to InfluxData Support, use one of these URLs:

```markdown
[InfluxData support](https://support.influxdata.com)
[contact InfluxData support](https://support.influxdata.com/s/contactsupport)
```

**Do not use**:

- `https://support.influxdata.com/` (trailing slash)
- `https://support.influxdata.com/s/login/?ec=302&startURL=%2Fs%2Fcontactsupport` (login redirect)
- Any other `support.influxdata.com` path

The pre-commit hook will check for and reject non-standard support link formats.

### Essential Frontmatter Reference

Every documentation page includes frontmatter which specifies information about the page.
Expand Down Expand Up @@ -270,6 +289,7 @@ Documentation audit tools should:
4. Support both single-line and multi-line exclusion lists

<!-- agent:instruct: essential -->

### Common Shortcodes Reference

#### Callouts (notes and warnings)
Expand Down Expand Up @@ -327,7 +347,7 @@ For the complete shortcodes reference with all available shortcodes and usage ex

Test shortcodes with working examples in **[content/example.md](content/example.md)**.

---
***

### InfluxDB API documentation

Expand All @@ -338,11 +358,10 @@ InfluxDB API documentation when documentation is deployed.
For more information about editing and generating InfluxDB API documentation, see the
[API Documentation README](https://github.com/influxdata/docs-v2/tree/master/api-docs#readme).

---
***

## Testing & Quality Assurance


Pre-commit hooks run automatically when you commit changes, testing your staged files with Vale, Prettier, Cypress, and Pytest. To skip hooks if needed:

```sh
Expand All @@ -364,13 +383,14 @@ yarn test:links content/influxdb3/core/**/*.md

For comprehensive testing information, including code block testing, link validation, style linting, and advanced testing procedures, see **[DOCS-TESTING.md](DOCS-TESTING.md)**.


---
***

<!-- agent:instruct: condense -->

## Submission Process

<!-- agent:instruct: essential -->

### Commit Guidelines

When creating commits, follow these guidelines:
Expand All @@ -383,6 +403,7 @@ When creating commits, follow these guidelines:
- For multiple issues, use comma separation: `closes influxdata/DAR#517, closes influxdata/DAR#518`

**Examples:**

```
fix(enterprise): correct Docker environment variable name for license email
fix(influxdb3): correct Docker environment variable and compose examples for monolith
Expand All @@ -394,7 +415,7 @@ chore(ci): update Vale configuration

Push your changes up to your forked repository, then [create a new pull request](https://help.github.com/articles/creating-a-pull-request/).

---
***

## Reference Documentation

Expand All @@ -404,6 +425,7 @@ For detailed reference documentation, see:
- **[DOCS-SHORTCODES.md](DOCS-SHORTCODES.md)** - Complete shortcodes reference with usage examples for all available shortcodes

<!-- agent:instruct: condense -->

### Advanced Configuration

#### Vale style linting configuration
Expand Down Expand Up @@ -434,6 +456,7 @@ To add accepted/rejected terms for specific products, configure a style for the
To learn more about configuration and rules, see [Vale configuration](https://vale.sh/docs/topics/config).

<!-- agent:instruct: condense -->

#### JavaScript in the documentation UI

The InfluxData documentation UI uses TypeScript and JavaScript with ES6+ syntax and
Expand All @@ -450,13 +473,14 @@ If you're adding UI functionality that requires JavaScript, follow these steps:

```html
<div data-component="my-component"></div>
```
```

2. Following the component pattern, create a single-purpose JavaScript module
(`assets/js/components/my-component.js`)
that exports a single function that receives the component element and initializes it.

3. In `assets/js/main.js`, import the module and register the component to ensure
the component is initialized on page load.
the component is initialized on page load.

##### Debugging JavaScript

Expand All @@ -470,7 +494,7 @@ To debug JavaScript code used in the InfluxData documentation UI, choose one of
1. In VS Code, select Run > Start Debugging.
2. Select the "Debug Docs (source maps)" configuration.
3. Click the play button to start the debugger.
5. Set breakpoints in the JavaScript source files--files in the
4. Set breakpoints in the JavaScript source files--files in the
`assets/js/ns-hugo-imp:` namespace-- in the
VS Code editor or in the Chrome Developer Tools Sources panel:

Expand All @@ -484,8 +508,9 @@ To debug JavaScript code used in the InfluxData documentation UI, choose one of
1. In your JavaScript module, import debug helpers from `assets/js/utils/debug-helpers.js`.
These helpers provide breakpoints and console logging as a workaround or alternative for
using source maps and the Chrome DevTools debugger.

2. Insert debug statements by calling the helper functions in your code--for example:

```js
import { debugLog, debugBreak, debugInspect } from './utils/debug-helpers.js';

Expand All @@ -512,4 +537,4 @@ Your system uses the configuration in `launch.json` to launch the site in Chrome
and attach the debugger to the Developer Tools console.

Make sure to remove the debug statements before merging your changes.
The debug helpers are designed to be used in development and should not be used in production.
The debug helpers are designed to be used in development and should not be used in production.
4 changes: 4 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pre-commit:
fi
exit $errors
fail_text: "Deprecated markdown patterns found. See messages above for details."
check-support-links:
tags: lint
glob: "content/**/*.md"
run: .ci/scripts/check-support-links.sh {staged_files}
eslint-debug-check:
glob: "assets/js/*.js"
run: yarn eslint {staged_files}
Expand Down