Inside of this Astro project, you'll see the following folders and files:
/
├── public/
├── src/
│ ├── components/
│ │ ├── 01-index-page/
│ │ ├── 02-about-page/
│ │ ├── 03-what-is-raid/
│ │ └── layout-components/
│ ├── images/
│ │ ├── backgrounds/
│ │ ├── icons/
│ │ └── logos/
│ ├── layouts/
│ │ └── main.astro
│ └── pages/
│ ├── 404.html
│ ├── about.astro
│ ├── contact.astro
│ ├── index.astro
│ └── what-is-raid.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.
Components are organized by page in numbered directories under src/components/
.
Static assets like images are placed in the src/images/
directory.
The search functionality uses the DataCite API to find RAiD records. The implementation is in src/scripts/search.ts
, which gets compiled to JavaScript during the build process via a postbuild script. The search allows users to query RAiDs by title, description, creator, related identifiers, and organization. Results can be downloaded as JSON files directly from the search interface.
- https://raid.org/{prefix}/{suffix}
- Example:
The resolver functionality is implemented through the 404 page. When a user accesses a URL with a RAiD pattern (e.g., raid.org/102.100.100/601891
), the 404.html page captures the route, extracts the RAiD handle, validates it against an API, and redirects to the appropriate environment. This approach allows for dynamic resolution without requiring server-side processing.
To edit content on the site:
- Navigate to the page you want to modify in
src/pages/
- For each page, the content is split into modular components in the corresponding numbered directory under
src/components/
- Edit the
.astro
component files to update text, images, and layout - Components are numbered to indicate their order on the page
- Layout components like the navbar and footer are in
src/components/layout-components/
This site uses Tailwind CSS for styling:
- All styling is done using Tailwind's utility classes directly in the HTML/Astro templates
- The Tailwind configuration is in
tailwind.config.mjs
where you can customize colors, fonts, and other design tokens - No separate CSS files are needed for most styling tasks
- For responsive design, use Tailwind's built-in breakpoint prefixes:
sm:
,md:
,lg:
,xl:
, etc.
To learn more about Tailwind:
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:4321 |
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 |
The build process consists of two main steps:
-
Astro's standard build (
astro build
): Generates the static site in the./dist/
directory, including the 404.html page that powers the RAiD resolver. -
TypeScript Compilation: A postbuild script compiles
src/scripts/search.ts
to JavaScript and places it inpublic/scripts/
. This is necessary for the RAiD search functionality.
The build configuration in astro.config.mjs
specifies output: "static"
and format: "file"
to ensure proper generation of all static assets including the 404.html page that handles RAiD resolution.
The site is automatically deployed to GitHub Pages using a GitHub Actions workflow defined in .github/workflows/astro.yml
. This CI/CD pipeline runs whenever changes are pushed to the main branch.
The deployment workflow:
- Detects the package manager (npm or yarn)
- Sets up Node.js environment (v20)
- Configures GitHub Pages
- Installs dependencies
- Builds the site with environment variables from GitHub repository variables
- Uploads the build artifact (dist directory)
- Deploys to GitHub Pages
Environment variables used during deployment:
BASE_SLUG
: Base URL path for the siteBASE_SITE
: Base URL for the siteRAID_SEARCH_PAGE
: Configuration for the search page
The site is configured with the custom domain raid.org
using a CNAME file in the repository.
Feel free to check our documentation or jump into our Discord server.
Perfect lighthouse score