|
1 | | -# nextgen-website |
2 | | -Future website for the Ansible Middleware Project |
| 1 | +# Ansible Middleware Website |
3 | 2 |
|
4 | | -Pre-reqs |
5 | | -- hugo v0.115.2+extended |
6 | | -- go version go1.20.5 |
| 3 | +This repository contains the source code for the Ansible Middleware Collections documentation website, built with [Hugo](https://gohugo.io/) and the [Docsy](https://www.docsy.dev/) theme. |
7 | 4 |
|
8 | | -To run locally: |
| 5 | +## Overview |
| 6 | + |
| 7 | +The Ansible Middleware website provides comprehensive documentation for automating enterprise middleware at scale using Ansible collections. It includes guides, examples, and reference documentation for various middleware components. |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +Before you begin, ensure you have the following installed: |
| 12 | + |
| 13 | +- **Hugo Extended**: v0.146.0 or higher (required for Docsy v0.13.0) |
| 14 | + ```bash |
| 15 | + # Check your Hugo version |
| 16 | + hugo version |
| 17 | + ``` |
| 18 | + |
| 19 | +- **Go**: v1.21 or higher |
| 20 | + ```bash |
| 21 | + # Check your Go version |
| 22 | + go version |
| 23 | + ``` |
| 24 | + |
| 25 | +- **Node.js and npm**: Required for PostCSS and autoprefixer |
| 26 | + ```bash |
| 27 | + # Check your Node.js and npm versions |
| 28 | + node --version # v18 or higher recommended |
| 29 | + npm --version |
| 30 | + ``` |
| 31 | + |
| 32 | +- **Git**: For version control and Hugo module management |
| 33 | + ```bash |
| 34 | + # Check your Git version |
| 35 | + git --version |
| 36 | + ``` |
| 37 | + |
| 38 | +## Installation |
| 39 | + |
| 40 | +### 1. Clone the Repository |
| 41 | + |
| 42 | +```bash |
| 43 | +git clone https://github.com/ansible-middleware/nextgen-website.git |
| 44 | +cd nextgen-website |
9 | 45 | ``` |
10 | | -cd ansible-middleware-nextgen |
| 46 | + |
| 47 | +### 2. Install Hugo Modules |
| 48 | + |
| 49 | +Hugo modules are used for theme management. Initialize the modules: |
| 50 | + |
| 51 | +```bash |
| 52 | +hugo mod get -u |
| 53 | +``` |
| 54 | + |
| 55 | +### 3. Install npm Dependencies |
| 56 | + |
| 57 | +npm dependencies are required for PostCSS processing: |
| 58 | + |
| 59 | +```bash |
| 60 | +npm install |
| 61 | +``` |
| 62 | + |
| 63 | +This installs: |
| 64 | +- **autoprefixer**: Adds vendor prefixes to CSS |
| 65 | +- **postcss-cli**: PostCSS command-line interface |
| 66 | +- **hugo-extended**: Hugo binary for npm scripts |
| 67 | + |
| 68 | +## Development |
| 69 | + |
| 70 | +### Running the Development Server |
| 71 | + |
| 72 | +To run the website locally with live reload: |
| 73 | + |
| 74 | +```bash |
11 | 75 | hugo serve |
12 | 76 | ``` |
| 77 | + |
| 78 | +Or use the npm script: |
| 79 | + |
| 80 | +```bash |
| 81 | +npm run serve |
| 82 | +``` |
| 83 | + |
| 84 | +The site will be available at `http://localhost:1313/` |
| 85 | + |
| 86 | +## Project Structure |
| 87 | + |
| 88 | +``` |
| 89 | +nextgen-website/ |
| 90 | +├── assets/ # SCSS, JavaScript, and other assets |
| 91 | +│ ├── icons/ # Site icons and logos |
| 92 | +│ └── scss/ # Custom SCSS styles |
| 93 | +│ ├── main.scss # Main SCSS entry (overrides Docsy) |
| 94 | +│ ├── _fa-variables.scss # Font Awesome icon variables |
| 95 | +│ └── _variables_project.scss # Project variables |
| 96 | +├── content/ # Content files (Markdown) |
| 97 | +│ └── en/ # English content |
| 98 | +│ ├── blog/ # Blog posts |
| 99 | +│ ├── examples/ # Example documentation |
| 100 | +│ └── Overview/ # Overview pages |
| 101 | +├── layouts/ # Hugo templates and partials |
| 102 | +│ ├── _default/ # Default layouts |
| 103 | +│ ├── blog/ # Blog-specific layouts |
| 104 | +│ ├── partials/ # Reusable template partials |
| 105 | +│ └── shortcodes/ # Custom shortcodes |
| 106 | +├── static/ # Static files (images, CSS, JS) |
| 107 | +├── public/ # Generated site (git ignored) |
| 108 | +├── hugo.toml # Hugo configuration |
| 109 | +├── postcss.config.js # PostCSS configuration |
| 110 | +├── go.mod # Go module dependencies |
| 111 | +├── package.json # npm dependencies |
| 112 | +└── README.md # This file |
| 113 | +``` |
| 114 | + |
| 115 | +## Configuration |
| 116 | + |
| 117 | +The site configuration is managed through **hugo.toml**. |
| 118 | + |
| 119 | +Key configuration areas: |
| 120 | +- Site metadata and branding |
| 121 | +- Navigation and menus |
| 122 | +- Search functionality (Algolia) |
| 123 | +- Social links and contact information |
| 124 | +- Hugo module imports (Docsy theme) |
| 125 | +- PostCSS processing settings |
| 126 | + |
| 127 | +## Content Management |
| 128 | + |
| 129 | +### Adding New Content |
| 130 | + |
| 131 | +1. Create a new markdown file in the appropriate directory under `content/en/`: |
| 132 | + ```bash |
| 133 | + hugo new blog/my-new-post.md |
| 134 | + ``` |
| 135 | + |
| 136 | +2. Edit the front matter and content: |
| 137 | + ```markdown |
| 138 | + --- |
| 139 | + title: "My New Post" |
| 140 | + date: 2025-11-27 |
| 141 | + description: "A brief description" |
| 142 | + --- |
| 143 | + |
| 144 | + Your content here... |
| 145 | + ``` |
| 146 | + |
| 147 | +3. Preview your changes with `hugo serve` |
| 148 | + |
| 149 | +### Content Organization |
| 150 | + |
| 151 | +- **Blog posts**: `content/en/blog/` |
| 152 | +- **Documentation**: `content/en/docs/` |
| 153 | +- **Examples**: `content/en/examples/` |
| 154 | +- **Overview pages**: `content/en/Overview/` |
| 155 | + |
| 156 | +## Dependencies |
| 157 | + |
| 158 | +### npm Dependencies |
| 159 | + |
| 160 | +- **autoprefixer** (^10.4.22): PostCSS plugin for vendor prefixes |
| 161 | +- **postcss-cli** (^11.0.1): CLI for PostCSS processing |
| 162 | +- **hugo-extended** (0.152.2): Hugo binary for npm scripts |
| 163 | + |
| 164 | +### Go Module Dependencies |
| 165 | + |
| 166 | +- **github.com/google/docsy** (v0.13.0): Docsy documentation theme |
| 167 | +- **github.com/google/docsy/dependencies** (v0.7.2): Bootstrap and dependencies |
| 168 | +- **github.com/FortAwesome/Font-Awesome** (v4.7.0): Icon font (loaded via CDN) |
| 169 | +- **github.com/twbs/bootstrap** (v5.3.8): Bootstrap CSS framework |
| 170 | + |
| 171 | +### Key Files |
| 172 | + |
| 173 | +- **postcss.config.js**: PostCSS configuration for autoprefixer |
| 174 | +- **assets/scss/main.scss**: Custom SCSS overriding Docsy defaults |
| 175 | +- **assets/scss/_fa-variables.scss**: Font Awesome icon variables |
| 176 | + |
| 177 | +## Updating Dependencies |
| 178 | + |
| 179 | +### Update npm packages: |
| 180 | +```bash |
| 181 | +npm run update:pkg:dep |
| 182 | +``` |
| 183 | + |
| 184 | +### Update Hugo: |
| 185 | +```bash |
| 186 | +npm run update:pkg:hugo |
| 187 | +``` |
| 188 | + |
| 189 | +### Update Go modules: |
| 190 | +```bash |
| 191 | +go get -u github.com/google/docsy@latest |
| 192 | +go mod tidy |
| 193 | +``` |
| 194 | + |
| 195 | +## Docker Support |
| 196 | + |
| 197 | +A Docker configuration is available for containerized deployment: |
| 198 | + |
| 199 | +```bash |
| 200 | +# Build the Docker image |
| 201 | +docker-compose build |
| 202 | + |
| 203 | +# Run the container |
| 204 | +docker-compose up |
| 205 | +``` |
| 206 | + |
| 207 | +## Contributing |
| 208 | + |
| 209 | +Contributions are welcome! Please follow these guidelines: |
| 210 | + |
| 211 | +1. Fork the repository |
| 212 | +2. Create a feature branch (`git checkout -b feature/amazing-feature`) |
| 213 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 214 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 215 | +5. Open a Pull Request |
| 216 | + |
| 217 | +### Code Style |
| 218 | + |
| 219 | +- Follow Hugo best practices |
| 220 | +- Use semantic HTML |
| 221 | +- Write clear, descriptive commit messages |
| 222 | +- Test your changes locally before submitting |
| 223 | + |
| 224 | +## Testing |
| 225 | + |
| 226 | +Run link checking: |
| 227 | +```bash |
| 228 | +npm run check:links |
| 229 | +``` |
| 230 | + |
| 231 | +Run all tests: |
| 232 | +```bash |
| 233 | +npm test |
| 234 | +``` |
| 235 | + |
| 236 | +## Deployment |
| 237 | + |
| 238 | +The site is automatically deployed to GitHub Pages via GitHub Actions when changes are pushed to the main branch. |
| 239 | + |
| 240 | +### CI/CD Workflow |
| 241 | + |
| 242 | +The `.github/workflows/gh-pages.yml` workflow: |
| 243 | +1. Installs Hugo 0.146.0 extended |
| 244 | +2. Sets up Node.js 18 and installs dependencies |
| 245 | +3. Builds the site with PostCSS processing |
| 246 | +4. Deploys to GitHub Pages |
| 247 | + |
| 248 | +### Manual Build |
| 249 | + |
| 250 | +For local production builds: |
| 251 | +```bash |
| 252 | +npm run build:production |
| 253 | +``` |
| 254 | + |
| 255 | +The output will be in the `public/` directory. |
| 256 | + |
| 257 | +## License |
| 258 | + |
| 259 | +This project is licensed under the Apache License 2.0 - see the LICENSE file for details. |
| 260 | + |
| 261 | +## Support |
| 262 | + |
| 263 | +- **Email**: ansible-middleware-core@redhat.com |
| 264 | +- **GitHub Issues**: https://github.com/ansible-middleware/nextgen-website/issues |
| 265 | +- **Repository**: https://github.com/ansible-middleware |
| 266 | + |
| 267 | +--- |
| 268 | + |
| 269 | +**Ansible Middleware** - Automating Enterprise Middleware at Scale |
0 commit comments