|
| 1 | += Antora Themes Gallery |
| 2 | +:toc: macro |
| 3 | +:toc-title: Contents |
| 4 | + |
| 5 | +A beautiful gallery and registry for https://antora.org[Antora] documentation themes built with https://astro.build[Astro] and https://www.solidjs.com[SolidJS]. |
| 6 | + |
| 7 | +toc::[] |
| 8 | + |
| 9 | +== Features |
| 10 | + |
| 11 | +* **Theme Gallery** -- Browse and search Antora UI themes |
| 12 | +* **Live Previews** -- See themes in action via GitHub Pages demos |
| 13 | +* **Theme Validation** -- Submit themes with automated validation |
| 14 | +* **Decentralized Architecture** -- Themes are hosted on developers' own repositories |
| 15 | + |
| 16 | +== Getting Started |
| 17 | + |
| 18 | +=== Prerequisites |
| 19 | + |
| 20 | +* Node.js 18+ |
| 21 | +* pnpm |
| 22 | + |
| 23 | +=== Installation |
| 24 | + |
| 25 | +[source,bash] |
| 26 | +---- |
| 27 | +# Clone the repository |
| 28 | +git clone https://github.com/the-dev-center/antora-themes-site.git |
| 29 | +cd antora-themes-site |
| 30 | +
|
| 31 | +# Install dependencies |
| 32 | +pnpm install |
| 33 | +
|
| 34 | +# Start development server |
| 35 | +pnpm dev |
| 36 | +---- |
| 37 | + |
| 38 | +=== Building for Production |
| 39 | + |
| 40 | +[source,bash] |
| 41 | +---- |
| 42 | +pnpm build |
| 43 | +pnpm preview |
| 44 | +---- |
| 45 | + |
| 46 | +== Submitting a Theme |
| 47 | + |
| 48 | +To submit your Antora UI theme to the gallery: |
| 49 | + |
| 50 | +. Create a public GitHub repository with your Antora UI theme |
| 51 | +. Add a `preview.png` screenshot (1280x720 recommended) to your repository root |
| 52 | +. Enable GitHub Pages for your repository |
| 53 | +. Visit the gallery and submit your repository URL |
| 54 | + |
| 55 | +=== Automated Screenshots |
| 56 | + |
| 57 | +Add this GitHub Action to your theme repository for automatic screenshot generation: |
| 58 | + |
| 59 | +[source,yaml] |
| 60 | +---- |
| 61 | +- name: Generate Preview Screenshot |
| 62 | + uses: simonw/shot-scraper-action@v1 |
| 63 | + with: |
| 64 | + url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/ |
| 65 | + output: preview.png |
| 66 | + width: 1280 |
| 67 | + height: 720 |
| 68 | +
|
| 69 | +- name: Commit Screenshot |
| 70 | + run: | |
| 71 | + git config user.name "Preview Bot" |
| 72 | + git config user.email "actions@github.com" |
| 73 | + git add preview.png |
| 74 | + git commit -m "Update preview screenshot" || exit 0 |
| 75 | + git push |
| 76 | +---- |
| 77 | + |
| 78 | +== Architecture |
| 79 | + |
| 80 | +This site uses a decentralized approach: |
| 81 | + |
| 82 | +* **No Build Pipeline** -- Themes are built and hosted by developers |
| 83 | +* **Metadata Registry** -- The gallery stores only theme metadata and links |
| 84 | +* **GitHub API Integration** -- Validates themes and fetches repository info |
| 85 | + |
| 86 | +=== App Structure |
| 87 | + |
| 88 | +[source] |
| 89 | +---- |
| 90 | +src/ |
| 91 | +├── components/ # SolidJS interactive components |
| 92 | +│ ├── SubmitThemeForm.tsx # Theme submission with validation |
| 93 | +│ ├── ThemeCard.tsx # Individual theme card with preview |
| 94 | +│ └── ThemeGallery.tsx # Filterable/searchable gallery grid |
| 95 | +├── data/ |
| 96 | +│ └── themes.ts # Sample themes and localStorage helpers |
| 97 | +├── layouts/ |
| 98 | +│ └── Layout.astro # Main layout with nav and footer |
| 99 | +├── lib/ |
| 100 | +│ └── github.ts # GitHub API integration for validation |
| 101 | +├── pages/ |
| 102 | +│ ├── index.astro # Homepage with hero + gallery |
| 103 | +│ └── submit.astro # Theme submission page |
| 104 | +├── styles/ |
| 105 | +│ └── global.css # Tailwind CSS configuration |
| 106 | +└── types/ |
| 107 | + └── theme.ts # TypeScript interfaces |
| 108 | +---- |
| 109 | + |
| 110 | +**Component Details** |
| 111 | + |
| 112 | +`ThemeCard.tsx`:: |
| 113 | +Displays a single theme with preview image, metadata, star count, and action buttons for viewing the demo or repository. |
| 114 | + |
| 115 | +`ThemeGallery.tsx`:: |
| 116 | +Renders a grid of ThemeCards with search, tag filtering, and sorting (by stars, update date, or name). |
| 117 | + |
| 118 | +`SubmitThemeForm.tsx`:: |
| 119 | +Handles theme submission with real-time validation via the GitHub API. Checks that the repository exists and contains a `preview.png`. |
| 120 | + |
| 121 | +`github.ts`:: |
| 122 | +Utility functions for parsing GitHub URLs, fetching repository info, validating preview images, and building theme objects from API responses. |
| 123 | + |
| 124 | +== Tech Stack |
| 125 | + |
| 126 | +* https://astro.build[Astro] -- Static site framework |
| 127 | +* https://www.solidjs.com[SolidJS] -- Reactive UI components |
| 128 | +* https://tailwindcss.com[Tailwind CSS] -- Utility-first styling |
| 129 | +* TypeScript -- Type safety |
| 130 | + |
| 131 | +== License |
| 132 | + |
| 133 | +MIT |
0 commit comments