Inside of your Astro project, you'll see the following folders and files:
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
Astro looks for .astro
or .md
files in the src/pages/
directory. Each page is exposed as a route based on its file name.
There's nothing special about src/components/
, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
Any static assets, like images, can be placed in the public/
directory.
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:3000 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add , astro check |
npm run astro -- --help |
Get help using the Astro CLI |
npm run build
npm run dev
rm -rf public/pdfs/jpg && rm -rf public/pdfs/high-res-jps
- Visit PDF24 Tools
- Upload the PDF
- Choose "JPG" as the output format
- For the preview DPI 72 and image quality 85
- For the high-res DPI 144 and image quality 100
- Download the zip file
- Convert all the files to .avif via https://avif.io/
- Unzip the files in to both directories
public/pdfs/images
andpublic/pdfs/high-res-images
- Ready to go!
Within the src
directory, you'll find a content
directory. This is where you'll find all "content collections" for your site. A content collection is a directory of Markdown files that are transformed into pages on your site. The file name is used as the page slug.
The dev
or build
step parses the contents of each file for existing headings and passes them to the table of contents component. This way the table of contents always remains up-to-date.
At the beginning of each page file there is a yaml
config block which must be filled in according to the content.
The following parameters are present:
title
: The title of the pageisDraft
: If the page is a draft, if false the page is not displayedorder
: The order of the page in the table of contents- seo:
title
: The title of the page for SEOmetaTitle
: The meta title of the page for SEOmetaDescription
: The meta description of the page for SEOimage
: The image of the page for SEO