|
| 1 | +import { defineConfig } from 'vitepress' |
| 2 | + |
| 3 | +// https://vitepress.dev/reference/site-config |
| 4 | +export default defineConfig({ |
| 5 | + title: "CanCanCan", |
| 6 | + description: "The authorization Gem for Ruby on Rails.", |
| 7 | + head: [ |
| 8 | + ['link', { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" }], |
| 9 | + ['link', { rel: "icon", type: "image/png", sizes: "32x32", href: "/favicon-32x32.png" }], |
| 10 | + ['link', { rel: "icon", type: "image/png", sizes: "16x16", href: "/favicon-16x16.png" }], |
| 11 | + ['link', { rel: "mask-icon", href: "./safari-pinned-tab.svg", color: "#3c3ebf" }], |
| 12 | + |
| 13 | + ['link', { rel: "icon", href: "/favicon.ico", type: "image/x-icon" }], |
| 14 | + ['link', { rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon" }], |
| 15 | + ], |
| 16 | + sitemap: { |
| 17 | + hostname: 'https://cancancan.dev' |
| 18 | + }, |
| 19 | + cleanUrls: true, |
| 20 | + themeConfig: { |
| 21 | + // https://vitepress.dev/reference/default-theme-config |
| 22 | + nav: [ |
| 23 | + { text: 'Docs', link: '/README' }, |
| 24 | + { text: 'Changelog', link: 'https://github.com/CanCanCommunity/cancancan/blob/main/CHANGELOG.md' }, |
| 25 | + { |
| 26 | + text: 'Screencasts', |
| 27 | + items: [ |
| 28 | + { text: 'Screencast 1', link: 'http://railscasts.com/episodes/192-authorization-with-cancan' }, |
| 29 | + { text: 'Screencast 2', link: 'https://www.youtube.com/watch?v=cTYu-OjUgDw' } |
| 30 | + ] |
| 31 | + }, |
| 32 | + ], |
| 33 | + |
| 34 | + footer: { |
| 35 | + message: 'Made with ❤️ by the <a href="https://github.com/CanCanCommunity/cancancan/graphs/contributors" target="_blank">CanCanCan community</a>', |
| 36 | + copyright: `${new Date().getFullYear()} CanCanCan` |
| 37 | + }, |
| 38 | + externalLinkIcon: true, |
| 39 | + |
| 40 | + lastUpdated: { |
| 41 | + formatOptions: { |
| 42 | + dateStyle: 'medium', |
| 43 | + } |
| 44 | + }, |
| 45 | + editLink: { |
| 46 | + pattern: 'https://github.com/CanCanCommunity/cancancan/edit/main/docs/:path' |
| 47 | + }, |
| 48 | + search: { |
| 49 | + provider: 'local' |
| 50 | + }, |
| 51 | + |
| 52 | + logo: '/cancancan.png', |
| 53 | + |
| 54 | + sidebar: [ |
| 55 | + { |
| 56 | + text: 'Guide', |
| 57 | + items: [ |
| 58 | + { text: 'Introduction', link: '/introduction' }, |
| 59 | + { text: 'Installation', link: '/installation' }, |
| 60 | + { text: 'Define and check abilities', link: '/define_check_abilities' }, |
| 61 | + { text: 'Controller helpers', link: '/controller_helpers' }, |
| 62 | + { text: 'Fetching records', link: '/fetching_records' }, |
| 63 | + { text: 'Cannot', link: '/cannot' }, |
| 64 | + { text: 'Hash of conditions', link: '/hash_of_conditions' }, |
| 65 | + { text: 'Combine Abilities', link: '/combine_abilities' }, |
| 66 | + { text: 'Check abilities - avoid mistakes', link: '/check_abilities_mistakes' }, |
| 67 | + { text: 'Handling CanCan::AccessDenied', link: '/handling_access_denied' }, |
| 68 | + { text: 'Customize controller helpers', link: '/changing_defaults' }, |
| 69 | + { text: 'Accessing request data', link: '/accessing_request_data' }, |
| 70 | + { text: 'SQL strategies', link: '/sql_strategies' }, |
| 71 | + { text: 'Accessible attributes', link: '/accessible_attributes' }, |
| 72 | + { text: 'Testing', link: '/testing' }, |
| 73 | + { text: 'Internationalization', link: '/internationalization' } |
| 74 | + ] |
| 75 | + }, |
| 76 | + { |
| 77 | + text: 'Further topics', |
| 78 | + items: [ |
| 79 | + { text: 'Migrating', link: '/migrating' }, |
| 80 | + { text: 'Debugging Abilities', link: '/debugging' }, |
| 81 | + { text: 'Split your ability file', link: '/split_ability' }, |
| 82 | + { text: 'Define Abilities - best practices', link: '/define_abilities_best_practices' }, |
| 83 | + { text: 'Abilities in database', link: '/abilities_in_database' }, |
| 84 | + { text: 'Role-based Authorization', link: '/role_based_authorization' }, |
| 85 | + { text: 'Model Adapter', link: '/model_adapter' }, |
| 86 | + { text: 'Rules compression', link: '/rules_compression' }, |
| 87 | + { text: 'Inherited Resources', link: '/inherited_resources' }, |
| 88 | + { text: 'Devise', link: '/devise' }, |
| 89 | + { text: 'FriendlyId', link: '/friendly_id' } |
| 90 | + ] |
| 91 | + } |
| 92 | + ], |
| 93 | + socialLinks: [ |
| 94 | + { icon: 'github', link: 'https://github.com/CanCanCommunity/cancancan' } |
| 95 | + ] |
| 96 | + } |
| 97 | +}) |
0 commit comments