Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed Mar 15, 2024
2 parents a4740a1 + bcd5b81 commit d61e323
Show file tree
Hide file tree
Showing 1,241 changed files with 13,531 additions and 246,454 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 2
indent_style = space

[{Makefile,**.mk}]
# Use tabs for indentation (Makefiles require tabs)
indent_style = tab
16 changes: 14 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- master
pull_request:

jobs:
build:
Expand All @@ -20,11 +21,22 @@ jobs:
run: env | sort

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: Install website deps
run: npm ci

- name: Build website
run: npm run build

- name: Publish website
if: github.event_name != 'pull_request'
run: |
make build
make publish
make invalidate
env:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint code
on:
push:
branches:
- master
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install --only=dev
- uses: pre-commit/action@v3.0.1
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,28 @@ assets/docs/latest/en/
stuff/
.DS_Store
.gitpod.yml

# For docs build
nextflow/

# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
additional_dependencies:
- prettier@3.2.2
- prettier-plugin-astro@^0.12.3
files: \.(astro|mdx|md|yml|yaml|ts|js|mjs)$
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public
src/pages/nfhack/
src/pages/nfcamp/
14 changes: 14 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// .prettierrc.mjs
/** @type {import("prettier").Config} */
export default {
printWidth: 120,
plugins: ["prettier-plugin-astro"],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};
7 changes: 0 additions & 7 deletions .travis.yml_bak

This file was deleted.

4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ publish:
invalidate:
aws cloudfront create-invalidation --distribution-id E3RPV5P71OW0UF --paths '/*'

make build:
./jbake
build:
npm install
npm run build

dev:
npm install
npm run dev
104 changes: 83 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,96 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/img/nextflow_darkbg.svg">
<source media="(prefers-color-scheme: light)" srcset="public/img/nextflow.svg">
<img alt="Nextflow Logo" src="public/img/nextflow.svg">
</picture>

# Nextflow web site

<https://nextflow.io> is a static web site. Pages are generated by using [JBake](http://jbake.org/).
Source code for [https://nextflow.io](https://nextflow.io). Website is generated using [Astro](https://astro.build).

## Commands

To build the website you need Node.js and `npm` installed. See the [npm docs](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) for instructions.

<!-- TODO: We can replace the Makefile with `npm run` scripts in package.json -->

There is a `Makefile` in the repo with a few standard commands for working with the website:

| Command | Action |
| :---------------- | :----------------------------------- |
| `make dev` | Run a local server for development |
| `make build` | Build the static site for deployment |
| `make publish` | Publish the website to s3 |
| `make invalidate` | Invalidate the Cloudfront cache |

The `dev` server builds pages on request and live-updates as you make changes. It includes additional debugging tools. Note that some type-checking on happens during `make build`.

There are also a bunch of `npm` commands for more fine-grained control:

<details>

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./output/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

</details>

Note that `make build` / `npm run build` fetch the Nextflow repo and build the docs automatically.
When running `make dev` / `npm run dev` this doesn't happen, so the docs will not be visible.

## Code formatting

Code syntax is enforced using [Prettier](https://prettier.io/). You can use a plugin in your code editor to run this automatically on save and it also runs as a CI check on push and pull-requests.

To make it easier to catch formatting errors before pushing, the repo is set up to use [pre-commit](https://pre-commit.com/). If installed, this will run Prettier on any edited files before allowing a commit.

To use, set up as follows:

```bash
pip install pre-commit # Install the pre-commit tool itself
pre-commit install # Set up in the Nextflow website repo
```

After that, checks will automatically run every time you do `git commit` in the repo. Note that formatting changes will be applied automatically but the commit will be aborted - you must do `git add .` and `git commit` again.

## Publishing

Jbake configuration is controlled by file `jbake.properties`.
The Nextflow website is hosted on AWS s3, behind a Cloudfront cache. There are three components to the website:

## Content
1. Front end (this repository)
2. Docs (`/docs`, built from the main Nextflow repo using Sphinx)
3. Nextflow binary downloads (`https://get.nextflow.io`, built from the main Nextflow repo)

Web site content is provided either with Markdown or HTML text file in the folder `content`.
Each content file declares a `type` property that defines the template to be used.
The following type are used :
All three parts of the website are published separately. Care must be taken not to clobber anything by overwriting.

## Project Structure

Page | Type | Template
----------- | ----- | -----------
Normal | page | `page.ftl`
Index | index | `index.ftl`
Blog | - | `archive.ftl` (`blog.html`)
Podcasts | - | `podcasts.ftl` (`podcasts.html`)
Blog posts | post | `post.ftl`
Podcast | post | `podcast.ftl`
The repository has the following rough structure:

```text
/
├── public/
└── src/
├── content/
│ ├── blog/
│ └── podcast/
├── components/
├── layouts/
└── pages/
```

Template are contained in the folder `templates`. To add a custom template
add an entry in the `jbake.properties` file as shown here: `template.<type>.file=<type>.ftl`.
Blog posts and podcast episodes go into `content` as markdown files. Other top-level pages should be named as `.astro` or `.md` files in the `src/pages/` directory. Astro finds all of this content and builds a page. Each page is exposed as a route based on its file name.

## Testing locally
Any static assets, like images, can be placed in the `public/` directory.

Generate the web site pages entering the command: `./jbake` and
the resulting html are placed in the folder `output`.
The `src/components/` and `src/layouts/` folders contain the templating files to build the site.

Launch the local web sever to test the result by entering the command: `./jbake -s`
## Documentation

Note that the `jbake` command included in this repo is a docker command wrapper.
For more info, check the [Astro docs](https://docs.astro.build)
and the old [v3 Bootstrap docs](https://getbootstrap.com/docs/3.4/).
1 change: 0 additions & 1 deletion assets/css/xcode.min.css

This file was deleted.

4 changes: 0 additions & 4 deletions assets/docs/edge/.buildinfo

This file was deleted.

Loading

0 comments on commit d61e323

Please sign in to comment.