Skip to content

The even more updated Perch Sensing Website. Started August 2024

Notifications You must be signed in to change notification settings

perch-sensing/website-v3

Repository files navigation

Perch Website v3

Open in Coder

This is the source code for the Perch Sensing website (v3), built with Astro. It features TinaCMS for content editing and is deployable to Cloudflare Pages.

Features

  • Modern static site generator using Astro
  • Modular components and layouts
  • SCSS styling and global resets
  • Dynamic header and modal management
  • SEO and social meta tags
  • Font preloading and custom fonts
  • Toast messages and notifications
  • TinaCMS-powered content editing (blog, admin UI)
  • Organized public assets (images, fonts, icons)

Project Structure

astro.config.mjs         # Astro configuration
package.json             # Project dependencies and scripts
op_run, op.env           # Custom wrapper scripts/env for local dev
src/
   components/            # Reusable UI components
   layouts/               # Page layouts (e.g., BaseLayout.astro)
   pages/                 # Site pages (Astro, API, RSS, robots)
   styles/                # SCSS/CSS styles (global, typography, utilities)
   content/               # Content sources (blog, markdown)
   interfaces/            # TypeScript interfaces
   scripts/               # Utilities and remark definitions
   consts.ts              # Site metadata
   env.d.ts               # Environment type definitions
public/
   admin/                 # TinaCMS admin UI (auto-generated)
   fonts/                 # Custom fonts
   icons/                 # SVG icons
   images/                # Site images
tina/
   config.js              # TinaCMS config/schema
   tina-lock.json         # TinaCMS lock file

Getting Started

  1. Install dependencies:
    npm install
  2. Set up environment variables: Create a .env file in the project root and add:
    NEXT_PUBLIC_TINA_CLIENT_ID=your-client-id
    TINA_TOKEN=your-tina-token
    TINA_INDEXER_TOKEN=your-indexer-token
    (Get these from tina.io)
  3. Run the development server:
    npm run dev
    • Starts Astro at localhost:4321 (with TinaCMS if configured)
  4. Run TinaCMS admin UI:
    npm run tina
    • Starts TinaCMS at /admin for content editing
  5. Build for production:
    npm run build
    • Runs tinacms build and astro build
  6. Preview production build:
    npm run preview
    • Builds and previews locally
Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run tina Starts TinaCMS admin UI for content editing
npm run build Build your production site to ./dist/ (includes TinaCMS build)
npm run preview Preview your build locally, before deploying (runs build first)
npm run astro ... Run CLI commands like astro add, astro check
npm run astro -- --help Get help using the Astro CLI
tinacms init backend TinaCMS CLI: prepare backend for production

Customization

  • Update site metadata in src/consts.ts and src/layouts/BaseLayout.astro.
  • Add or modify components in src/components/.
  • Add pages in src/pages/ (Astro, API, RSS, robots).
  • Add blog/content in src/content/blog/ (editable via TinaCMS admin UI).
  • Place static assets in public/ (images, fonts, icons, admin UI).
  • Add global types/interfaces in src/interfaces/.
  • Add or update SCSS styles in src/styles/ (global, typography, utilities).

Deployment

  • The site uses the Cloudflare adapter for Astro. Deploy to Cloudflare Pages or compatible platforms.
  • Ensure environment variables are set in your deployment environment for TinaCMS.
  • Static assets and TinaCMS admin UI are served from the public/ directory.

TinaCMS Admin UI

  • Access the content editor at /admin/ (local or deployed site).
  • Configure content models in tina/config.js.
  • Blog posts are stored in src/content/blog/.

Contact

For questions or contributions, contact Eric Grossman:


Built with Astro & TinaCMS

About

The even more updated Perch Sensing Website. Started August 2024

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •