diff options
Diffstat (limited to 'examples/blog')
-rw-r--r-- | examples/blog/.gitignore | 18 | ||||
-rw-r--r-- | examples/blog/README.md | 41 | ||||
-rw-r--r-- | examples/blog/astro.config.mjs | 16 | ||||
-rw-r--r-- | examples/blog/meta.json | 5 | ||||
-rw-r--r-- | examples/blog/package.json | 5 | ||||
-rw-r--r-- | examples/blog/public/favicon.svg | 11 |
6 files changed, 75 insertions, 21 deletions
diff --git a/examples/blog/.gitignore b/examples/blog/.gitignore new file mode 100644 index 000000000..d436c6dad --- /dev/null +++ b/examples/blog/.gitignore @@ -0,0 +1,18 @@ +# build output +dist + +# dependencies +node_modules/ +.snowpack/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store diff --git a/examples/blog/README.md b/examples/blog/README.md index 2a20654f2..87c48761c 100644 --- a/examples/blog/README.md +++ b/examples/blog/README.md @@ -1,5 +1,7 @@ # Astro Blog Example +> π§βπ **Seasoned astronaut?** Delete this file. Have fun! + Features: - β
SEO-friendly setup with canonical URLs and OpenGraph data @@ -7,24 +9,39 @@ Features: - β
RSS 2.0 generation - β
Sitemap.xml generation -## Setup +## π Project Structure + +Inside of your Astro project, you'll see the following folders and files: ``` -yarn +/ +βββ public/ +β βββ robots.txt +β βββ favicon.ico +βββ src/ +β βββ components/ +β β βββ Tour.astro +β βββ pages/ +β βββ index.astro +βββ package.json ``` -## Dev +Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. -``` -yarn start -``` +There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components. -Preview at `http://localhost:3000` +Any static assets, like images, can be placed in the `public/` directory. -## Build +## π§ Commands -``` -yarn build -``` +All commands are run from the root of the project, from a terminal: + +| Command | Action | +|:----------------|:--------------------------------------------| +| `npm install` | Installs dependencies | +| `npm run start` | Starts local dev server at `localhost:3000` | +| `npm run build` | Build your production site to `./dist/` | + +## π Want to learn more? -Will output static site at `./dist` +Feel free to check [our documentation](https://github.com/snowpackjs/astro) or jump into our [Discord server](https://discord.gg/EsGdSGen). diff --git a/examples/blog/astro.config.mjs b/examples/blog/astro.config.mjs index 9933e9571..c7583a774 100644 --- a/examples/blog/astro.config.mjs +++ b/examples/blog/astro.config.mjs @@ -1,10 +1,14 @@ export default { - projectRoot: '.', - pages: './src/pages', - public: './public', - dist: './dist', + // projectRoot: '.', // Where to resolve all URLs relative to. Useful if you have a monorepo project. + // pages: './src/pages', // Path to Astro components, pages, and data + // dist: './dist', // When running `astro build`, path to final static output + // public: './public', // A folder of static files Astro will copy to the root. Useful for favicons, images, and other files that donβt need processing. buildOptions: { - sitemap: true, - site: 'https://mysite.dev/', // change + // site: '', // Your public domain, e.g.: https://my-site.dev/. Used to generate sitemaps and canonical URLs. + // sitemap: true, // Generate sitemap (set to "false" to disable) + }, + devOptions: { + // port: 3000, // The port to run the dev server on. + // tailwindConfig: '', // Path to tailwind.config.js if used, e.g. './tailwind.config.js' }, }; diff --git a/examples/blog/meta.json b/examples/blog/meta.json new file mode 100644 index 000000000..caa6852e5 --- /dev/null +++ b/examples/blog/meta.json @@ -0,0 +1,5 @@ +{ + "title": "Blog", + "description": "an SEO-optimized blog starter", + "rank": 1 +} diff --git a/examples/blog/package.json b/examples/blog/package.json index 5d8d17115..c6faac56a 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -1,11 +1,10 @@ { - "name": "@example/blog", + "name": "@astrojs/example-blog", "version": "0.0.1", "private": true, "scripts": { "start": "astro dev", - "build": "astro build", - "astro-dev": "nodemon --delay 0.5 -w ../../packages/astro/dist -x '../../packages/astro/astro.mjs dev'" + "build": "astro build" }, "devDependencies": { "astro": "^0.12.9", diff --git a/examples/blog/public/favicon.svg b/examples/blog/public/favicon.svg new file mode 100644 index 000000000..542f90aec --- /dev/null +++ b/examples/blog/public/favicon.svg @@ -0,0 +1,11 @@ +<svg width="256" height="256" fill="none" xmlns="http://www.w3.org/2000/svg"> + <style> + #flame { fill: #FF5D01; } + #a { fill: #000014; } + @media (prefers-color-scheme: dark) { + #a { fill: #fff; } + } + </style> + <path id="a" fill-rule="evenodd" clip-rule="evenodd" d="M163.008 18.929c1.944 2.413 2.935 5.67 4.917 12.181l43.309 142.27a180.277 180.277 0 00-51.778-17.53l-28.198-95.29a3.67 3.67 0 00-7.042.01l-27.857 95.232a180.225 180.225 0 00-52.01 17.557l43.52-142.281c1.99-6.502 2.983-9.752 4.927-12.16a15.999 15.999 0 016.484-4.798c2.872-1.154 6.271-1.154 13.07-1.154h31.085c6.807 0 10.211 0 13.086 1.157a16.004 16.004 0 016.487 4.806z" /> + <path id="flame" fill-rule="evenodd" clip-rule="evenodd" d="M168.19 180.151c-7.139 6.105-21.39 10.268-37.804 10.268-20.147 0-37.033-6.272-41.513-14.707-1.602 4.835-1.961 10.367-1.961 13.902 0 0-1.056 17.355 11.015 29.426 0-6.268 5.081-11.349 11.349-11.349 10.743 0 10.731 9.373 10.721 16.977v.679c0 11.542 7.054 21.436 17.086 25.606a23.27 23.27 0 01-2.339-10.2c0-11.008 6.463-15.107 13.974-19.87 5.976-3.79 12.616-8.001 17.192-16.449a31.024 31.024 0 003.743-14.82c0-3.299-.513-6.479-1.463-9.463z" /> +</svg> |