--- title: "Build and Test Guide" date: 2024-04-10 draft: false description: "Instructions for building and testing the blog before publishing" --- # Build and Test Guide This guide provides step-by-step instructions for building and testing the blog before publishing changes. ## Prerequisites - [Hugo](https://gohugo.io/installation/) installed on your system - Git for version control - A modern web browser for testing ## Development Workflow ### 1. Local Development To start the development server: ```bash hugo server -D ``` This will: - Start a local server (usually at http://localhost:1313) - Enable draft content viewing - Watch for file changes and auto-reload ### 2. Building the Site To build the site for production: ```bash hugo ``` This will: - Generate the static site in the `public/` directory - Exclude draft content - Optimize assets ### 3. Testing Checklist Before publishing, ensure you: 1. Run the development server and check: - All pages load correctly - Links work as expected - Images display properly - Responsive design works on different screen sizes 2. Build the site and verify: - No build errors in the console - All assets are generated correctly - The `public/` directory contains all necessary files 3. Content review: - Check for typos and grammar - Verify formatting is consistent - Ensure all images have alt text - Test all interactive elements ### 4. Publishing After testing: 1. Commit your changes: ```bash git add . git commit -m "Your descriptive commit message" ``` 2. Push to your repository: ```bash git push ``` 3. If using a CI/CD pipeline, verify the deployment was successful ## Troubleshooting Common issues and solutions: - **Build errors**: Check Hugo version compatibility and theme requirements - **Missing content**: Verify front matter is correct and content is in the right directory - **Broken links**: Use `hugo server` to test all internal links - **Image issues**: Check file paths and ensure images are in the correct directory ## Additional Resources - [Hugo Documentation](https://gohugo.io/documentation/) - [Theme Documentation](https://github.com/LordMathis/hugo-theme-nightfall) - [Markdown Guide](https://www.markdownguide.org/)