Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .example.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NEXT_PUBLIC_GTM_ID=123
NEXT_PUBLIC_ALGOLIA_APP_ID=
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY=
ALGOLIA_SEARCH_ADMIN_KEY=
NEXT_PUBLIC_ALGOLIA_MOMENTUM_INDEX=

# According to https://github.com/vercel/next.js/issues/3605#issuecomment-370250206, nextjs only
# supports 'production' and 'development' envs out of the box, so we have to create a ENV
Expand Down
27 changes: 27 additions & 0 deletions .github/actions/momentum-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check out the Momentum docs
description: Fetches the private SparkPost/momentum-docs submodule at content/momentum, which every site build needs.

inputs:
ssh-key:
description: Private half of a read-only deploy key on SparkPost/momentum-docs.
required: true

runs:
using: composite
steps:
# A separate step rather than actions/checkout's ssh-key input, which
# would also use the momentum-docs key to fetch this repository.
- shell: bash
env:
SSH_KEY: ${{ inputs.ssh-key }}
run: |
# Pull requests from forks get no secrets.
if [ -z "$SSH_KEY" ]; then
echo "::error::MOMENTUM_DOCS_SSH_KEY is not available, so content/momentum cannot be fetched"
exit 1
fi
key="$RUNNER_TEMP/momentum-docs-key"
trap 'rm -f "$key"' EXIT
(umask 077 && printf '%s\n' "$SSH_KEY" > "$key")
GIT_SSH_COMMAND="ssh -i '$key' -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new" \
git submodule update --init content/momentum
3 changes: 3 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Checkout repository
uses: actions/checkout@v4
- uses: ./.github/actions/momentum-docs
with:
ssh-key: ${{ secrets.MOMENTUM_DOCS_SSH_KEY }}
- name: Cypress run
uses: cypress-io/github-action@v6
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: ./.github/actions/momentum-docs
with:
ssh-key: ${{ secrets.MOMENTUM_DOCS_SSH_KEY }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/momentum-docs
with:
ssh-key: ${{ secrets.MOMENTUM_DOCS_SSH_KEY }}
- uses: actions/cache@v4
with:
path: ~/.npm
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "content/momentum"]
path = content/momentum
url = git@github.com:SparkPost/momentum-docs.git
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ This repo contains the SparkPost and Momentum documentation published at https:/

SparkPost documentation is located in the `content/docs/` directory.

Momentum documentation is located in the `content/momentum/` directory.
Momentum documentation is maintained in the private repository
[SparkPost/momentum-docs](https://github.com/SparkPost/momentum-docs) and included here as a git
submodule at `content/momentum/`. The submodule commit is what docs.sparkpost.com/momentum publishes.
Edit Momentum docs there; to publish a release, move the submodule to that release's tag in this
repository.

All content is formatted in [Markdown](https://daringfireball.net/projects/markdown/syntax) and version control is managed by Github.

Expand Down Expand Up @@ -157,9 +161,12 @@ _**This is not a required step in contributing to the documentation**_

### Installation

Navigate in your terminal to the root directory (`support-docs/` or whatever you named it) and install all dependencies:
Navigate in your terminal to the root directory (`support-docs/` or whatever you named it), fetch the
Momentum docs submodule (this needs read access to SparkPost/momentum-docs; the site does not build
without it) and install all dependencies:

```
git submodule update --init
npm install
```

Expand Down Expand Up @@ -200,6 +207,10 @@ NEXT_PUBLIC_ALGOLIA_APP_ID=
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY=
ALGOLIA_SEARCH_ADMIN_KEY=

# Optional. Searches, and with build:index:momentum rebuilds from scratch, this Momentum index
# instead of next_momentum_documentation. The momentum-docs preview builds set it.
NEXT_PUBLIC_ALGOLIA_MOMENTUM_INDEX=

# According to https://github.com/vercel/next.js/issues/3605#issuecomment-370250206, nextjs only
# supports 'production' and 'development' envs out of the box, so we have to create a ENV
# variable if we want a 'test' specific environment
Expand Down
2 changes: 1 addition & 1 deletion components/site/algolia/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SearchBox from 'components/site/algolia/searchBox';
import SearchResults from 'components/site/algolia/results';

type SearchProps = {
indexName: 'next_momentum_documentation' | 'next_support_documentation' | 'next_analyst_documentation';
indexName: string;
};

const Search = (props: SearchProps): JSX.Element => {
Expand Down
3 changes: 2 additions & 1 deletion components/site/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Menu } from '@sparkpost/matchbox-icons';
import Logo from 'components/site/logo';
import Search from 'components/site/algolia/search';
import HeaderButtons from 'components/site/headerButtons';
import { momentumIndexName } from 'lib/algoliaIndexes';
import styled from 'styled-components';

const StyledButton = styled.button`
Expand All @@ -22,7 +23,7 @@ const Header = (props: HeaderProps) => {
const category = asPath.split('/')[1];
let searchBox = (<Search indexName="next_support_documentation" />);
if (category === 'momentum') {
searchBox = (<Search indexName="next_momentum_documentation" />);
searchBox = (<Search indexName={momentumIndexName()} />);
} else if (category === 'analyst') {
searchBox = (<Search indexName="next_analyst_documentation" />);
}
Expand Down
1 change: 1 addition & 0 deletions content/momentum
Submodule momentum added at 9477e7
38 changes: 0 additions & 38 deletions content/momentum/3/3-ad/ad-adaptive-automated-proxy.md

This file was deleted.

39 changes: 0 additions & 39 deletions content/momentum/3/3-ad/ad-adaptive-rules-actions.md

This file was deleted.

39 changes: 0 additions & 39 deletions content/momentum/3/3-ad/ad-adaptive-rules-parameters.md

This file was deleted.

57 changes: 0 additions & 57 deletions content/momentum/3/3-ad/ad-adaptive-rules.md

This file was deleted.

32 changes: 0 additions & 32 deletions content/momentum/3/3-ad/ad-adaptive-update.md

This file was deleted.

Loading
Loading