Skip to content
Open
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
6 changes: 4 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04

# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y \
apt-get install -y --no-install-recommends \
ca-certificates \
nodejs \
npm \
wget && \
update-ca-certificates
update-ca-certificates && \
rm -rf /var/lib/apt/lists/*

ARG HUGO_VERSION="0.155.1"
RUN wget --quiet "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" && \
Expand Down
110 changes: 77 additions & 33 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ oriented quickly.
- [CI/CD and Deployment](#cicd-and-deployment)
- [Coding Conventions](#coding-conventions)
- [Pull Request Process](#pull-request-process)
- [Development Workflow](#development-workflow)
- [Troubleshooting](#troubleshooting)

---
Expand Down Expand Up @@ -88,25 +89,6 @@ watches for file changes and rebuilds automatically.
> GitHub org. Set the `GITHUB_TOKEN` environment variable for higher API rate
> limits. Without it, unauthenticated requests are limited to 60/hour.
### Other Useful Commands

```bash
# Production build (output → public/)
npm run build

# Preview the production build
npm run preview

# Format files with Prettier
npm run format

# Sync content in dry-run mode (preview without writing)
go run ./cmd/sync-content --org complytime --config sync-config.yaml

# Run Go tests
go test -race ./cmd/sync-content/...
```

---

## Project Structure
Expand Down Expand Up @@ -221,7 +203,8 @@ manually. To add a new project:

For repos needing custom file sync with transforms (e.g., specific doc pages
with injected frontmatter), add a source entry in `sync-config.yaml`. See
`specs/006-go-sync-tool/quickstart.md` for details.
[cmd/sync-content/README.md](cmd/sync-content/README.md#configuration) for the
config format.

### Change Navigation Menus

Expand Down Expand Up @@ -261,7 +244,7 @@ remove a feature card, look for the `<!-- Features Section -->` comment in
Edit `assets/scss/common/_variables-custom.scss`:

```scss
// Brand colors — change these to re-theme the site
// Brand colors — change these to re-theme the sitee
$cyan-600: #0891b2; // Primary color
$primary: $cyan-600;

Expand Down Expand Up @@ -420,31 +403,92 @@ style: fix indentation in home template

---

## Troubleshooting
## Development Workflow

### `npm run dev` fails with Hugo errors
### Day-to-Day

Make sure you're on Node.js ≥ 20.11.0:
```bash
npm run dev # Dev server with live reload
npm run build # Production build (output → public/)
npm run preview # Preview the production build
npm run format # Format files with Prettier
```

### Clean Build (CI Match)

`hugo server` and `hugo --minify --gc` can produce different results. Always
validate with a production build before trusting the dev server:

```bash
node --version
rm -rf public/ resources/
npm run build
```

If Hugo isn't found, it's installed as part of the npm dependencies. Try:
### Full Nuclear Clean

When something looks wrong and a clean build isn't enough — removes cached
Hugo resources, node_modules, and reinstalls from the lockfile:

```bash
rm -rf node_modules
npm install
npm run dev
rm -rf public/ resources/ /tmp/hugo_cache/ node_modules/
npm ci
npm run build
```

### Changes not showing up in the browser
### Testing the Sync Tool

Dry-run (preview without writing):

```bash
go run ./cmd/sync-content --org complytime --config sync-config.yaml
```

Full reset and resync (useful when upstream content or sync logic changes):

```bash
rm -f .sync-manifest.json data/projects.json
rm -rf content/docs/projects/*/
rm -rf public/ resources/
go run ./cmd/sync-content --org complytime --config sync-config.yaml --lock .content-lock.json --write
npm run build
```

Run Go tests:

Hugo's dev server uses live reload. If it's not picking up changes:
```bash
go test -race ./cmd/sync-content/...
```

If you encounter missing token errors, verify your `GITHUB_TOKEN`:

```bash
export GITHUB_TOKEN="$(gh auth token)"
echo "Token set, length: ${#GITHUB_TOKEN}, prefix: ${GITHUB_TOKEN:0:4}"
go run ./cmd/sync-content --org complytime --config sync-config.yaml --write
```

### Testing Tips

- Always test with **browser cache disabled** (DevTools → Network →
"Disable cache").
- When in doubt, run a [clean build](#clean-build-ci-match) — the dev server
can mask issues that show up in production.

---

## Troubleshooting

### `npm run dev` fails with Hugo errors

Make sure you're on Node.js ≥ 22. If Hugo isn't found, try a
[full nuclear clean](#full-nuclear-clean).

### Changes not showing up in the browser

1. Check the terminal for build errors
2. Try stopping and restarting `npm run dev`
3. For SCSS changes, a hard refresh (Cmd+Shift+R / Ctrl+Shift+R) may be needed
3. Hard refresh (Cmd+Shift+R / Ctrl+Shift+R) for SCSS changes
4. Test with browser cache disabled (DevTools → Network → "Disable cache")

### Image processing errors

Expand All @@ -456,7 +500,7 @@ handle most cases. If it doesn't:
- Local SVGs: Place them in `assets/` or a page bundle
- The error level is set to `ignore` in `params.toml`, so most issues are
silently skipped

e
### Build output confusion: `public/` vs `docs/`

- **`public/`** — Hugo's build output directory (generated, gitignored)
Expand Down
128 changes: 14 additions & 114 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,145 +4,45 @@ The official website for [ComplyTime](https://github.com/complytime) - Cloud Nat

Built with [Hugo](https://gohugo.io/) and the [Doks](https://getdoks.org/) theme.

## 🚀 Quick Start

### Prerequisites

- [Node.js](https://nodejs.org/) v22 or later
- [npm](https://www.npmjs.com/) (included with Node.js)
- [Go](https://go.dev/) 1.25+ (for the content sync tool)
- (Recommended) `GITHUB_TOKEN` env var for higher API rate limits

### Development
## Quick Start

```bash
# Install dependencies
npm install

# Sync project content from GitHub org (generates project pages and cards)
go run ./cmd/sync-content --org complytime --config sync-config.yaml --write

# Start development server
npm run dev
```

The site will be available at `http://localhost:1313/`.

### Build

```bash
# Build for production
npm run build
```
**Prerequisites**: Node.js v22+, Go 1.25+, and (recommended) a `GITHUB_TOKEN` env var for higher API rate limits. See [CONTRIBUTING.md](CONTRIBUTING.md#prerequisites) for details.

The output will be in the `public/` directory.
**Production build**: `npm run build` (output in `public/`).

## 📁 Project Structure
## Project Structure

```
website/
├── assets/ # SCSS, JavaScript, images
│ ├── js/
│ │ └── custom.js
│ └── scss/
│ └── common/
│ ├── _custom.scss
│ └── _variables-custom.scss
├── cmd/sync-content/ # Go content sync tool (10 source files, package main)
├── config/ # Hugo configuration
│ ├── _default/
│ │ ├── hugo.toml
│ │ ├── languages.toml
│ │ ├── params.toml
│ │ └── menus/
│ │ └── menus.en.toml
│ ├── production/ # Production overrides
│ └── next/ # Alternative env overrides
├── content/ # Markdown content
│ ├── _index.md # Homepage
│ ├── docs/ # Documentation
│ │ ├── getting-started/
│ │ └── projects/ # Project pages (generated by sync tool, gitignored)
│ └── privacy.md
├── layouts/ # Custom layouts
│ ├── home.html # Homepage layout (reads data/projects.json)
│ └── docs/
│ └── list.html # Docs section listing layout
├── static/ # Static assets (favicons, icons)
├── config/_default/ # Hugo configuration (TOML)
├── content/docs/ # Markdown content (projects/ is generated by sync tool)
├── data/projects.json # Generated landing page cards (gitignored)
├── layouts/ # Custom Hugo layout overrides
├── sync-config.yaml # Declarative sync configuration
├── .content-lock.json # Approved upstream SHAs per repo (committed)
├── go.mod / go.sum # Go module and checksums
├── .github/
│ └── workflows/
│ ├── deploy-gh-pages.yml # Deploy (sync at locked SHAs + Hugo build)
│ ├── ci.yml # PR validation (lint, test, dry-run, build)
│ └── sync-content-check.yml # Weekly content check (opens PR)
└── package.json
```

## 📝 Content

### Navigation

| Menu Item | URL | Description |
|---------------|------------------------|----------------------------|
| Getting Started | `/docs/getting-started/` | Documentation landing page |
| Projects | `/docs/projects/` | ComplyTime project pages |
| Privacy Policy | `/privacy/` | Privacy policy |

### Adding Documentation

Create a new Markdown file in the appropriate directory under `content/docs/`:

```markdown
---
title: "Page Title"
description: "Page description"
lead: "Brief intro text"
date: 2024-01-01T00:00:00+00:00
draft: false
weight: 100
toc: true
---

Your content here...
└── .github/workflows/ # CI, deploy, weekly content check
```

## 🎨 Customization

### Styling

Custom styles are in `assets/scss/common/`:
- `_variables-custom.scss` - Variables and theme colors
- `_custom.scss` - Additional custom styles

### Configuration

Site configuration is in `config/_default/`:
- `hugo.toml` - Hugo settings
- `languages.toml` - Language and footer settings
- `params.toml` - Theme parameters
- `menus/menus.en.toml` - Navigation menus

## 🚢 Deployment

The site uses three GitHub Actions workflows:

- **`ci.yml`** — validates PRs with `go test -race`, content sync (with `--lock --write`), and Hugo build
- **`sync-content-check.yml`** — runs weekly to detect upstream doc changes and opens a PR to update `.content-lock.json`
- **`deploy-gh-pages.yml`** — on push to `main`, syncs content at approved SHAs, builds with Hugo, and deploys `public/` to GitHub Pages

Upstream content changes require a reviewed PR before reaching production.
See [CONTRIBUTING.md](CONTRIBUTING.md#project-structure) for the full annotated tree.

## 🤝 Contributing
## Contributing

Contributions are welcome! Please see our [Contributing Guide](https://github.com/complytime/community).
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, workflow, coding conventions, and PR process.

## 📄 License
## License

This website is licensed under [Apache 2.0](LICENSE).

## 🔗 Links
## Links

- [ComplyTime GitHub](https://github.com/complytime)
- [Doks Theme](https://getdoks.org/)
Expand Down
Loading
Loading