mirror of
https://github.com/Shiva108/ai-llm-red-team-handbook.git
synced 2026-02-12 14:42:46 +00:00
4.6 KiB
4.6 KiB
GitHub Pages Deployment Instructions
This repository is configured for both GitBook and GitHub Pages deployment.
GitHub Pages Setup
1. Enable GitHub Pages
- Go to your repository on GitHub
- Click Settings → Pages
- Under Source, select:
- Branch:
main(ormaster) - Folder:
/ (root)
- Branch:
- Click Save
2. Update Configuration
Edit _config.yml and update these fields:
baseurl: "/ai-llm-red-team-handbook-and-field-manual" # Updated to match GitBook
url: "https://cph-sec.gitbook.io" # Updated to match GitBook
github_username: shiva108 # Your GitHub username
linkedin_username: thorkristiansen # Your LinkedIn username
3. Access Your Site
After a few minutes, your site will be available at:
https://shiva108.github.io/ai-llm-red-team-handbook/
4. Custom Domain (Optional)
To use a custom domain:
- Add a
CNAMEfile to the root with your domain name - Configure DNS settings at your domain registrar
- Enable HTTPS in GitHub Pages settings
GitBook Setup
Method 1: GitBook Cloud (Recommended)
- Go to gitbook.com
- Sign in and click New Space
- Select Import from GitHub
- Choose your repository:
shiva108/ai-llm-red-team-handbook - GitBook will auto-detect
.gitbook.yamlanddocs/SUMMARY.mdand build your book
Method 2: GitBook CLI (Local - Legacy)
# Install GitBook CLI
npm install -g gitbook-cli
# Navigate to your repository
cd ai-llm-red-team-handbook
# Install plugins
gitbook install
# Serve locally
gitbook serve
# Build static site
gitbook build
# The built site will be in _book/ directory
3. GitBook Plugins & Branding
The repository uses a dual-configuration strategy to support both legacy builds and modern GitBook Cloud SaaS.
Branding (Logo & Assets)
- Asset Location:
docs/assets/page_header.svg - Configuration:
.gitbook.yaml: Definesbrandingblock pointing todocs/assets/page_header.svg(for new SaaS builds).book.json: Definesinsert-logoplugin pointing toassets/page_header.svg(relative todocsroot).
- Note: GitBook Cloud (SaaS) often ignores file-based theming. If the logo does not appear, you must set it manually via Customize > Look & Feel in the GitBook Dashboard.
Plugins (Legacy)
Defined in book.json:
- search-plus: Enhanced search
- copy-code-button: Copy code blocks
- github: GitHub integration
- prism: Syntax highlighting
- page-treeview: Chapter navigation
To install all plugins:
gitbook install
Configuration Files
| File | Purpose | Platform |
|---|---|---|
_config.yml |
Jekyll configuration | GitHub Pages |
.gitbook.yaml |
GitBook integration | GitBook |
book.json |
GitBook plugins & settings | GitBook |
docs/SUMMARY.md |
Table of contents | GitBook |
README.md |
Homepage | Both |
Formatting & Asset Management
Images
All images must be placed in docs/assets/.
Reference them in markdown as  (from root docs) or  (from subdirectories like field_manuals/).
Building for Different Formats
PDF Export (GitBook)
gitbook pdf ./ ./handbook.pdf
eBook Export (GitBook)
# EPUB
gitbook epub ./ ./handbook.epub
# MOBI
gitbook mobi ./ ./handbook.mobi
Customization
GitHub Pages Theme
Change theme in _config.yml:
theme: jekyll-theme-cayman # Current
# theme: jekyll-theme-minimal
# theme: jekyll-theme-slate
# theme: jekyll-theme-architect
GitBook Styling
Create custom CSS in styles/website.css:
/* Custom styles for GitBook */
.book-summary {
background: #f7f7f7;
}
Troubleshooting
GitHub Pages not building?
- Check that
_config.ymlis valid YAML - Ensure your branch name is correct in settings
- Wait 5-10 minutes for first build
GitBook plugins not working?
# Clear cache and reinstall
rm -rf node_modules
rm -rf _book
gitbook install
gitbook serve
Links broken?
- Use relative links:
[Chapter 1](docs/Chapter_01.md) - Avoid absolute paths
- Test locally before pushing
Next Steps
- ✅ Push these configuration files to GitHub
- ✅ Enable GitHub Pages in repository settings
- ✅ Connect to GitBook cloud (optional)
- ✅ Customize URLs and branding
- ✅ Share your published handbook!
Your handbook is now ready for both GitBook and GitHub Pages! 🎉