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>
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>
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>
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>
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>
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.
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>
* 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>
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>
* 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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>