From 1437b42038bf5daa0ad9e9be41d25f04a8ec97d3 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 14 Jun 2021 12:45:33 -0700 Subject: fix some example docs site issues (#434) --- examples/docs/src/components/SiteSidebar.astro | 4 +- examples/docs/src/config.ts | 6 +-- examples/docs/src/layouts/Main.astro | 1 + examples/docs/src/pages/example.md | 3 +- examples/docs/src/pages/getting-started.md | 9 ++-- examples/docs/src/pages/index.astro | 16 ------- examples/docs/src/pages/index.md | 60 ++++++++++++++++++++++++++ 7 files changed, 71 insertions(+), 28 deletions(-) delete mode 100644 examples/docs/src/pages/index.astro create mode 100644 examples/docs/src/pages/index.md (limited to 'examples/docs/src') diff --git a/examples/docs/src/components/SiteSidebar.astro b/examples/docs/src/components/SiteSidebar.astro index 30b14621c..0fbad0c83 100644 --- a/examples/docs/src/components/SiteSidebar.astro +++ b/examples/docs/src/components/SiteSidebar.astro @@ -7,10 +7,10 @@ import { sidebar } from '../config.ts'; {sidebar.map(category => (
  • diff --git a/examples/docs/src/config.ts b/examples/docs/src/config.ts index 4b6268e23..5ec22a02b 100644 --- a/examples/docs/src/config.ts +++ b/examples/docs/src/config.ts @@ -1,10 +1,10 @@ export const sidebar = [ { text: 'Introduction', - link: '/', + link: '', // No leading slash needed, so this links to the homepage children: [ - { text: 'Getting Started', link: '/getting-started' }, - { text: 'Example', link: '/example' }, + { text: 'Getting Started', link: 'getting-started' }, + { text: 'Example', link: 'example' }, ], }, ]; diff --git a/examples/docs/src/layouts/Main.astro b/examples/docs/src/layouts/Main.astro index e6f30faca..77407918a 100644 --- a/examples/docs/src/layouts/Main.astro +++ b/examples/docs/src/layouts/Main.astro @@ -218,6 +218,7 @@ editHref = `https://github.com/snowpackjs/astro/tree/main/examples/doc/src/pages
    +

    {content.title}

    diff --git a/examples/docs/src/pages/example.md b/examples/docs/src/pages/example.md index 0966595d8..4de84789b 100644 --- a/examples/docs/src/pages/example.md +++ b/examples/docs/src/pages/example.md @@ -1,9 +1,8 @@ --- +title: Markdown Example layout: ../layouts/Main.astro --- -# Markdown example - This is a fully-featured page, written in Markdown! ## Section A diff --git a/examples/docs/src/pages/getting-started.md b/examples/docs/src/pages/getting-started.md index e034a47ca..eb2826dbc 100644 --- a/examples/docs/src/pages/getting-started.md +++ b/examples/docs/src/pages/getting-started.md @@ -1,9 +1,8 @@ --- +title: Getting Started layout: ../layouts/Main.astro --- -# Getting Started - 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 @@ -14,10 +13,10 @@ The page navigation, through the side bar on the left, needs to be manually upda export const sidebar = [ { text: 'Introduction', - link: '/', + link: '', // No leading slash needed, so this links to the homepage children: [ - { text: 'Getting Started', link: '/getting-started' }, - { text: 'Example', link: '/example' }, + { text: 'Getting Started', link: 'getting-started' }, + { text: 'Example', link: 'example' }, ], }, ]; diff --git a/examples/docs/src/pages/index.astro b/examples/docs/src/pages/index.astro deleted file mode 100644 index 6cba4c7fe..000000000 --- a/examples/docs/src/pages/index.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import { Markdown } from 'astro/components'; -import Layout from '../layouts/Main.astro'; ---- - - - - # Hello world! - - This is a starter template, have fun building your next documentation site with [Astro](https://astro.build). - - It offers the right mix of simple-to-use [Markdown pages](/example) and rich, interactive components embedded in `.astro` files using ``. - - The docs template has some nice components, for more information click [here](/getting-started). - - diff --git a/examples/docs/src/pages/index.md b/examples/docs/src/pages/index.md new file mode 100644 index 000000000..f56477902 --- /dev/null +++ b/examples/docs/src/pages/index.md @@ -0,0 +1,60 @@ +--- +title: Hello, Documentation! +layout: ../layouts/Main.astro +--- + +Astro + +## What is Astro? + +**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. + +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! + +## 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 start +``` + +### 🚀 Build & Deployment + +The default Astro project has the following `scripts` in the `/package.json` file: + +```json +{ + "scripts": { + "start": "astro dev", + "build": "astro build" + } +} +``` + +For local development, run: + +``` +npm run start +``` + +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. -- cgit v1.2.3