Skip to content
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
65 changes: 65 additions & 0 deletions .github/workflows/gatsby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and Deploy Gatsby Website

on:
push:
branches:
- main
paths:
- 'src/website/**'
- 'docs/**'
- '.github/workflows/gatsby.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/website
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: src/website/package-lock.json

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Install dependencies
run: npm ci

- name: Build Gatsby site
run: npm run build
env:
PREFIX_PATHS: true

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: src/website/public

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

A comprehensive multi-language toolkit for ad-blocking, network protection, and AdGuard DNS management. Features filter rule compilers in **5 languages** (TypeScript, .NET, Python, Rust, PowerShell), plus complete **API SDKs for AdGuard DNS** in both C# and Rust with interactive console interfaces.

📚 **[View Documentation Website](https://jaypatrick.github.io/ad-blocking)** - User-friendly documentation for all features and recent improvements.

## Table of Contents

- [Features](#features)
Expand Down Expand Up @@ -154,6 +156,11 @@ ad-blocking/
│ ├── adguard-validation/ # Rust validation library
│ │ ├── adguard-validation-core/ # Core validation logic
│ │ └── adguard-validation-cli/ # CLI tool
│ ├── website/ # Gatsby documentation website
│ │ ├── src/pages/ # Static pages (home, getting started)
│ │ ├── src/templates/ # Dynamic page templates
│ │ ├── src/components/ # React components
│ │ └── gatsby-config.js # Gatsby configuration
│ └── linear/ # Linear integration scripts
├── tools/ # Utility and build scripts
│ ├── README.md # Tools documentation
Expand Down Expand Up @@ -1463,6 +1470,17 @@ Download the latest release from the [Releases page](https://github.com/jaypatri

## Documentation

### 📚 Documentation Website

**[https://jaypatrick.github.io/ad-blocking](https://jaypatrick.github.io/ad-blocking)**

A user-friendly Gatsby-powered website with:
- Organized documentation by category (Getting Started, Guides, API, Technical)
- Recent improvements and changelog
- Responsive design for desktop and mobile
- Full-text search across all documentation
- Direct links to all 58+ markdown files

### Getting Started

- [Getting Started Guide](docs/getting-started.md) - Quick installation and first compilation
Expand Down
20 changes: 20 additions & 0 deletions src/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Build output
.cache/
public/

# Dependencies
node_modules/

# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# IDE
.DS_Store
.vscode/
.idea/

# Gatsby
.env*
!.env.example
42 changes: 42 additions & 0 deletions src/website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Ad-Blocking Toolkit Website

This is a Gatsby-powered documentation website for the Ad-Blocking repository.

## Development

```bash
# Install dependencies
npm install

# Start development server
npm run develop

# Build for production
npm run build

# Serve production build
npm run serve
```

## Structure

- `src/pages/` - Static pages (home, getting started, etc.)
- `src/templates/` - Templates for dynamically generated pages
- `src/components/` - Reusable React components
- `src/styles/` - Global CSS styles
- `gatsby-config.js` - Gatsby configuration
- `gatsby-node.js` - Node APIs for page generation

## Features

- 📚 Automatic documentation from markdown files
- 🔍 Organized by category (Guides, API, Technical)
- 📱 Responsive design
- 🚀 Fast static site generation
- 🎨 Clean, accessible UI

## Deployment

The site is automatically built and deployed to GitHub Pages when changes are pushed to the main branch.

Site URL: https://jaypatrick.github.io/ad-blocking
51 changes: 51 additions & 0 deletions src/website/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Gatsby configuration for Ad-Blocking documentation website
* @type {import('gatsby').GatsbyConfig}
*/
module.exports = {
siteMetadata: {
title: `Ad-Blocking Toolkit`,
description: `A comprehensive multi-language toolkit for ad-blocking, network protection, and AdGuard DNS management`,
author: `Ad-Blocking Contributors`,
siteUrl: `https://jaypatrick.github.io/ad-blocking`,
},
pathPrefix: `/ad-blocking`,
plugins: [
`gatsby-plugin-image`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `docs`,
path: `${__dirname}/../../docs`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `root-docs`,
path: `${__dirname}/../..`,
ignore: [`**/node_modules/**`, `**/.*`, `**/data/**`, `**/src/**`, `**/.github/**`, `**/tools/**`, `**/api/**`],
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [],
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Ad-Blocking Toolkit`,
short_name: `Ad-Blocking`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/icon.svg`,
},
},
],
}
44 changes: 44 additions & 0 deletions src/website/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const path = require(`path`)
const { createFilePath } = require(`gatsby-source-filesystem`)

exports.onCreateNode = ({ node, getNode, actions }) => {
const { createNodeField } = actions

if (node.internal.type === `MarkdownRemark`) {
const slug = createFilePath({ node, getNode, basePath: `docs` })
createNodeField({
node,
name: `slug`,
value: slug,
})
}
}

exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions

const result = await graphql(`
query {
allMarkdownRemark {
nodes {
id
fields {
slug
}
}
}
}
`)

const docTemplate = path.resolve(`./src/templates/doc.js`)

result.data.allMarkdownRemark.nodes.forEach((node) => {
createPage({
path: node.fields.slug,
component: docTemplate,
context: {
id: node.id,
},
})
})
}
Loading
Loading