Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVRO-3379: Replace the old website with https://github.com/martin-g/avro-website #1528

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
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.
2 changes: 2 additions & 0 deletions .github/workflows/rat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
paths-ignore:
- 'doc/**'

jobs:
rat:
Expand Down
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build/
node_modules/
public/
3 changes: 3 additions & 0 deletions doc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM klakegg/hugo:ext-alpine

RUN apk add git
47 changes: 4 additions & 43 deletions doc/NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache Avro
Copyright 2010-2015 The Apache Software Foundation
Copyright 2010-2022 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
Expand All @@ -26,16 +26,9 @@ is:
| implied. See the License for the specific language governing
| permissions and limitations under the License.

The Odiago NOTICE at the time of the contribution:

| This product includes software developed by Odiago, Inc.
| (https://www.wibidata.com).

The documentation contains the default Apache Forrest skin.
Apache Forrest includes the following in its NOTICE file:

| Apache Forrest
| Copyright 2002-2007 The Apache Software Foundation.
|--------------------------------------------------------------------------
| This product includes software developed by The Docsy Authors.
| (https://www.docsy.dev/).
|
| This product includes software developed at
| The Apache Software Foundation (https://www.apache.org/).
Expand All @@ -49,35 +42,3 @@ Apache Forrest includes the following in its NOTICE file:
| Other accompanying products do not require attribution, so are not listed.
|
| ------------------------------------------------------------------------
| This product includes software developed by the OpenSymphony Group
| http://www.opensymphony.com/
|
| This product includes software developed for project Krysalis
| http://www.krysalis.org/
|
| This product includes software developed by Andy Clark.
| https://people.apache.org/~andyc/neko/
|
| This product includes software developed by the ExoLab Project
| https://www.exolab.org/
|
| This product includes software developed by TouchGraph LLC
| https://www.touchgraph.com/
|
| This product includes software developed by Marc De Scheemaecker
| http://nanoxml.cyberelf.be/
|
| This product includes software developed by the ANTLR project
| https://www.antlr.org/
|
| This product includes software developed by Chaperon
| http://chaperon.sourceforge.net/
|
| This product includes software developed by Sal Mangano (included in the XSLT Cookbook published by O'Reilly)
| https://www.oreilly.com/catalog/xsltckbk/
|
| This product includes software developed by The Werken Company.
| http://jaxen.werken.com/
|
| This product includes software developed by the jfor project
| http://www.jfor.org/
146 changes: 146 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Apache Avro website

This is a repository of Apache Avro website. The repository of Apache Avro can be found [here](https://github.com/apache/avro).

This website is base on [Hugo](https://gohugo.io) and uses [Docsy](https://www.docsy.dev/) theme.

## Getting started

Clone this repository:

```bash
git clone --recurse-submodules https://github.com/apache/avro-website.git
```

You can now edit your own versions of the site’s source files.

If you want to do SCSS edits and want to publish these, you need to install `PostCSS`

```bash
npm install
```

## Work flow

1. Building and running the site locally requires a recent `extended` version of [Hugo](https://gohugo.io).
You can find out more about how to install Hugo for your environment in our
[Getting started](https://www.docsy.dev/docs/getting-started/#prerequisites-and-installation) guide.
Once you've made your working copy of the site repo, from the repo root folder, run:


```
hugo server --navigateToChanged
```

1. Edit .md and .html files in `content/` folder
1. Once satisfied with the changes, commit them:

```
git commit -a
```

1. Generate the HTML filse
stop `hugo server --navigateToChanged` (with Ctrl+C) and run

```
hugo --gc --minify
```

This will generate the HTMLs in `public/` folder and this is actually what is being deployed

1. Add the modified HTML files to Git

```
git add .
git rm offline-search-index.<<OLD-HASH>>.json
git commit -a
git push
```


This way even when the PR modifies a lot of files we can review only the first commit, the meaningful one, with the modified files in `content/` folder


## Running a container locally

You can also run avro-website inside a [Docker](https://docs.docker.com/)
container, the container runs with a volume bound to the `avro-website`
folder. This approach doesn't require you to install any dependencies other
than [Docker Desktop](https://www.docker.com/products/docker-desktop) on
Windows and Mac, and [Docker Compose](https://docs.docker.com/compose/install/)
on Linux.

1. Build the docker image

```bash
docker-compose build
```

1. Run the built image

```bash
docker-compose up
```

> NOTE: You can run both commands at once with `docker-compose up --build`.

1. Verify that the service is working.

Open your web browser and type `http://localhost:1313` in your navigation bar,
This opens a local instance of the docsy-example homepage. You can now make
changes to the docsy example and those changes will immediately show up in your
browser after you save.

### Cleanup

To stop Docker Compose, on your terminal window, press **Ctrl + C**.

To remove the produced images run:

```console
docker-compose rm
```
For more information see the [Docker Compose
documentation](https://docs.docker.com/compose/gettingstarted/).

### Troubleshooting

As you run the website locally, you may run into the following error:

```
➜ hugo server

INFO 2021/01/21 21:07:55 Using config file:
Building sites … INFO 2021/01/21 21:07:55 syncing static files to /
Built in 288 ms
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): resource "scss/scss/main.scss_9fadf33d895a46083cdd64396b57ef68" not found in file cache
```

This error occurs if you have not installed the extended version of Hugo.
See our [user guide](https://www.docsy.dev/docs/getting-started/) for instructions on how to install Hugo.

## Edit content

The website content is in `content/en` folder. It contains `.md` (Markdown) and `.html` (HTML) files.

### Layouts

To change the layout of any page edit `layouts/<page>/**.html`. If there is no layout for a given page at that location then copy the one provided by the theme and edit it:

cp themes/docsy/layouts/<xyz> layouts/<xyz>

### Avro version

When a new version of Apache Avro is released:

1. Change the value of `params.avroversion` in `config.toml`
2. Add a new entry to the `Releases` pages in the `Blog` section, for example:
```
cp content/en/blog/releases/avro-1.10.2-released.md content/en/blog/releases/avro-1.11.0-released.md
```

### API documentation for C/C++/C# modules

The API documentations for C/C++/C# are built by their respective `build.sh dist` implementations. The final HTML should be copied to the `external` folder, for example:

cp ../avro/build/avro-doc-1.12.0-SNAPSHOT/api/c/* content/en/docs/external/c/
File renamed without changes
1 change: 1 addition & 0 deletions doc/assets/icons/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions doc/assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.dropdown-menu .show {
overflow-y: auto;
max-height: 700px;
MARTIN_G: 191;
}
5 changes: 5 additions & 0 deletions doc/assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.dropdown-menu .show {
overflow-y: auto;
max-height: 700px;
MARTIN_G: 191;
}
56 changes: 0 additions & 56 deletions doc/build.xml

This file was deleted.