This is the personal blog website of Martin Woodward, built with Astro
This site serves as Martin Woodward's digital home, featuring blog posts, thoughts, and insights.
This project is based on the Logbook Astro template by Themefisher. You can find the complete documentation and template details at: https://docs.themefisher.com/logbook-astro/
- Astro - Static Site Generator
- Tailwind CSS - Utility-first CSS framework
- TypeScript - Type-safe JavaScript
- MDX - Markdown with JSX support
- Node.js (version 18 or higher)
- npm or yarn package manager
-
Clone the repository (if working from a remote repository):
git clone <repository-url> cd woodwardweb
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:4321
to see the site running locally.
For a consistent development experience, this repository includes a VS Code development container configuration:
- Open in VS Code with the Dev Containers extension installed
- Reopen in Container when prompted (or use Command Palette: "Dev Containers: Reopen in Container")
- Automatic setup - dependencies are installed automatically and VS Code is configured with Astro-specific extensions
This provides:
- Node.js 20 environment
- Pre-configured VS Code extensions for Astro, TypeScript, Tailwind CSS, and MDX
- Automatic port forwarding for the development server
- Consistent development environment across all contributors
See .devcontainer/README.md for detailed information.
npm run dev
- Start the development servernpm run build
- Build the site for production (includes OG image generation)npm run preview
- Preview the production build locallynpm run astro
- Run Astro CLI commandsnpm run generate-og-images
- Generate PNG files from OG image templates (automatically run during build)
- Content: Add new blog posts and pages in the
src/content/
directory - Styling: Customize styles in the
src/styles/
directory - Components: Create or modify Astro components in
src/layouts/components/
- Configuration: Update site settings in
src/config/
files
This site automatically generates custom Open Graph (OG) images for each blog post to enhance social media sharing. Each post gets a unique image featuring the post title, description, categories, and author information.
Key files:
src/pages/api/og/[...slug].png.ts
- Main template and stylingsrc/lib/utils/ogImageUtils.ts
- Utility functionsscripts/generate-og-images.js
- Build-time PNG conversion
- Development: During
npm run dev
, OG images are served as HTML previews - Production: During
npm run build
, HTML templates are converted to PNG images using Puppeteer - Static Pages: Homepage and about page use the static
/images/og-image.png
-
Start the development server:
npm run dev
-
View the preview page: Visit
http://localhost:4321/og-preview
to see all OG images -
View individual images: Visit
/api/og/{post-slug}.png
for specific posts
To modify the OG image template:
- Edit the template: Modify
src/pages/api/og/[...slug].png.ts
- Update styles: Customize the CSS within the
generateOGImageHTML()
function
The site's configuration is managed through several JSON files in the src/config/
directory:
config.json
- General site settings and metadatamenu.json
- Navigation menu structuresocial.json
- Social media links and profilestheme.json
- Visual theme configuration (colors, fonts, typography)
The site's visual appearance is defined in src/config/theme.json
. This file controls:
- Colors: Primary theme colors, background colors, border colors, and text colors
- Fonts: Font families (primary and secondary) with their types and weights
- Typography: Base font size and scaling ratio
To customize the site's appearance, modify the values in theme.json
:
{
"colors": {
"default": {
"theme_color": {
"primary": "#ce8460", // Primary brand color
"body": "#fff", // Background color
"border": "#ddd", // Border color
"light": "#f0f0f0" // Light accent color
},
"text_color": {
"text": "#696c6d", // Default text color
"text-dark": "#1c1d1f", // Dark text color
"text-light": "#888c8e" // Light text color
}
}
},
"fonts": {
"font_family": {
"primary": "Mona Sans:wght@400",
"secondary": "Hubot Sans:wght@400"
},
"font_size": {
"base": "16", // Base font size in pixels
"scale": "1.2" // Typography scale ratio
}
}
}
├── public/ # Static assets
├── src/
│ ├── content/ # Markdown content (posts, pages)
│ ├── layouts/ # Astro layouts and components
│ ├── pages/ # Astro pages and routing
│ ├── styles/ # CSS stylesheets
│ └── config/ # Site configuration files
├── astro.config.mjs # Astro configuration
└── package.json # Project dependencies
Build the site for production with:
npm run build
The built site will be output to the dist/
directory.
This project uses dual licensing:
The source code (templates, components, styling, and build configuration) is licensed under the MIT License - see the LICENSE file for details. This allows you to freely use, modify, and distribute the code.
Blog posts and written content in the src/content/
directory may be licensed under the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0). This means you can share and adapt the content as long as you provide appropriate attribution and distribute any derivatives under the same license.
For questions or inquiries, please reach out to Martin Woodward through the contact information available on the website. Social media DM's are the best way but you can always email.