diff options
Diffstat (limited to 'examples/docs/src/pages/en')
-rw-r--r-- | examples/docs/src/pages/en/getting-started.md | 190 | ||||
-rw-r--r-- | examples/docs/src/pages/en/index.astro | 5 | ||||
-rw-r--r-- | examples/docs/src/pages/en/introduction.md | 63 | ||||
-rw-r--r-- | examples/docs/src/pages/en/page-2.md | 50 | ||||
-rw-r--r-- | examples/docs/src/pages/en/page-3.md (renamed from examples/docs/src/pages/en/example.md) | 2 | ||||
-rw-r--r-- | examples/docs/src/pages/en/page-4.md | 36 |
6 files changed, 96 insertions, 250 deletions
diff --git a/examples/docs/src/pages/en/getting-started.md b/examples/docs/src/pages/en/getting-started.md deleted file mode 100644 index 33494432c..000000000 --- a/examples/docs/src/pages/en/getting-started.md +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: Getting Started -layout: ~/layouts/MainLayout.astro ---- - -This template already provides your pages with a side bar navigation (on the left) for your pages, and a content navigation (on the right) for your sections. - -## Page navigation - -The page navigation, through the side bar on the left, needs to be manually updated. Open the `config.ts` file and you will find the following structure: - -```ts -export const SIDEBAR = { - en: [ - { text: 'Getting Started', header: true }, - { text: 'Introduction', link: 'en/introduction' }, - { text: 'Getting Started', link: 'en/getting-started' }, - { text: 'Example', link: 'en/example' }, - ], - es: [ - { text: 'Empezando', header: true }, - { text: 'Introducción', link: 'es/introduction' }, - { text: 'Empezando', link: 'es/getting-started' }, - { text: 'Ejemplo', link: 'es/example' }, - ], - fr: [ - { text: 'Commencer', header: true }, - { text: 'Introduction', link: 'fr/introduction' }, - { text: 'Commencer', link: 'fr/getting-started' }, - { text: 'Exemple', link: 'fr/example' }, - ], -}; -``` - -The sidebar supports many languages, and each language has items to display, and pages to link to, allowing for a truly native experience for international users. You can change this file to match the pages you want to display, the object with the `{ header: true, ... }` set to true will act as a section title and cannot contain a link. - -The page navigation is generated in the `src/components/LeftSidebar/LeftSidebar.astro`, so if you want to change the depth of elements displayed, styles, etc, that's the place to go. - -## Section navigation - -The section navigation, through the side bar on the right, is automatically generated by the `src/components/RightSidebar/RightSidebar.astro` file, it uses the meta-data from markdown files to generate the structure you see. - -By default only elements from depth 2 to 5 will be displayed, and at the moment doesn't work for `.astro files`. - -## Other Components - -### Footer - -You can edit your footer here `src/components/Footer/Footer.astro`, at the moment it is composed of a list of avatars. You can generate your own avatar [here](https://getavataaars.com/) and replace the ones from `src/components/Footer/AvatarList.astro`. - -### Theme - -The `src/components/RightSidebar/ThemeToggleButton.tsx` is only responsible for applying the theme, to change the theme colors see `public/theme.css` - -## Multiple Languages - -By default the Astro docs template encourages writing your docs in mutliple languages, it also encourages writing your docs in a specific file structure - -``` -📦pages - ┣ 📂en - ┃ ┣ 📜example.md - ┃ ┣ 📜getting-started.md - ┃ ┣ 📜index.astro - ┃ ┗ 📜introduction.md - ┣ 📂es - ┃ ┣ 📜example.md - ┃ ┣ 📜getting-started.md - ┃ ┣ 📜index.astro - ┃ ┗ 📜introduction.md - ┣ 📂fr - ┃ ┣ 📜example.md - ┃ ┣ 📜getting-started.md - ┃ ┣ 📜index.astro - ┃ ┗ 📜introduction.md - ┗ 📜index.astro -``` - -each folder within the `pages/` folder represents a language, to add new languages, you will need to create a new langauge folder, -add the langauges name to the `LANGUAGE_NAMES` variable in the [`languages.ts`](../../languages.ts) file, and add new sidebar links corrosponding to the new language. E.g. Adding Deutsch as a supported language - -1. Create the `de/` folder in the pages directory - -``` -📦pages - ┣ 📂en - ┃ ┣ 📜example.md - ┃ ┣ 📜getting-started.md - ┃ ┣ 📜index.astro - ┃ ┗ 📜introduction.md - ┣ 📂de - ┃ ┣ 📜example.md - ┃ ┣ 📜getting-started.md - ┃ ┣ 📜index.astro - ┃ ┗ 📜introduction.md - ┗ 📜index.astro -``` - -2. Add Deutsch to the `LANGUAGE_NAMES` variable in the [`languages.ts`](../../languages.ts) file - -```ts -// src/languages.ts -export const LANGUAGE_NAMES = { - English: 'en', - Deutsch: 'de', -}; - -// ... -``` - -3. Add Deutch as a localized language for the SIDEBAR - -```ts -// src/config.ts -export const SIDEBAR = { - en: [ - { text: 'Getting Started', header: true }, - { text: 'Introduction', link: 'en/introduction' }, - { text: 'Getting Started', link: 'en/getting-started' }, - { text: 'Example', link: 'en/example' }, - ], - de: [ - { text: 'Einstieg', header: true }, - { text: 'Einführung', link: 'de/introduction' }, - { text: 'Einstieg', link: 'de/getting-started' }, - { text: 'Beispiel', link: 'de/example' }, - ], -}; - -// ... -``` - -> _**Note**: make sure the sidebar links point to the proper language folder_ - -<!-- , but if you are unable to properly support multiple languages, you can disable multiple languages, you set the `DISABLE_MULTIPLE_LANGUAGES` variable in the [`config.ts`](../../config.ts) file to `true`, but you still need to change and tweak a couple more things. - -After settings `DISABLE_MULTIPLE_LANGUAGES` you can now move the pages from the language folder you wish to use, e.g. I speak english, so, I would delete every other folders and files in the [`pages/`](../) folder except for the [`en/`](./) folder, I would then move the files from the [`en/`](./) folder to the [`pages/`](../) folder, delete all `index.astro` files, and finally delete the [`en/`](./) folder. - -The file structure will look like this once you are done, - -``` -📦src - ┣ 📂components - ┃ ┣ ... - ┣ 📂layouts - ┃ ┗ 📜MainLayout.astro - ┣ 📂pages - ┃ ┣ 📜example.md - ┃ ┣ 📜getting-started.md - ┃ ┗ 📜introduction.md - ┣ 📜config.ts - ┗ 📜languages.ts -``` - -You will then need to rename `introductions.md` to `index.md`, and reorganize the `SIDEBAR` variable in the [`config.ts`](../../config.ts) file to resemble something like this (remember to change the links, since the `en/` folder has been deleted), - -```ts -export const SIDEBAR = [ - // index.md is the homepage, so, you don't need to set a sidebar link - { text: 'Introduction', header: true }, - { text: 'Getting Started', link: 'getting-started' }, - { text: 'Example', link: 'example' }, -] -``` - -and that's it. --> - -## Algolia DocSearch - -[Algolia](https://www.algolia.com/) offers [DocSearch](https://docsearch.algolia.com/), a _"State-of-the-art search for technical documentation"_. We use DocSearch for the Astro docs as it's a great documentation search engine, to make things setting up docs easier we built it into the docs template, you can setup DocSearch for your site by following these instructions, ... - -### 🛠 Configuration - -... - -## Documentation - -For more information on how to use Astro components, check the documentation pages: - -- [Quick Start](https://docs.astro.build/quick-start) -- [astro.config.mjs](https://docs.astro.build/reference/configuration-reference) -- [API](https://docs.astro.build/reference/api-reference) -- [Command Line Interface](https://docs.astro.build/reference/cli-reference) -- [Collections](https://docs.astro.build/core-concepts/collections) -- [Development Server](https://docs.astro.build/reference/dev/) -- [Markdown](https://docs.astro.build/guides/markdown-content) -- [Publishing Astro components](https://docs.astro.build/guides/publish-to-npm) -- [Renderers](https://docs.astro.build/reference/renderer-reference) -- [Styling](https://docs.astro.build/guides/styling) -- [.astro Syntax](https://docs.astro.build/core-concepts/astro-components) diff --git a/examples/docs/src/pages/en/index.astro b/examples/docs/src/pages/en/index.astro deleted file mode 100644 index 5731a3976..000000000 --- a/examples/docs/src/pages/en/index.astro +++ /dev/null @@ -1,5 +0,0 @@ ---- -import REDIRECT from "../index.astro"; ---- - -<REDIRECT />
\ No newline at end of file diff --git a/examples/docs/src/pages/en/introduction.md b/examples/docs/src/pages/en/introduction.md index 7b3142f71..8f91a429a 100644 --- a/examples/docs/src/pages/en/introduction.md +++ b/examples/docs/src/pages/en/introduction.md @@ -1,62 +1,17 @@ --- -title: Hello, Documentation! +title: Introduction layout: ~/layouts/MainLayout.astro --- -<img src="https://github.com/snowpackjs/astro/blob/main/assets/social/banner.png?raw=true" alt="Astro" width="638" height="320" > +**Welcome to Astro!** -## What is Astro? +This is the `docs` starter template. It contains all of the features that you need to build a Markdown-powered documentation site, including: -**Astro** is a _fresh but familiar_ approach to building websites. Astro combines decades of proven performance best practices with the DX improvements of the component-oriented era. +- ✅ **Sidebar navigation** +- ✅ **Search (powered by Algolia)** +- ✅ **Multi-language i18n** +- ✅ (and, best of all) **dark mode** -With Astro, you can use your favorite JavaScript framework and automatically ship the bare-minimum amount of JavaScript—by default, it's none at all! +To get started, check out the project `README.md` that the template came with. It provides documentation on how to use and customize this template for your own project, which you can always refer back to as you build. -## Project Status - -⚠️ **Astro is still an early beta, missing features and bugs are to be expected!** If you can stomach it, then Astro-built sites are production ready and several production websites built with Astro already exist in the wild. We will update this note once we get closer to a stable, v1.0 release. - -## 🔧 Quick Start - -> **Important**: Astro is built with [ESM modules](https://nodejs.org/api/esm.html) which are not supported in older version of Node.js. The minimum supported version is **14.16.1**. - -```bash -# create your project -mkdir new-project-directory -cd new-project-directory -npm init astro - -# install your dependencies -npm install - -# start the dev server and open your browser -npm run dev -``` - -### 🚀 Build & Deployment - -The default Astro project has the following `scripts` in the `/package.json` file: - -```json -{ - "scripts": { - "start": "astro dev", - "dev": "astro dev", - "build": "astro build", - "preview": "astro preview" - } -} -``` - -For local development, run: - -``` -npm run dev -``` - -To build for production, run the following command: - -``` -npm run build -``` - -To deploy your Astro site to production, upload the contents of `/dist` to your favorite static site host. +Found a missing feature that you can't live without? Please suggest it and even consider adding it yourself to the Astro repo! We're an open source project and contributions from developers like you are how we grow! 💙 diff --git a/examples/docs/src/pages/en/page-2.md b/examples/docs/src/pages/en/page-2.md new file mode 100644 index 000000000..55d1c48e1 --- /dev/null +++ b/examples/docs/src/pages/en/page-2.md @@ -0,0 +1,50 @@ +--- +title: Page 2 +layout: ~/layouts/MainLayout.astro +--- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +Sed flavum. Stridore nato, Alcandrumque desint ostendit derat, longoque, eadem +iunxit miserum pedum pectora. Liberat sine pignus cupit, ferit mihi venias +amores, et quod, maduere haec _gravi_ contentusque heros. Qui suae attonitas. + +_Acta caelo_ ego, hoc illi ferroque, qui fluitque Achillis deiecerat erat +inhospita arasque ad sume et aquis summo. Fugerat ipse iam. Funeris Iuno Danaos +est inroravere aurum foret nati aeque tetigisset! Esse ad tibi queritur [Sol sub +est](http://iusserat.net/) pugno solitoque movet coercuit solent caput te? + +Crescit sint petit gemellos gemino, et _gemma deus sub_ Surrentino frena +principiis statione. Soporiferam secunda nulli Tereus is _Aeolidae cepit_, tua +peregrinosque illam parvis, deerit sub et times sedant. + +## Apium haec candida mea movebo obsuntque descendat + +Furti lucos cum iussa quid temptanti gravitate animus: vocat +[ira](http://rediere.com/): illa. Primis aeternus, illi cinguntur ad mugitus +aevo repentinos nec. + +Transcurrere tenens in _litore_ tuti plebe circumspicit viventi quoque mox +troades medio mea locuta gradus perque sic unguibus +[gramen](http://quantoque.io/). Effetus celerique nomina quoque. Ire gemino est. +Eurus quaerenti: et lacus, tibi ignorant tertia omnes subscribi ducentem sedit +experientia sine ludunt multae. Ponderis memor purasque, ut armenta corpora +efferre: praeterea infantem in virgam verso. + +- Revellit quoniam vulnerat dique respicit +- Modo illis +- Nec victoria quodque +- Spectans si vitis iussorum corpora quas + +Tibi igni, iamque, sum arsuro patet et Talibus cecidere: levati Atlas villosa +dubium conparentis litem volentem nec? Iuga tenent, passi cumque generosior +luminis, quique mea aequora ingens bracchia furor, respiramen eram: in. Caelebs +et passu Phaethonta alumna orbem rapuit inplet [adfusaeque +oculis](http://www.virum.net/ille-miserae.html) paene. Casus mea cingebant idque +suis nymphe ut arae potuit et non, inmota erat foret, facta manu arvum. + +Fugam nec stridentemque undis te solet mentemque Phrygibus fulvae adhuc quam +cernimus est! Aper iube dederat adsere iamque mortale ita cornua si fundamina +quem caperet, iubeas stolidae pedesque intrarunt navigat triformis. Undas terque +digitos satis in nautae sternuntur curam, iaculum ignoscere _pianda dominique +nostra_ vivacemque teneraque! diff --git a/examples/docs/src/pages/en/example.md b/examples/docs/src/pages/en/page-3.md index a5deeaff9..ef887de37 100644 --- a/examples/docs/src/pages/en/example.md +++ b/examples/docs/src/pages/en/page-3.md @@ -1,5 +1,5 @@ --- -title: Markdown Example +title: Page 3 layout: ~/layouts/MainLayout.astro --- diff --git a/examples/docs/src/pages/en/page-4.md b/examples/docs/src/pages/en/page-4.md new file mode 100644 index 000000000..c2288c588 --- /dev/null +++ b/examples/docs/src/pages/en/page-4.md @@ -0,0 +1,36 @@ +--- +title: Page 4 +layout: ~/layouts/MainLayout.astro +--- + +This is a fully-featured page, written in Markdown! + +## Section A + +Lorem ipsum dolor sit amet, **consectetur adipiscing elit**. Sed ut tortor _suscipit_, posuere ante id, vulputate urna. Pellentesque molestie aliquam dui sagittis aliquet. Sed sed felis convallis, lacinia lorem sit amet, fermentum ex. Etiam hendrerit mauris at elementum egestas. Vivamus id gravida ante. Praesent consectetur fermentum turpis, quis blandit tortor feugiat in. Aliquam erat volutpat. In elementum purus et tristique ornare. Suspendisse sollicitudin dignissim est a ultrices. Pellentesque sed ipsum finibus, condimentum metus eget, sagittis elit. Sed id lorem justo. Vivamus in sem ac mi molestie ornare. + +## Section B + +Nam quam dolor, pellentesque sed odio euismod, feugiat tempus tellus. Quisque arcu velit, ultricies in faucibus sed, ultrices ac enim. Nunc eget dictum est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ex nisi, egestas mollis ultricies ut, laoreet suscipit libero. Nam condimentum molestie turpis. Sed vestibulum sagittis congue. Maecenas tristique enim et tincidunt tempor. Curabitur ac scelerisque nulla, in malesuada libero. Praesent eu tempus odio. Pellentesque aliquam ullamcorper quam at gravida. Sed non fringilla mauris. Aenean sit amet ultrices erat. Vestibulum congue venenatis tortor, nec suscipit tortor. Aenean pellentesque mauris eget tortor tincidunt pharetra. + +## Section C + +```markdown +--- +title: Markdown Page! +lang: en +layout: ~/layouts/MainLayout.astro +--- + +# Markdown example + +This is a fully-featured page, written in Markdown! + +## Section A + +Lorem ipsum dolor sit amet, **consectetur adipiscing elit**. Sed ut tortor _suscipit_, posuere ante id, vulputate urna. Pellentesque molestie aliquam dui sagittis aliquet. Sed sed felis convallis, lacinia lorem sit amet, fermentum ex. Etiam hendrerit mauris at elementum egestas. Vivamus id gravida ante. Praesent consectetur fermentum turpis, quis blandit tortor feugiat in. Aliquam erat volutpat. In elementum purus et tristique ornare. Suspendisse sollicitudin dignissim est a ultrices. Pellentesque sed ipsum finibus, condimentum metus eget, sagittis elit. Sed id lorem justo. Vivamus in sem ac mi molestie ornare. + +## Section B + +Nam quam dolor, pellentesque sed odio euismod, feugiat tempus tellus. Quisque arcu velit, ultricies in faucibus sed, ultrices ac enim. Nunc eget dictum est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ex nisi, egestas mollis ultricies ut, laoreet suscipit libero. Nam condimentum molestie turpis. Sed vestibulum sagittis congue. Maecenas tristique enim et tincidunt tempor. Curabitur ac scelerisque nulla, in malesuada libero. Praesent eu tempus odio. Pellentesque aliquam ullamcorper quam at gravida. Sed non fringilla mauris. Aenean sit amet ultrices erat. Vestibulum congue venenatis tortor, nec suscipit tortor. Aenean pellentesque mauris eget tortor tincidunt pharetra. +``` |