mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 13:24:01 -07:00
refactor: update Docusaurus configuration and enhance documentation structure (#2029)
- Refactored docusaurus.config.ts to streamline configuration, including the addition of an API sidebar and improved edit URLs for documentation. - Updated sidebars.ts to include a new autogenerated sidebar for the API documentation. - Adjusted styles in styles.module.css for better feature display on the homepage. - Modified logo.svg to use a viewBox for improved scalability. These changes aim to enhance the organization and accessibility of the documentation, ensuring a better user experience.
This commit is contained in:
parent
df135a2b41
commit
6f1f6bf6a6
4 changed files with 37 additions and 44 deletions
|
@ -9,29 +9,19 @@ const config: Config = {
|
||||||
tagline: 'Modern Laravel-based BitTorrent tracker',
|
tagline: 'Modern Laravel-based BitTorrent tracker',
|
||||||
favicon: 'img/favicon.ico',
|
favicon: 'img/favicon.ico',
|
||||||
|
|
||||||
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
|
|
||||||
future: {
|
future: {
|
||||||
v4: true, // Improve compatibility with the upcoming Docusaurus v4
|
v4: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set the production url of your site here
|
|
||||||
url: 'https://docs.torrentpier.com',
|
url: 'https://docs.torrentpier.com',
|
||||||
// Set the /<baseUrl>/ pathname under which your site is served
|
|
||||||
// For GitHub pages deployment, it is often '/<projectName>/'
|
|
||||||
baseUrl: '/',
|
baseUrl: '/',
|
||||||
|
organizationName: 'torrentpier',
|
||||||
// GitHub pages deployment config.
|
projectName: 'torrentpier.github.io',
|
||||||
// If you aren't using GitHub pages, you don't need these.
|
|
||||||
organizationName: 'torrentpier', // Usually your GitHub org/user name.
|
|
||||||
projectName: 'torrentpier.github.io', // Usually your repo name.
|
|
||||||
trailingSlash: false,
|
trailingSlash: false,
|
||||||
|
|
||||||
onBrokenLinks: 'throw',
|
onBrokenLinks: 'throw',
|
||||||
onBrokenMarkdownLinks: 'warn',
|
onBrokenMarkdownLinks: 'warn',
|
||||||
|
|
||||||
// Even if you don't use internationalization, you can use this field to set
|
|
||||||
// useful metadata like html lang. For example, if your site is Chinese, you
|
|
||||||
// may want to replace "en" with "zh-Hans".
|
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: 'en',
|
defaultLocale: 'en',
|
||||||
locales: ['en'],
|
locales: ['en'],
|
||||||
|
@ -43,10 +33,8 @@ const config: Config = {
|
||||||
{
|
{
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: './sidebars.ts',
|
sidebarPath: './sidebars.ts',
|
||||||
// Please change this to your repo.
|
editUrl: 'https://github.com/torrentpier/torrentpier/tree/dexter/docs/',
|
||||||
// Remove this to remove the "edit this page" links.
|
exclude: ['api/**'], // Exclude API folder from main docs
|
||||||
editUrl:
|
|
||||||
'https://github.com/torrentpier/torrentpier/tree/dexter/docs/',
|
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
showReadingTime: true,
|
showReadingTime: true,
|
||||||
|
@ -54,11 +42,7 @@ const config: Config = {
|
||||||
type: ['rss', 'atom'],
|
type: ['rss', 'atom'],
|
||||||
xslt: true,
|
xslt: true,
|
||||||
},
|
},
|
||||||
// Please change this to your repo.
|
editUrl: 'https://github.com/torrentpier/torrentpier/tree/dexter/docs/',
|
||||||
// Remove this to remove the "edit this page" links.
|
|
||||||
editUrl:
|
|
||||||
'https://github.com/torrentpier/torrentpier/tree/dexter/docs/',
|
|
||||||
// Useful options to enforce blogging best practices
|
|
||||||
onInlineTags: 'warn',
|
onInlineTags: 'warn',
|
||||||
onInlineAuthors: 'warn',
|
onInlineAuthors: 'warn',
|
||||||
onUntruncatedBlogPosts: 'warn',
|
onUntruncatedBlogPosts: 'warn',
|
||||||
|
@ -70,8 +54,20 @@ const config: Config = {
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
'@docusaurus/plugin-content-docs',
|
||||||
|
{
|
||||||
|
id: 'api',
|
||||||
|
path: 'docs/api',
|
||||||
|
routeBasePath: 'api',
|
||||||
|
sidebarPath: './sidebars.ts',
|
||||||
|
editUrl: 'https://github.com/torrentpier/torrentpier/tree/dexter/docs/',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
// Replace with your project's social card
|
|
||||||
image: 'img/social-card.jpg',
|
image: 'img/social-card.jpg',
|
||||||
navbar: {
|
navbar: {
|
||||||
title: 'TorrentPier',
|
title: 'TorrentPier',
|
||||||
|
@ -81,17 +77,19 @@ const config: Config = {
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
{to: '/blog/welcome', label: 'Blog', position: 'left'},
|
{to: '/blog/welcome', label: 'Blog', position: 'left'},
|
||||||
{
|
|
||||||
to: '/docs/api/overview',
|
|
||||||
label: 'API',
|
|
||||||
position: 'left',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: 'docSidebar',
|
type: 'docSidebar',
|
||||||
sidebarId: 'docsSidebar',
|
sidebarId: 'docsSidebar',
|
||||||
position: 'left',
|
position: 'left',
|
||||||
label: 'Documentation',
|
label: 'Documentation',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'docSidebar',
|
||||||
|
sidebarId: 'apiSidebar',
|
||||||
|
docsPluginId: 'api',
|
||||||
|
position: 'left',
|
||||||
|
label: 'API',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
href: 'https://github.com/torrentpier/torrentpier',
|
href: 'https://github.com/torrentpier/torrentpier',
|
||||||
label: 'GitHub',
|
label: 'GitHub',
|
||||||
|
@ -109,6 +107,10 @@ const config: Config = {
|
||||||
label: 'Getting Started',
|
label: 'Getting Started',
|
||||||
to: '/docs/intro',
|
to: '/docs/intro',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'API Reference',
|
||||||
|
to: '/api/overview',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,19 +15,7 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||||
const sidebars: SidebarsConfig = {
|
const sidebars: SidebarsConfig = {
|
||||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||||
docsSidebar: [{type: 'autogenerated', dirName: '.'}],
|
docsSidebar: [{type: 'autogenerated', dirName: '.'}],
|
||||||
|
apiSidebar: [{type: 'autogenerated', dirName: '.'}],
|
||||||
// But you can create a sidebar manually
|
|
||||||
/*
|
|
||||||
tutorialSidebar: [
|
|
||||||
'intro',
|
|
||||||
'hello',
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: 'Tutorial',
|
|
||||||
items: ['tutorial-basics/create-a-document'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sidebars;
|
export default sidebars;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.featureSvg {
|
.featureSvg {
|
||||||
height: 200px;
|
height: 140px;
|
||||||
width: 200px;
|
width: auto;
|
||||||
|
max-width: 100%;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto 1rem;
|
||||||
}
|
}
|
||||||
|
|
2
docs/static/img/logo.svg
vendored
2
docs/static/img/logo.svg
vendored
|
@ -1,4 +1,4 @@
|
||||||
<svg width="603" height="685" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
<svg viewBox="0 0 603 685" width="603" height="685" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<defs>
|
<defs>
|
||||||
<linearGradient x1="3.311%" y1="3.278%" x2="96.35%" y2="95.406%" id="b">
|
<linearGradient x1="3.311%" y1="3.278%" x2="96.35%" y2="95.406%" id="b">
|
||||||
<stop stop-color="#90F1FF" offset="0%"/>
|
<stop stop-color="#90F1FF" offset="0%"/>
|
||||||
|
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Loading…
Add table
Add a link
Reference in a new issue