Commit Graph

35 Commits

Author SHA1 Message Date
Charlie Egan fb8f6c4a4a website: Process feedback form on netlify (#8040)
This new function allows netlify to process the form's notification hook
itself and post to slack without zapier.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2025-11-11 11:22:50 +00:00
Charlie Egan 4aa4554f8e website: Fix build issues (#7999)
There are some build issues related to a new netlify base image.

https://app.netlify.com/projects/openpolicyagent/deploys/69020ac6a2fe410008c643de

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2025-10-29 15:21:03 +00:00
Charlie Egan 882b28738c website: Show latest release rather than edge (#7988)
Reverts https://github.com/open-policy-agent/opa/pull/7848 which was
done to allow new content to land faster.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2025-10-29 11:19:23 +00:00
Torin Warwick 19d52d0066 Update website to build from tip of main
Signed-off-by: Torin Warwick <torin@Torins-MacBook-Pro.local>
2025-08-19 17:51:46 -07: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 9250b55f75 website: Add wildcard CORS for data/versions.json (#7784)
Turns out that CORS is either any host, or a specific host. We need to
match any opa versioned deployment host, so we need a *.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-07-17 15:32:05 +01:00
Charlie Egan 9c3bcbe4fd website: Render versions under /data/versions.json (#7783)
This will facilitate other sites checking the current version of the OPA
website.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-07-17 11:10:25 +00:00
Charlie Egan 2b4722e90d docs: Redirect old admission control link (#7730)
* docs: Redirect old admission control link

Fixes https://github.com/open-policy-agent/opa/issues/7729

Fixes https://github.com/open-policy-agent/opa/issues/7720

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

* website: Disable secret scan for x509 test cases

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

---------

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-06-26 09:40:00 +00:00
Charlie Egan 45223def7e website: Disable cancel script (#7719)
This script is functioning correctly, but netlify can't stop sending
emails for cancelled build:

https://answers.netlify.com/t/deploy-notifications-cancel-vs-failure/37300
https://answers.netlify.com/t/differentiate-betweeen-cancel-and-failure-for-deployment-notifications/67054
https://answers.netlify.com/t/deploy-notification-cancel-vs-failure/88316

In order to avoid red-blindness, we are disabling the script so we get
emails only for failed builds.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-06-24 09:59:33 +01:00
Charlie Egan 5a6b115e51 website: Fix badge endpoints (#7653)
We have been having some issues with the badge endpoints and have opted
to standardize on the `/badge` as the public API for this feature.

e.g. https://openpolicyagent.org/badge/v1.5.0

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-06-02 10:37:15 +01:00
Charlie Egan 7998b24a80 website: Fix badge endpoint (#7626)
We have callers using /badge and /badge-endpoint

https://github.com/StyraInc/regal/blob/main/README.md?plain=1#L4

https://github.com/StyraInc/enterprise-opa/blob/main/README.md?plain=1#L1C15-L1C100

There are likely others mixing the use so I think we should continue to
support both.

Also use the Host header for redirects, this means we can full test on the deploy previews.

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

---------

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-23 09:13:47 +00:00
Charlie Egan 08ee9ae92f docs: Revert badge endpoint to old path
This retains the badge behaviour from the old site and still uses a
function for all badge related requests.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-22 11:06:05 +01:00
Charlie Egan 96f62b3890 docs: Update /badge/ endpoints to use same handler (#7617)
This feature had been based on _redirects and a function. Now we have a
single function to handle all badge requests.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-22 09:28:20 +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 23c06fa94d docs: Use Node 22 for all contexts (#7570)
This had been set only for previews before. This is needed to use
docusaurus. 10.x as used before is eol too and was only needed for live
block injection (which has been removed as we transition to the new
site).

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-05-12 11:53:15 +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 e490277477 docs: Point path versioned requests to new sites (#7531)
Following #7528, we also need to route any requests using the old
versioned paths to the correct location.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-04-23 14:54:07 +01:00
Charlie Egan 9daad4b718 docs: Downgrade Hugo (#7034)
* Revert "docs: Update hugo version"

This reverts commit 1891734c06.

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

* docs: add warning note about hugo upgrades

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

* docs: Revert hugo.IsServer Change

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

---------

Signed-off-by: Charlie Egan <charlie@styra.com>
2024-09-18 16:33:17 +01:00
Charlie Egan 1891734c06 docs: Update hugo version
Signed-off-by: Charlie Egan <charlie@styra.com>
2024-09-18 14:43:48 +02:00
Charlie Egan 1e4f120beb [docs] Update integrations, organisations and softwares to have pages (#6158)
This PR makes it possible to browse integrations, organizations and related softwares. Previously, these details were only available as modals on the ecosystem page.

There are also some changes to the policy enforcement on the docs content, the validation rules are much the same but have been updated to reflect that the content is stored in a new place. I have used some generated JSON in Hugo rather than using GitHub api requests to validate the files since it's A) faster, B) I think more simple, and C) easier to get Hugo to process the markdown frontmatter.

Much of the hackery in this PR (Hugo function partials to look up sets of files and get the data from them) is due to the fact that we can't use Hugo's native sections feature. All of our content is nested under docs, this means that all our pages are in the same section so custom lookups have been implemented as function partials instead to work around this.

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-08-17 16:09:33 +01:00
Charlie Egan 251c7fbc0d [website/docs] Refactor ecosystem page (#6029)
Signed-off-by: Charlie Egan <charlie@styra.com>
2023-06-20 11:50:27 +01:00
Charlie Egan c06d7d458c Update Hugo version, update deprecated Page fields (#5519)
In https://github.com/gohugoio/hugo/releases/tag/v0.93.0
the hugo project deprecated the .URL fields in favor of
Permalink and RelPermalink fields.

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
2023-01-03 10:49:56 +00:00
Stephan Renatus e681a16fbe website: experiment with badge endpoint (#5423)
If this works out, one should be able to include

    https://openpolicyagent.org/badge/v0.46.1

as an image, say, in a github README, and it'll look nicely.

Furthermore, when 0.46.1 will no longer be the latest version, it'll
turn from green to yellow.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-11-29 11:48:41 +01:00
Stephan Renatus f477e7ff7f docs/website: make "outdated version" banner red if ancient (#5339)
Where "ancient" means it's not among the latest five releases.

Also, in, netlify.toml: declare framework for dev. I've found that
adding this live means I can use

    netlify dev --offline

without any further switches. For some reason, I had run into
trouble with "cecil" when using it like that.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-11-02 11:42:50 +01:00
Stephan Renatus 3b01b9a637 netlify: skip build if nothing changed (#5039)
The build now follows this logic: for non-pull-requests, i.e. tag pushes and merges to
main, we'll check if anything has changed in the relevant files, compared to
the previous deployment.

For PRs, we'll check for changes in the files relative to `main`.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-08-23 13:27:35 +02:00
Stephan Renatus 94ec32e402 website: bump to hugo to 0.88.1, adapt code and live-blocks (#3986)
* website: bump hugo, updated templates

For some reason, the "and" trick to step around undefined values no longer
worked. So now, we're wrapping {{ if }} conditionals instead: the outer one
checks that the value is defined, the inner one asserts something on its
value.

* live-blocks/preprocess: add wrapper div, remove newline

Somewhere between 0.55 and the most recent version, Hugo stopped emitting
that div on purpose for languages it didn't know.

Since we depend on it for further processing, we're adding it back.

Also, a trailing newline for code elements was introduced, and that broke
our codemirrors integration -- every code entry would be folllowed by an
empty line. Now, we're removing that in the same preprocess step.

* website: fix info|danger blocks
* website/config: trust markdown to include html

Fixes #3787.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-11-09 09:45:31 +01:00
Torin Sandall 1113255744 build: Disable wasm/cgo in netlify build
We do not need wasm/cgo support in the opa builds produced during
netlify runs.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-02-18 15:25:21 -05:00
Patrick East e6727cbdf2 Add opa bench and opa test --bench
This adds in a new CLI sub command `opa bench` which will load
and evaluate similar to `opa eval` but will perform benchmark testing
of the query.

There is also a new `--bench` option for `opa test` which will
similarly perform benchmarking, except on the unit tests.

Both use the golang testing frameworks benchmark tooling, and the
output format is compliant with the go benchmark standard when using
the newly added `gobench` output format option.

They both support specifying a `--count` to run the benchmark a
number of times and a `--benchmem` option to report memory statistics.

To help enable using the `opa test` command better with the benchmark
option there is now a `--run`/`-r` option that can be provided to
specify a regex for what test cases should be run. The regex supports
anything that is supported by re2:

https://github.com/google/re2/wiki/Syntax

These changes required updating to Go 1.13 to get the ability to
report custom metrics with the benchmark results
https://golang.org/pkg/testing/#B.ReportMetric To get Netlify on board
we needed to add a `.go-version` file to the root of the repo. This is
now the single source of truth for the OPA golang version.

Fixes: #1424
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-02-24 14:03:42 -08: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 bc3bf0e7fa docs: Preprocess live-blocks with current OPA HEAD
This changes to no longer download the `edge` release binary (we still
publish one for anyone who wants to use the current master). This way
for PR's and for development we are going to process the `edge`
documentation with the version of OPA that is the current HEAD. For
the live site this will always be the current master branch.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-10-04 12:37:15 -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
lucperkins bb0d4e271b New OPA website (Hugo + Netlify)
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-03-26 13:45:50 -07:00