
After pressing Ctrl + C
, the Hugo server stops running. To reopen your Hugo server and access your post at http://localhost:1313/posts/my-first-post/, follow these steps:
β Restarting the Hugo Server
- Open PowerShell as Administrator (if not already open)
- Navigate to your Hugo website folder
cd C:\Users\YourUsername\Hugo\mywebsite
(ReplaceYourUsername
with your actual Windows username.) - Start the Hugo server again
hugo server -D
- The
-D
flag includes draft posts. - If your post is not in draft mode, you can simply run:
hugo server
- The
- Open your browser and go to:
http://localhost:1313/posts/my-first-post/
π Your website should now be running again!
π― If You Still Don’t See Your Post
πΉ Check if the Post is in Draft Mode
By default, new posts are created as drafts. To make sure itβs published:
- Open your post in Notepad:
notepad content/posts/my-first-post.md
- Look at the front matter (the first few lines at the top). It should look like this:
--- title: "My First Post" date: 2025-02-14T10:00:00+05:30 draft: false ---
- If
draft: true
, change it tofalse
. - Save and close the file.
- If
πΉ Rebuild the Website
- Stop the Hugo server (
Ctrl + C
). - Restart Hugo:
hugo server -D
- Open your browser and go to:
http://localhost:1313/posts/my-first-post/
π― Final Summary
β
Use hugo server -D
to restart your local Hugo server.
β
If the post is not showing, check if draft: false
in the post file.
β
Access your post at http://localhost:1313/posts/my-first-post/.
Let me know if you need more help! ππ