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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/** linguist-documentation
89 changes: 89 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "Docs"

on:
workflow_dispatch:
push:
branches: [master, main]
paths:
- ".github/workflows/docs.yaml"
- ".vitepress/**"
- "docs/**"
- "package*.json"

env:
crawler-id: ""
purge-domain: ""

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: "Build"
if: ${{ !contains(github.event.head_commit.message, '#nodeploy') }}
uses: cssnr/workflows/.github/workflows/npm-build.yaml@master
permissions:
contents: read
with:
install: "npm ci"
build: "npm run docs:deploy"
path: "docs/.vitepress/dist"
pages: true
secrets: inherit

deploy:
name: "Deploy"
runs-on: ubuntu-latest
timeout-minutes: 5
needs: build

permissions:
pages: write
id-token: write

environment:
name: docs
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: "Deploy Pages"
id: deployment
uses: actions/deploy-pages@v5

- name: "Send Deploy Notification"
if: ${{ !cancelled() }}
continue-on-error: true
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ steps.deployment.outputs.page_url }}

post:
name: "Post"
runs-on: ubuntu-latest
timeout-minutes: 5
needs: deploy

steps:
- name: "Purge Cache"
if: ${{ env.purge-domain != '' }}
uses: cssnr/cloudflare-purge-cache-action@v2
with:
zones: ${{ env.purge-domain }}
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}

- name: "Algolia Crawler"
if: ${{ env.crawler-id != '' }}
uses: cssnr/algolia-crawler-action@v2
with:
crawler_id: ${{ env.crawler-id }}
crawler_user_id: ${{ secrets.CRAWLER_USER_ID }}
crawler_api_key: ${{ secrets.CRAWLER_API_KEY }}

- name: "Send Discord Notification"
if: ${{ failure() }}
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
72 changes: 72 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: "Preview"

on:
workflow_dispatch:
push:
branches-ignore: [master, main, legacy]
paths:
- ".github/workflows/preview.yaml"
- ".vitepress/**"
- "docs/**"
- "package*.json"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: "Build"
if: ${{ !contains(github.event.head_commit.message, '#nopreview') }}
uses: cssnr/workflows/.github/workflows/npm-build.yaml@master
permissions:
contents: read
with:
install: "npm ci"
build: "npm run docs:deploy"
path: "docs/.vitepress/dist"
secrets: inherit

deploy:
name: "Deploy"
uses: cssnr/workflows/.github/workflows/deploy-static.yaml@master
needs: build
permissions:
contents: read
with:
name: "preview"
url: "https://dev-static.cssnr.com/auto-auth/"
path: "auto-auth"
robots: true
secrets:
host: ${{ secrets.DEV_DEPLOY_HOST }}
port: ${{ secrets.DEV_DEPLOY_PORT }}
user: ${{ secrets.DEV_DEPLOY_USER }}
pass: ${{ secrets.DEV_DEPLOY_PASS }}
webhook: ${{ secrets.DISCORD_WEBHOOK }}

lint:
name: "Lint"
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ !contains(github.event.head_commit.message, '#nolint') }}
steps:
- name: "Checkout"
uses: actions/checkout@v7

- name: "Setup Node"
uses: actions/setup-node@v6
with:
node-version: 24

- name: "Install"
id: install
run: npm ci --ignore-scripts

- name: "eslint"
if: ${{ !cancelled() }}
run: npm run lint

- name: "prettier"
if: ${{ !cancelled() }}
run: npm run prettier:check
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
.idea/
*.iml
.vscode/
cache/
dist/
build/
node_modules/
web-ext-artifacts/
*.tsbuildinfo
# WXT
.output
stats.html
stats-*.json
.wxt
web-ext.config.ts
web-ext-artifacts/
# VitePress
contributors.json
.env
.env.development
160 changes: 160 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import { defineConfig } from 'vitepress'
import instructions from 'vitepress-chat/instructions'

const settings = {
title: 'Auto Auth',
name: 'Auto Auth Web Extension and Browser Add-on',
description: {
short:
'Automatic HTTP Basic Authentication with saved credentials, import/export, and a customizable login page.',
long: 'Modern Chrome Web Extension and Firefox Browser Add-on for Automatic Basic HTTP Authentication with many Options and Features. Replaces the native browser auth popup with a customizable login page allowing you to optionally save your credentials.',
},
base: '/auto-auth/', // set to empty string for no base path
og_image: '/auto-auth/images/logo.png', // must be full path
color: '#32fc7d',
source_repo: 'https://github.com/cssnr/auto-auth',
chrome_url: 'https://chromewebstore.google.com/detail/gpoiggobidhogpmmlakahiaaegibnogm',
mozilla_url: 'https://addons.mozilla.org/addon/auto-auth',
}

// https://vitepress.dev/reference/site-config
// noinspection JSUnusedGlobalSymbols
export default defineConfig({
// srcDir: './docs',
base: settings.base,
vite: {
envDir: '..',
plugins: [
instructions({ filePath: 'llms.txt', exclude: ['index.md', 'updates/**'] }),
],
server: {
allowedHosts: true,
},
},

title: settings.title,
description: settings.description.short,
head: [
[
'link',
{
rel: 'icon',
sizes: 'any',
href: `${settings.base}images/logo.svg`,
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '16x16 32x32 64x64 128x128',
href: `${settings.base}favicon.ico`,
type: 'image/x-icon',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '512x512',
href: settings.og_image,
type: 'image/png',
},
],

['meta', { name: 'darkreader-lock' }],

['meta', { name: 'theme-color', content: settings.color }],
['meta', { name: 'description', content: settings.description.long }],

['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:site_name', content: settings.name }],
['meta', { property: 'og:title', content: settings.title }],
['meta', { property: 'og:description', content: settings.description.short }],
['meta', { property: 'og:image', content: settings.og_image }],
['meta', { property: 'og:image:alt', content: settings.title }],

['meta', { property: 'twitter:card', content: 'summary' }],
['meta', { property: 'twitter:site', content: settings.name }],
['meta', { property: 'twitter:title', content: settings.title }],
['meta', { property: 'twitter:description', content: settings.description.short }],
['meta', { property: 'twitter:image', content: settings.og_image }],
['meta', { property: 'twitter:image:alt', content: settings.title }],
],

cleanUrls: true,
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
siteTitle: settings.title,
logo: '/images/logo.svg',
nav: [
{ text: 'Home', link: '/' },
{
text: 'Get Started',
link: '/install',
activeMatch: '/install',
},
{ text: 'Support', link: '/support', activeMatch: '/support' },
{
text: 'Links',
items: [
{ text: 'Chrome Web Store', link: settings.chrome_url },
{ text: 'Mozilla Add-ons', link: settings.mozilla_url },
{ text: 'GitHub Source Code', link: settings.source_repo },
{ text: 'Developer Site', link: 'https://cssnr.github.io/' },
{ text: 'Contribute', link: 'https://ko-fi.com/cssnr' },
],
},
],

socialLinks: [
{ icon: 'github', link: settings.source_repo },
{ icon: 'googlechrome', link: settings.chrome_url },
{ icon: 'firefoxbrowser', link: settings.mozilla_url },
{ icon: 'discord', link: 'https://discord.gg/wXy6m2X8wY' },
{ icon: 'kofi', link: 'https://ko-fi.com/cssnr' },
{
icon: {
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" style="fill: none;" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-globe"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></svg>',
},
link: 'https://cssnr.github.io/',
},
],

sidebar: [
{
text: 'Get Started',
items: [
{ text: 'Install', link: '/install' },
{ text: 'Usage', link: '/usage' },
{ text: 'Options', link: '/options' },
{ text: 'Migration', link: '/migration' },
],
},
{
text: 'Support',
items: [
{ text: 'Security', link: '/security' },
{ text: 'Get Help', link: '/support' },
],
},
],

editLink: {
pattern: `${settings.source_repo}/blob/master/docs/:path`,
text: 'View or Edit on GitHub',
},

lastUpdated: {
text: 'Updated at',
formatOptions: {
dateStyle: 'medium',
timeStyle: 'medium',
},
},

externalLinkIcon: true,
outline: 'deep',
},
})
Loading
Loading