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

Add devcontainer and update Hugo version #336

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "rapids-site",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"forwardPorts": [1313],
"features": {
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {
"jqVersion": "latest",
"yqVersion": "latest"
}
},
"postCreateCommand": "./scripts/devcontainer-init.sh"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ _site
.netlify
.hugo_build.lock
public
resources
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/> &nbsp; [RAPIDS.ai](https://rapids.ai.com) Website

Code and content for the [RAPIDS.ai](https://rapids.ai) static public website. This is a refactor from the previous Jekyll backed version to use the [Hugo](https://gohugo.io/about/) static site framework and the [Bulma](https://bulma.io/) css framework. On occasion it uses [Apline.js](https://alpinejs.dev/start-here).
This repository contains the source code and content for the [RAPIDS.ai](https://rapids.ai) website. The site uses [Hugo](https://gohugo.io/about/) for generating static HTML and [Bulma](https://bulma.io/) as a CSS framework. On occasion it uses [Apline.js](https://alpinejs.dev/start-here).


## Design and Layout
Use the [Template Design Guide](template.html) and [RAPIDS Brand Guide](brand.html) for reference with starting new pages.

Refer to the [Bulma Documentation](https://bulma.io/documentation/) for reference to the CSS class names and components. Note: many CSS classes are overwritten through `custom.css`.
- [Column System](https://bulma.io/documentation/columns/basics/)
Expand All @@ -15,16 +14,21 @@ Hugo uses templates, layouts, and directories to build pages. The `/layouts/_def


## Requirements
The site required Hugo in order to be built. Follow the [Hugo documentation](https://gohugo.io/about/) for assistance.

All logos and images are located in the [images](/static/images) folder. Externally (no website) referenced files should be placed in the [assets](/assets) folder.

Font Icons are used from [Font Awesome](https://fontawesome.com/), and include Pro account icons.

In the future it will employ the more optimized assets and hugo pipe features.
In the future it will employ the more optimized assets and Hugo pipe features.

## Hosting, Development and Previews
After installing Hugo, run `hugo server` to see a developer preview and `hugo` to build for production. You can also preview pages locally from the `/public` dir after building, but may need to use `python -m http.server` or similar for all functionality.
## Pull Request Previews

Hosting is currently done through [Netlify](https://www.netlify.com/), which should create a preview when PRs are pushed to the main repository.
[Netlify](https://www.netlify.com/) will create a preview environment when PRs are opened.

## Contributing

You can use the included devcontainer for local development.

Start the container and run `hugo serve` to start a development server.

The development server can be viewed in a browser at <http://localhost:1313>.
13 changes: 0 additions & 13 deletions config.toml

This file was deleted.

12 changes: 12 additions & 0 deletions hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
baseURL: https://rapids.ai/
languageCode: en-us
title: RAPIDS
enableRobotsTXT: true
googleAnalytics: G-RKXFW6CM42

disableKinds: [taxonomy, term]

sitemap:
changefreq: monthly
filename: sitemap.xml
priority: 0.5
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ publish = "public"
command = "hugo --gc --minify && cp _redirects public"

[build.environment]
HUGO_VERSION = "0.108.0"
HUGO_VERSION = "0.119.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
8 changes: 8 additions & 0 deletions scripts/devcontainer-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail

# Install Hugo version from `netlify.toml` file
mkdir -p ~/.local/bin
HUGO_VERSION=$(yq -oy '.build.environment.HUGO_VERSION' netlify.toml)
wget "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" -O - | \
tar -xzvf - -C ~/.local/bin hugo