Best practices for organizing a repository for a static website? #213696
Replies: 3 comments 1 reply
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Great question. A little structure early saves a lot of pain later. Here's a layout and workflow that scales well for static sites: 📁 Folder structure
🌿 Branches and review
🚀 Deploying with GitHub Pages
🖼️ Image sizes for fast mobile pages
|
|
I would keep the structure simple and organized from the beginning. Something like this works well:
Keep the main branch stable and use separate branches for new features or changes. Review everything through pull requests before merging. For deployment, GitHub Pages is a good option for a static website, and GitHub Actions can automate the process. For images, compress them and use WebP where possible to improve loading speed on mobile. One common mistake is putting everything in one folder or adding unnecessary complexity too early. Start simple and organize things as the project grows. |
Uh oh!
There was an error while loading. Please reload this page.
Discussion Type
Product Feedback
Discussion Content
Hi everyone,
I wanted to discuss how to organize a repository for a static website so it stays easy to maintain as it grows. When a project starts small, everything ends up in one folder, but it gets messy once there are more pages, images, and scripts.
For example, here is a site I'm using as a reference. When you structure a repository for a site like this, what folder layout and workflow have worked best for you?
I'm particularly interested in these points:
Are there any common mistakes to avoid when setting this up? Thanks in advance for any suggestions!
All reactions