Commit Graph

45 Commits

Author SHA1 Message Date
Charlie Egan f8c50574d8 Add generated output.jsons for docs examples (#8535)
This allows us to show the results of example evaluation before the user
clicks evaluate, but also for chatbots to see the output when viewing
without interaction.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2026-04-21 13:01:02 +00:00
Charlie Egan b29b1dad76 docs/website: Markdown linting and spell checking for documentation (#8292)
* Add markdownlint tooling to docs

Install markdownlint-cli2 with configuration file and make targets for
auto fix etc too.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Autofixable markdown issues

mainly, replace tabs with spaces for consistent 2-space indentation

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD059

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Fix a number of <link> issues

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD041

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD041

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD046

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD025

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD052

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD028

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD001

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Add GH action check in PRs

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Use 4 spaces for tabs

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Use 4 spaces for tabs

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* docs: Add spell checking using Vale

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Correct comment for space indentation rule

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

---------

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2026-02-05 10:20:13 +00:00
Charlie Egan b1eb646ddc docs/website: Add formatting and linting checks (#8288)
* Update baseline-browser-mapping to version 2.9.19

Addresses issue in build

[baseline-browser-mapping] The data in this module is over two
months old.  To ensure accurate Baseline data, please update: `npm i
baseline-browser-mapping@latest -D`

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Add fmt and lint config for docs

This is based on dprint and eslint. Some vendored paths are ignored.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Format and lint docs project

Markdown linting will be added in another PR.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

---------

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2026-02-03 17:01:54 +00:00
Charlie Egan 5951e5dee8 docs: Add Regal docs to OPA site (#7874)
This will show the project under /projects/, where some other upcoming
additions will have their docs too.

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Co-authored-by: Charlie Egan <charlieegan3@users.noreply.github.com>
2025-09-02 17:41:06 +02:00
Charlie Egan 3546780664 website: Use latest release rather than edge (#7781)
Signed-off-by: Charlie Egan <charlie@styra.com>
2025-07-31 15:14:30 +00:00
Charlie Egan c0871837e8 docs: Add simple post-merge smoke test website (#7611)
Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-21 18:40:23 +00:00
Charlie Egan b0cd306a7f docs: Fix CLI documentation generation (#7600)
The new command is based on generating JSON for docusaurus consumption
rather than markdown. This is less error prone as manipulation of
markdown is better contained.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-20 11:21:10 +01:00
Charlie Egan d10827c8fa docs: Return cli docs gen command (#7597)
This is used in post-merge. I have yet to fix the generation of this md
file and so I am just returning this command for now to fix post merge
until this is done.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-19 13:36:41 +00:00
Charlie Egan d6b5659856 docs: Switch to new OPA website (#7592)
Some things added on this branch:
- icons and client logos at known paths
- some spam redirects
- some redirects for docs/latest/foo /docs/foo
- redirects for the two ‘moved’ pages (k8s and envoy intros)

I am going to be monitoring the traffic this week on Netlify to make
sure we have a good coverage with redirects where needed.
We also now prompt users to file issues directly from the 404 pages
which should help flag things we miss too.
2025-05-19 10:42:17 +00:00
Charlie Egan f3cb38dc05 docs: Remove live blocks (#7572)
These are no longer being used and are dependent on an old version of
node to work.

I have disabled the generation to allow the new docs site to be built. I
thought it made sense to remove all things relating to live blocks since
we have no plans to support them now anyway.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-12 12:41:57 +01:00
Charlie Egan 53ab5b7a80 docs: Deploy a new OPA website under /new (#7534)
* New site v1

Signed-off-by: Charlie Egan <charlie@styra.com>

* Add feature and language pages

Signed-off-by: Charlie Egan <charlie@styra.com>

* tidy data generation

Signed-off-by: Charlie Egan <charlie@styra.com>

* Import docs

Signed-off-by: Charlie Egan <charlie@styra.com>

* WIP

Signed-off-by: Charlie Egan <charlie@styra.com>

* Update content d65888c14f

Signed-off-by: Charlie Egan <charlie@styra.com>

* Refactor site to support any base path

Signed-off-by: Charlie Egan <charlie@styra.com>

* Use base URL for nav icons

Signed-off-by: Charlie Egan <charlie@styra.com>

* Refactor locations of community and support logos

Signed-off-by: Charlie Egan <charlie@styra.com>

* More asset refactoring

Signed-off-by: Charlie Egan <charlie@styra.com>

* Move k8s docs into correct location

Signed-off-by: Charlie Egan <charlie@styra.com>

* Build the sidebar

Signed-off-by: Charlie Egan <charlie@styra.com>

* Fix CLI formatting

Signed-off-by: Charlie Egan <charlie@styra.com>

* Fix broken links

Signed-off-by: Charlie Egan <charlie@styra.com>

* Tidy nav with some dividers

Signed-off-by: Charlie Egan <charlie@styra.com>

* Deploy under /new

Signed-off-by: Charlie Egan <charlie@styra.com>

* Deploy new site on preview too

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Link to OPA repo for GH nav link

Signed-off-by: Charlie Egan <charlie@styra.com>

* Updates to homepage

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Add a logo grid to homepage

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Update homepage to have improved layout

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Update homepage rego example

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Update homepage logo list

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Update PlaygroundExample to used ?? operator

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Add a simple search

We might want to come back to this later to make the results better but
this is as good as the current search.

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Add a docs archive page

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Revise homepage content and use demo video

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: correct archive version list

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Only support light mode

This is something we can come back to when we have time to review the
graphics for multi mode

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Link is available by default

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Remove blue hero color, and use smaller logo grid

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Correct ecosystem feature links

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Drop loadEcosystem

This is no longer needed as ecosystem pages are now loaded like other
pages (no special asset handling).

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Update content to f308f61

This branch duplicates content to reformat some of it for the new site.
This commit ports in some of the new changes.

https://github.com/open-policy-agent/opa/compare/f7b002e17...f308f612b

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Update slack logos

Use one with a transparent background instead.

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Use styled components, clear custom css

This keeps custom css to a minimum. Used for side by side and for hiding
the codeAPI text.

Signed-off-by: Charlie Egan <charlie@styra.com>

* docs: Update archive to show 1.4.2 release

Signed-off-by: Charlie Egan <charlie@styra.com>

---------

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-12 10:36:10 +01:00
Charlie Egan a7fa31d56e [docs] Fix unversioned built-in docs issue (#6274)
Fixes https://github.com/open-policy-agent/opa/issues/6269

This fixes the issue by using the builtin_metadata.json file from each
version, the assumption that docs content that depends on the data
doesn't exist before this file was introduced.

I have removed the 'available' check since we haven't consistently
updated the file in the past, e.g.

* https://github.com/open-policy-agent/opa/blob/v0.41.0/builtin_metadata.json#L12710
* https://github.com/open-policy-agent/opa/blob/v0.57.0/builtin_metadata.json#L563

These examples show that sometimes the current version is included,
other times the file is updated after the release.

Video showing the correct content being displayed for various versions:

https://github.com/open-policy-agent/opa/assets/1774239/abf1af7d-9c59-4223-a019-c73d7550b322

To locally test this:

```
git clean -dfx
cd docs
make generate hugo-production-build
hugo server --source website --contentDir generated --ignoreCache --minify
```

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-10-05 09:28:40 +01:00
Charlie Egan eb03ff229d [website] Include static hugo pages in prod build (#6001)
This was only added for dev in https://github.com/open-policy-agent/opa/pull/5984/files#diff-cdec797dddf8fc387304501d6bd4f318e1e9067c6fae012dfa8b69fd85fd3248R33

I missed this as I thought the preview would run the prod commands

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-06-12 11:46:52 +01:00
Charlie Egan 93b496523f Refactor site to use Hugo for other pages (#5984)
This is what I have done:

* bring all pages into Hugo structure (security, community, support)
* make styles consistent more consistent with homepage
* merge and try to de-dupe css
* Reduced number of breakpoints to 2, one for mobile and one for larger

This is intended to be a step in the right direction, making the site
easier to maintain and more design consistent. There is much left to do,
some examples of things still to work on:

* The remaining CSS is still very messy and likely has some unused.
* The homepage still has an entirely different Dom for mobile in one section, this is toggled on and off.
* We don't use Hugo to generate any page content from markdown for these pages
* ... the list goes on.

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-06-12 11:06:48 +01:00
Stephan Renatus e8deba62bd types, ast, docs: Add support for named function arg declarations
This commit adds support for named argument declarations for built-in
functions as well as additional metadata/annotations on built-in
functions (e.g., descriptions, categories, etc.) This commit allows us
to generate a data file (builtin_metadata.json) that other tools can
consume to improve the Rego authoring experience.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>

Co-authored-by: Torin Sandall <torinsandall@gmail.com>
2022-05-24 09:38:07 -07:00
Stephan Renatus 28c299b6f3 website/live-blocks: don't call the github api to determine release asset urls
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-03-25 14:40:41 +01:00
Stephan Renatus e09b04f2a9 website: make local dev and PR preview not build everything (#4474)
With this change, the work done for local development, and the per-PR netlify preview changes:

It will no longer include the website stuff for versions other than edge, the current working tree.

We thus save us the time, and the flakiness, involved with

- checking if github has release binaries for all the versions
- checking out their sources
- fetching the release binaries to pre-hydrate old versions' live-blocks.

The previously-used, documented make target should still be intact.

Fixes #4379 to some extent, I hope.

* docs/website: remove "latest" binary from opa versions cache

Having a stale binary here -- one called "latest" but not actually
being "latest" -- causes issues like this: when building the website
content for the (real) latest version, the script would take the
old (previous-latest) binary, and fail because that binary didn't
know the latest future keywords.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-03-25 09:59:44 +01:00
Anders Eknert f272af65f6 Add CLI section to docs (#4241)
Fixes #3915

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-01-19 13:00:09 +01:00
Stephan Renatus aa03444888 website: misc smaller improvements (#4092)
* remove empty bottom-left block
* add "Contributing" to mobile nav
* add "Support" section to mobile nav
* make "Support" link relative in sidebar
* add "Discussions" social icon + titles

Now, something shows up when you hover over the social button. I hope
this improves a11y.

Had to bump the font awesome version for another icon I tried, figured
I'd just keep the bump anyways.

Includes some `config.yaml` removals because I couldn't see where they had
been used.

* docs/Makefile: add netlify-cli --dir argument

Without it, I'd run into some weird problem with netlify assuming the
website was built with cecil, and complaining it couldn't find its
binary.

With the `--dir` argument, everything seems to work like it did before.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-12-06 21:38:39 +01:00
Stephan Renatus 6c91c5865d build: fix netlify build (#3845)
With more and more version appearing, the argument count passed to the
`npm run` call through the shell glob had increased, too -- to a point
where execution was impossible because it had reached a hard limit.

The obvious fix would have been to use `find [...] -exec cmd {} +` or
`find [...] -print0 | xargs -0 cmd`, however, since the npm call builds
another command line that's executed, we'd step over that limit again.

So instead, we'll now run the npm script on batches of 200 files. It's
below the maximum (unclear what it is, I haven't dug that deep), and
still fast enough (running it file-by-file takes 15+minutes).

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-10-01 22:07:52 +02:00
Patrick East 1ebe25dd2f docs: Update dev instructions and make targets
This updates the Makefile targets to remove the hugo-only options for
development, as well as clarifying/simplifying the requirements for
a dev environment. There are now really two options: just look at the
markdown preview with your editor/ide, or install the tools locally
and deploy the full site.

We can likely improve the dev experience some more (would be nice to
get back to the live content updating dev experience) but for now this
should help remove some confusion about how to build and run the site.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-03-26 07:39:36 -07:00
Patrick East 418d7334ea website: Replace homepage with new version
This integrates the new https://openpolicyagent.org/ home page
contents into the site build.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-11-17 19:07:05 -08:00
Patrick East 04c711fc01 docs: Remove non-useful linkcheck target
The `linkcheck` target has been broken since we added in the "latest"
URL stuff and started using netlify redirects all over.

Add documentation for using a different tool that crawls the live
preview deployemnt.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East 2f37e38180 docs: Refactor production-build make target
This makes it easier to troubleshoot the live blocks injection step
by isolating the build step to make the hugo content.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-04 16:36:31 -06:00
Torin Sandall 64139d61f7 docs: Fix whitespace in Makefile
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-23 16:50:32 -04:00
David Boles 91d98c7205 docs: Add live-editable code blocks to the docs.
This commit adds a postprocessor to the docs build that enables
examples to be edited and have the results show up live. See the
additions to `docs/README.md` for more about what writing these
blocks looks like or the netlify PR preview
(e.g. at `docs/edge/how-do-i-write-policies/`)
to see them in action (you'll need to disable CORS for live output).

Signed-off-by: David Boles <me@davidbol.es>
2019-08-21 10:12:49 -07:00
Patrick East 0da7f3122d docs: Correct Makefile clean step
There was a typo in one and we didn't remove the generated releases.yaml

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-06-13 13:27:06 -07:00
Patrick East 2fc2282c3b Update hugo version to 0.55 in netlify config
Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-05-16 13:21:10 -07:00
Patrick East 758bb95ca3 Update docs dev readme and netlify dev configuration
There are a few drawbacks to different dev approaches with modifying
and testing the website and docs content. This updates the makefile
to include a handful of options and info about when to use them.

This also changes to not use a “live” Hugo service behind netlify when
we run it locally in dev mode. This allows for the local netlify
preview to more accurately reflect the “real” build.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-05-03 13:27:17 -06:00
Patrick East 58d336aff9 Refactor doc directories
Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-04-26 17:12:15 -07:00
Patrick East 5b7fb411a3 Get local netlify dev environment working
We needed to change to build the docs from the root of the git repo
Where the netlify toml file was. To make this easier we just shim the
docs-* make targets to the ./docs/Makefile.

The nice part of this is we get a full deployment with the redirects
and other netlify config bits in place.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-04-26 17:12:15 -07:00
Patrick East 2483b6dd2e Remove “local” and “production” doc builds..
..There can be only one.

The groundwork was laid in previous patches but this finishes the
process of removing the local/dev/preview builds. We now only have
a single doc build that will show *all* content.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-04-26 17:12:15 -07:00
lucperkins f5835174b5 Add auto scrolling
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-04-19 12:18:12 -07:00
lucperkins 2e1a30613e Add version dropdown navigation
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-04-15 12:28:08 -07:00
Torin Sandall 4de44cc18b Update preview-build to create releases.yaml
This file is needed by the Netlify deploy triggers.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-04-08 17:12:45 -07:00
Torin Sandall bb5e30e934 Move the gh-pages target into separate Makefile
The VERSION ifdef guard was causing the Netlify build to fail. Split
the gh-pages build into a separate Makefile for now.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-04-08 17:12:45 -07:00
Torin Sandall e34c28bdba Skip npm install now that node_modules are vendored
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-04-08 17:12:45 -07:00
Torin Sandall 187bf70d8b Add self-contained static site build target
This target is self-contained and produces a site.tar.gz output that
contains the entire static site. We can deploy the contents of
site.tar.gz to the gh-pages branch.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-04-08 17:12:45 -07:00
lucperkins da8e77b41f Display only current master in server mode and deploy preview
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-04-06 12:35:11 -07:00
lucperkins 87179879d7 Update preview build to show latest instead of all versions
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-04-06 12:35:11 -07:00
lucperkins 121aecf485 Create separate partials for local vs. prod
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-04-05 10:51:41 -07:00
lucperkins 75a3f79090 Fix links and add link checking instructions
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-04-04 09:53:38 -07:00
lucperkins c1f13c4f43 Rework versioning system
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-04-01 11:42:50 -07:00
lucperkins 3fbdd5a5ff Add documentation versioning logic
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-03-28 16:28:40 -07:00
lucperkins bb0d4e271b New OPA website (Hugo + Netlify)
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-03-26 13:45:50 -07:00