Skip to content

Commit

Permalink
Witness website netlify (#394)
Browse files Browse the repository at this point in the history
Initial docs site update for Witness with new Docusaurus stack. 
---------
Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
Signed-off-by: John Kjell <john@testifysec.com>
Co-authored-by: John Kjell <john@testifysec.com>
  • Loading branch information
ChaosInTheCRD committed Mar 6, 2024
1 parent a4c4029 commit 910d630
Show file tree
Hide file tree
Showing 29 changed files with 9,139 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify-licence.yml
Expand Up @@ -21,4 +21,4 @@ jobs:
- name: Check license headers
run: |
set -e
addlicense --check -l apache -c 'The Witness Contributors' -v *
addlicense --check -l apache -c 'The Witness Contributors' --ignore "docs-website/**" --ignore "docs/**" -v *
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,4 +1,5 @@
bin/
build/
vendor/
.dccache
test/testapp
Expand All @@ -12,3 +13,6 @@ test/scorecard.json
log
sarif-report.json
test/log
node_modules
.DS_Store
docs-website/.docusaurus
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -4,8 +4,8 @@
<center>

**[DOCS](https://witness.dev)
[CONTRIBUTING](../CONTRIBUTING.md)
[LICENSE](../LICENSE)**
[CONTRIBUTING](/CONTRIBUTING.md)
[LICENSE](https://github.com/in-toto/witness/blob/main/LICENSE)

`bash <(curl -s https://raw.githubusercontent.com/in-toto/witness/main/install-witness.sh)`
</center>
Expand Down
1 change: 1 addition & 0 deletions docs-website/.env
@@ -0,0 +1 @@
REACT_APP_IN_TOTO_SITE=witness // or 'archivista' based on your configuration
41 changes: 41 additions & 0 deletions docs-website/README.md
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs-website/babel.config.js
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
153 changes: 153 additions & 0 deletions docs-website/docusaurus.config.js
@@ -0,0 +1,153 @@
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'In-toto Witness',
tagline: 'Documentation for the Witness Project',
favicon: '/static/img/favicon.ico',

// Set the production url of your site here
url: 'https://witness.dev',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'in-toto', // Usually your GitHub org/user name.
projectName: 'witness', // Usually your repo name.

onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: "..",
include: [
"README.md",
"docs/**/*.{md,mdx}",
"CONTRIBUTING.md",
"CODE_OF_CONDUCT.md",
],
sidebarPath: 'sidebars.js',
routeBasePath: "/docs",
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/witness-og.png',
navbar: {
title: 'Witness',
logo: {
alt: 'Witness Project Logo',
src: 'img/logo.png',
},
items: [
{
type: "search",
position: "right",
},
{
type: "doc",
docId: "README",
position: "left",
label: "About",
},
{
type: "doc",
docId: "docs/tutorials/getting-started",
position: "left",
label: "Tutorials",
},
{
type: "doc",
docId: "docs/concepts/attestor",
position: "left",
label: "Concepts",
},
{
href: "https://github.com/in-toto/witness",
position: "right",
className: "header-github-link",
"aria-label": "GitHub repository",
},
{
href: "https://communityinviter.com/apps/cloud-native/cncf",
position: "right",
className: "header-slack-link",
"aria-label": "Slack Invite Link",
},

],
},
announcementBar: {
id: 'support_us',
content:
'We are looking to revamp our docs, please fill <a target="_blank" rel="noopener noreferrer" href="https://forms.gle/Pcgo45TABFYvfQX47">this survey</a>',
textColor: 'white',
backgroundColor: '#333385',
isCloseable: false,
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Tutorials',
to: 'docs/docs/tutorials/getting-started',
},
],
},
{
title: 'Community',
items: [
{
label: 'Slack',
href: 'https://slack.cncf.io/',
},
{
label: 'Github',
href: 'https://github.com/in-toto/witness',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} The Witness Contributors, Inc. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};

export default config;
46 changes: 46 additions & 0 deletions docs-website/package.json
@@ -0,0 +1,46 @@
{
"name": "witness-website",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "3.1.1",
"@docusaurus/preset-classic": "3.1.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"docusaurus-plugin-remote-content": "^4.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-snowfall": "^1.2.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.1.1",
"@docusaurus/types": "3.1.1"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines": {
"node": ">=18.0"
}
}
76 changes: 76 additions & 0 deletions docs-website/sidebars.js
@@ -0,0 +1,76 @@
/**
* Copyright 2024 The Witness Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
docsSidebar: [
{
type: 'doc',
label: 'About',
id: 'README',
},
{
type: 'category',
label: 'Tutorials',
items: [
{
type: 'autogenerated',
dirName: 'docs/tutorials',
},
],
},
{
type: 'category',
label: 'Concepts',
items: [
{
type: 'autogenerated',
dirName: 'docs/concepts',
},
],
},
{
type: 'category',
label: 'Attestor Types',
items: [
{
type: 'autogenerated',
dirName: 'docs/attestors',
},
],
},
{
type: 'doc',
label: 'Command Line Reference',
id: 'docs/commands',
},
{
type: 'doc',
label: 'New Contributor Guide',
id: 'CONTRIBUTING',
},
{
type: 'doc',
label: 'Code of Conduct',
id: 'CODE_OF_CONDUCT',
},
],
}

module.exports = sidebars

0 comments on commit 910d630

Please sign in to comment.