Skip to content

Commit ca90ee3

Browse files
0.1.0 development
1 parent b532582 commit ca90ee3

4 files changed

Lines changed: 179 additions & 4 deletions

File tree

.github/workflows/hugo.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2+
name: Deploy Hugo site to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- main
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
# Default to bash
26+
defaults:
27+
run:
28+
shell: bash
29+
30+
jobs:
31+
# Build job
32+
build:
33+
runs-on: ubuntu-latest
34+
env:
35+
HUGO_VERSION: 0.145.0
36+
steps:
37+
- name: Install Hugo CLI
38+
run: |
39+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
40+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
with:
44+
submodules: recursive
45+
fetch-depth: 0
46+
- name: Setup Pages
47+
id: pages
48+
uses: actions/configure-pages@v5
49+
- name: Install Node.js dependencies
50+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
51+
- name: Cache Restore
52+
id: cache-restore
53+
uses: actions/cache/restore@v4
54+
with:
55+
path: |
56+
${{ runner.temp }}/hugo_cache
57+
key: hugo-${{ github.run_id }}
58+
restore-keys:
59+
hugo-
60+
- name: Build with Hugo
61+
run: |
62+
hugo \
63+
--gc \
64+
--minify \
65+
--source ./site \
66+
--baseURL "${{ steps.pages.outputs.base_url }}/"
67+
- name: Cache Save
68+
id: cache-save
69+
uses: actions/cache/save@v4
70+
with:
71+
path: |
72+
${{ runner.temp }}/hugo_cache
73+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
74+
- name: Upload artifact
75+
uses: actions/upload-pages-artifact@v3
76+
with:
77+
path: ./site/public
78+
79+
# Deployment job
80+
deploy:
81+
environment:
82+
name: github-pages
83+
url: ${{ steps.deployment.outputs.page_url }}
84+
runs-on: ubuntu-latest
85+
needs: build
86+
steps:
87+
- name: Deploy to GitHub Pages
88+
id: deployment
89+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Hugo gitignores
22
/site/resources/
33
/site/public/
4-
/site/themes/
54
.hugo_build.lock

site/content/posts/intro/index.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
+++
2+
title = "Building and hosting your own Hugo blog on GitHub"
3+
date = "2025-03-12"
4+
description = "A guide to building and hosting a basic blog using Hugo on your personal GitHub account and GitHub Pages"
5+
tags = [
6+
"hugo",
7+
"blog",
8+
"github",
9+
"github-pages",
10+
]
11+
categories = [
12+
"hugo",
13+
]
14+
series = ["Hugo"]
15+
+++
16+
17+
## Blog header
18+
19+
blog text

site/hugo.toml

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1-
baseURL = 'https://example.org/'
2-
languageCode = 'en-us'
3-
title = 'My New Hugo Site'
1+
baseURL = "https://yoursite.github.io"
2+
title = "my blog"
3+
author = "Your Name"
4+
copyright = "Your Name"
5+
pagination.pagerSize = 10
6+
languageCode = "en"
7+
theme = "tailwind"
8+
enableRobotsTXT = true
9+
enableEmoji = true
10+
11+
[markup]
12+
_merge = "deep"
13+
14+
[params]
15+
keywords = "some, keywords, here"
16+
subtitle = "blog subtitle"
17+
contentTypeName = "posts"
18+
showAuthor = true
19+
20+
[params.author]
21+
name = "Your Name"
22+
email = "user@example.com"
23+
24+
[params.header]
25+
logo = "logo.svg"
26+
title = " site title"
27+
28+
[params.footer]
29+
since = 2025
30+
poweredby = true
31+
32+
[[params.social_media.items]]
33+
enabled = true
34+
title = 'Bluesky'
35+
icon = 'brand-bluesky'
36+
link = 'https://bsky.app/profile/yourname.bsky.social'
37+
38+
[[params.social_media.items]]
39+
enabled = true
40+
title = 'LinkedIn'
41+
icon = 'brand-linkedin'
42+
link = 'https://www.linkedin.com/in/yourname'
43+
44+
[[params.social_media.items]]
45+
enabled = true
46+
title = 'Github'
47+
icon = 'brand-github'
48+
link = 'https://github.com/yourname'
49+
50+
[menu]
51+
52+
[[menu.main]]
53+
identifier = "post"
54+
name = "Posts"
55+
pageRef = "/posts"
56+
weight = 10
57+
58+
[[menu.main]]
59+
identifier = "about"
60+
name = "About"
61+
pageRef = "/about"
62+
weight = 20
63+
64+
[taxonomies]
65+
category = "categories"
66+
tag = "tags"
67+
series = "series"
68+
69+
[caches]
70+
[caches.images]
71+
dir = ':cacheDir/images'

0 commit comments

Comments
 (0)