|
| 1 | +--- |
| 2 | +icon: layout-navbar |
| 3 | +category: page-layout |
| 4 | +summary: Set the page layout, navigation, branding, and footer. |
| 5 | +top: |
| 6 | + - name: class |
| 7 | + type: TEXT |
| 8 | + description: class attribute added to the page's html element. It can be used to apply custom styling to |
| 9 | + the whole page through css. |
| 10 | + - name: css |
| 11 | + type: URL |
| 12 | + description: The URL of a CSS file to load and apply to the page. |
| 13 | + - name: description |
| 14 | + type: TEXT |
| 15 | + description: A description of the page. It can be displayed by search engines when your page appears in |
| 16 | + their results. |
| 17 | + - name: favicon |
| 18 | + type: URL |
| 19 | + description: The URL of the icon the web browser should display in bookmarks and tabs. This property is |
| 20 | + particularly useful if multiple sites are hosted on the same domain with different [``site_prefix``](https://github.com/sqlpage/SQLPage/blob/main/configuration.md#configuring-sqlpage). |
| 21 | + - name: fixed_top_menu |
| 22 | + type: BOOLEAN |
| 23 | + description: Fixes the top bar with menu at the top (the top bar remains visible when scrolling long pages). |
| 24 | + - name: font |
| 25 | + type: TEXT |
| 26 | + description: Specifies the font to be used for displaying text, which can be a valid font name from fonts.google.com |
| 27 | + or the path to a local WOFF2 font file starting with a slash (e.g., "/fonts/MyLocalFont.woff2"). |
| 28 | + - name: font_size |
| 29 | + type: INTEGER |
| 30 | + description: Font size on the page, in pixels. Set to 18 by default. |
| 31 | + - name: footer |
| 32 | + type: TEXT |
| 33 | + description: Muted text to display in the footer of the page. This can be used to display a link to the |
| 34 | + terms and conditions of your application, for instance. By default, shows "Built with SQLPage". Supports |
| 35 | + links with markdown. |
| 36 | + - name: icon |
| 37 | + type: ICON |
| 38 | + description: Name of an icon (from tabler-icons.io) to display next to the title in the navigation bar. |
| 39 | + - name: image |
| 40 | + type: URL |
| 41 | + description: The URL of an image to display next to the page title. |
| 42 | + - name: javascript |
| 43 | + type: URL |
| 44 | + description: The URL of a Javascript file to load and execute on the page. |
| 45 | + - name: javascript_module |
| 46 | + type: URL |
| 47 | + description: The URL of a javascript module in the ESM format (see javascript.info/modules) |
| 48 | + - name: language |
| 49 | + type: TEXT |
| 50 | + description: The language of the page. This can be used by search engines and screen readers to determine |
| 51 | + in which language the page is written. |
| 52 | + - name: layout |
| 53 | + type: TEXT |
| 54 | + description: The general page layout. Can be "boxed" (the default), "horizontal" (for a full-width menu), |
| 55 | + "vertical"(vertical menu), "fluid" (removes side margins). |
| 56 | + - name: link |
| 57 | + type: URL |
| 58 | + description: The target of the link in the top navigation bar. |
| 59 | + - name: manifest |
| 60 | + type: URL |
| 61 | + description: The location of the [manifest.json](https://developer.mozilla.org/en-US/docs/Web/Manifest) |
| 62 | + if the site is a [PWA](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps). Among other |
| 63 | + features, serving a manifest enables your site to be "installed" as an app on most mobile devices. |
| 64 | + - name: menu_item |
| 65 | + type: TEXT |
| 66 | + description: Adds a menu item in the navigation bar at the top of the page. The menu item will have the |
| 67 | + specified name, and will link to as .sql file of the same name. A dropdown can be generated by passing |
| 68 | + a json object with a `title` and `submenu` properties. |
| 69 | + - name: navbar_title |
| 70 | + type: TEXT |
| 71 | + description: The title shown in the navigation bar or sidebar. Defaults to the page title. Set an empty |
| 72 | + string to show just the logo. |
| 73 | + - name: navbar_toggle_label |
| 74 | + type: TEXT |
| 75 | + description: Customizes the accessible name of the button that opens and closes the navigation menu on small |
| 76 | + screens, which screen readers announce. Replaces the default "Toggle navigation". |
| 77 | + - name: norobot |
| 78 | + type: BOOLEAN |
| 79 | + description: Forbids robots to save this page in their database and follow the links on this page. This |
| 80 | + will prevent this page to appear in Google search results for any query, for instance. |
| 81 | + - name: preview_image |
| 82 | + type: URL |
| 83 | + description: The URL of an image to display as a link preview when the page is shared on social media |
| 84 | + - name: refresh |
| 85 | + type: INTEGER |
| 86 | + description: Number of seconds after which the page should refresh. This can be useful to display dynamic |
| 87 | + content that updates automatically. |
| 88 | + - name: rss |
| 89 | + type: URL |
| 90 | + description: The URL of an RSS feed to display in the top navigation bar. You can use the rss component |
| 91 | + to generate the field. |
| 92 | + - name: rtl |
| 93 | + type: BOOLEAN |
| 94 | + description: Whether the page should be displayed in right-to-left mode. Used to display Arabic, Hebrew, |
| 95 | + Persian, etc. |
| 96 | + - name: search_button |
| 97 | + type: TEXT |
| 98 | + description: Customizes the text displayed on the search button. Replaces the default "Search" label with |
| 99 | + custom text that may better match your applications terminology or language. |
| 100 | + - name: search_placeholder |
| 101 | + type: TEXT |
| 102 | + description: Customizes the placeholder text shown in the search input field. Replaces the default "Search" |
| 103 | + with text that better describes what users should search for. It is also used as the accessible name |
| 104 | + of the search field, which screen readers announce. |
| 105 | + - name: search_target |
| 106 | + type: TEXT |
| 107 | + description: When this is set, a search field will appear in the top navigation bar, and load the specified |
| 108 | + sql file with an URL parameter named "search" when the user searches something. |
| 109 | + - name: search_value |
| 110 | + type: TEXT |
| 111 | + description: This value will be placed in the search field when "search_target" is set. Using the "$search" |
| 112 | + query parameter value will mirror the value that the user has searched for. |
| 113 | + - name: sidebar |
| 114 | + type: BOOLEAN |
| 115 | + description: Whether the menu defined by menu_item should be displayed on the left side of the page instead |
| 116 | + of the top. Introduced in v0.27. |
| 117 | + - name: sidebar_theme |
| 118 | + type: TEXT |
| 119 | + description: Used with sidebar property, It can be set to "dark" to exclusively set the sidebar into dark |
| 120 | + theme. |
| 121 | + - name: social_image |
| 122 | + type: URL |
| 123 | + description: The URL of the preview image that will appear in the Open Graph metadata when the page is |
| 124 | + shared on social media. |
| 125 | + - name: target |
| 126 | + type: TEXT |
| 127 | + description: 'Where the menu items should open: "_blank" for a new tab, "_self" for the same tab, "_parent" |
| 128 | + for the parent frame, or "_top" for the full body of the window. Set it inside a "menu_item" json object; |
| 129 | + it has no effect when set directly on the shell.' |
| 130 | + - name: theme |
| 131 | + type: TEXT |
| 132 | + description: Set to "dark" to use a dark theme. |
| 133 | + - name: title |
| 134 | + type: TEXT |
| 135 | + description: The title of your page. Will be shown in a top bar above the page contents. Also usually displayed |
| 136 | + by web browsers as the name of the web page's tab. |
| 137 | +--- |
| 138 | + |
| 139 | +Customize the overall layout, header and footer of the page. |
| 140 | + |
| 141 | +This is a special component that provides the page structure wrapping all other components on your page. |
| 142 | + |
| 143 | +It generates the complete HTML document including the `<head>` section with metadata, title, and stylesheets, |
| 144 | +as well as the navigation bar, main content area, and footer. |
| 145 | + |
| 146 | +If you don't explicitly call the shell component at the top of your SQL file, SQLPage will automatically |
| 147 | +add a default shell component before your first try to display data on the page. |
| 148 | + |
| 149 | +Use the shell component to customize page-wide settings like the page title, navigation menu, theme, fonts, |
| 150 | +and to include custom visual styles (with CSS) or interactive behavior (with JavaScript) that should be loaded on the page. |
0 commit comments