forked from AntreasAntoniou/GATE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.py
47 lines (34 loc) · 2.42 KB
/
gen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
content = """
**Hosting a Hugo Website on GitHub Pages**
**Prerequisites:**
* **Basic Git knowledge:** Understanding how to initialize a repository, commit changes, and push to a remote repository is helpful. If you're new to Git, check out a quick tutorial (there are many great ones online!)
* **Installed Hugo:** Make sure you have Hugo installed on your local machine. You can find installation instructions on the official Hugo website: [https://gohugo.io/](https://gohugo.io/)
**Steps:**
1. **Create a New GitHub Repository:**
* After signing in to GitHub, click the "+" button in the top right corner and select "New repository."
* Name your repository with the following format: `username.github.io` (Replace 'username' with your actual GitHub username).
* Select "Public" for visibility.
* **Important:** Initialize the repository with a README file.
2. **Set up Hugo Locally:**
* Open your terminal or command prompt.
* Create a new Hugo site: `hugo new site my-hugo-site` (replace 'my-hugo-site' with your desired site name).
* Navigate to your site's directory: `cd my-hugo-site`
* Initialize a Git repository: `git init`
3. **Theme and Content:**
* Choose a Hugo theme you like from [https://themes.gohugo.io/](https://themes.gohugo.io/) and install it following the theme's instructions.
* Start creating content using Hugo commands (`hugo new posts/my-first-post.md`)
4. **Link to GitHub:**
* Add your GitHub repository as a remote: `git remote add origin https://github.com/username/username.github.io.git`
* Make your initial commit: `git add .` and `git commit -m "Initial commit"`
* Push to GitHub: `git push -u origin main`
5. **Enable GitHub Pages:**
* In your repository, go to **Settings** -> **Pages**
* Under "Source," select the **main** branch and **root** folder.
* Click **Save**.
**It may take a few minutes for your site to go live. Your website will be accessible at `https://username.github.io`.**
**Additional Notes:**
* Customize your Hugo site further by modifying the theme and adding your unique content.
* Refer to the official Hugo documentation ([https://gohugo.io/](https://gohugo.io/)) and GitHub Pages documentation ([https://pages.github.com/](https://pages.github.com/)) for more detailed instructions and troubleshooting.
"""
with open("part2_hugo_website.md", "w") as md_file:
md_file.write(content)