Skip to content

Commit 3db26d2

Browse files
author
notdian
committed
migrate action
1 parent 4e98613 commit 3db26d2

File tree

8 files changed

+122
-94
lines changed

8 files changed

+122
-94
lines changed

.github/workflows/hugo.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy Hugo site to Github Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
# Default to bash
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
# Build and deploy
30+
build:
31+
runs-on: ubuntu-latest
32+
env:
33+
HUGO_VERSION: 0.154.5
34+
steps:
35+
- name: Install Hugo CLI
36+
run: |
37+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
38+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
39+
40+
- name: Checkout
41+
uses: actions/checkout@v3
42+
with:
43+
submodules: recursive
44+
- name: Build with Hugo
45+
run: hugo -b https://lumramabaja.com
46+
- name: Upload to GitHub Pages
47+
id: deployment
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: ./public
51+
deploy:
52+
runs-on: ubuntu-latest
53+
needs: build
54+
environment:
55+
name: github-pages
56+
url: ${{ steps.deployment.outputs.page_url }}
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

config.toml

Lines changed: 31 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,43 @@ baseURL = 'https://lumramabaja.com/'
22
languageCode = 'en-us'
33
title = 'Lum Ramabaja'
44
theme = 'mini'
5-
publishDir = 'docs'
6-
7-
# Default content language, support en (English) / zh (Chinese) / nl (Dutch) / fr (French) / es (Spanish), default 'en'
5+
publishDir = 'public'
86
defaultContentLanguage = 'en'
9-
10-
# !!! exampleSite only, you may need to delete the line: `themesDir: ../../`
11-
#themesDir: ../../
12-
137
hasCJKLanguage = true
8+
[pagination]
9+
pagerSize = 4
10+
disqusShortname = 'Lum Ramabaja'
11+
1412
[permalinks]
1513
posts = '/posts/:title/'
1614

17-
paginate = 4
18-
19-
#googleAnalytics: your-google-analytics-id
20-
disqusShortname = 'Lum Ramabaja'
15+
[services]
16+
[services.googleAnalytics]
17+
id = 'your-google-analytics-id'
2118

22-
# Hugo Configure Markup
23-
# More info: https://gohugo.io/getting-started/configuration-markup#
2419
[markup]
25-
[markup.highlight]
26-
guessSyntax = true
27-
style = 'dracula'
28-
[markup.tableOfContents]
29-
endLevel = 3
30-
ordered = false
31-
startLevel = 1
32-
# needed to render raw HTML (e.g. <sub>, <sup>, <kbd>, <mark>)
33-
[markup.goldmark]
34-
[markup.goldmark.renderer]
35-
unsafe = true
36-
37-
38-
[social]
39-
github = 'https://github.com/ChainlessCoder'
20+
[markup.highlight]
21+
guessSyntax = true
22+
style = 'dracula'
23+
[markup.tableOfContents]
24+
endLevel = 3
25+
ordered = false
26+
startLevel = 1
27+
[markup.goldmark]
28+
[markup.goldmark.renderer]
29+
unsafe = true
4030

4131
[params]
42-
avatarLink = 'https://github.com/ChainlessCoder'
43-
44-
author = 'Lum Ramabaja'
45-
46-
# Author biography
47-
#bio = 'Lum Ramabaja'
48-
49-
# Site Description, used in HTML meat
50-
description = 'My Blog'
51-
52-
# To enable RSS, you could set `enableRSS: true`, default is `true`
53-
enableRSS = true
54-
55-
# To enable comments, you may need to set `disqusShortname`
56-
enableComments = true
57-
58-
# To enable comments, you may need to set `googleAnalytics`
59-
enableGoogleAnalytics = true
60-
61-
# To enable table of content, you could set `showToc: true`, default is `false`
62-
showToc = true
63-
64-
customCSS = ["css/custom.css"]
65-
66-
# To hidden powerBy message in the page footer, you could set: `showPowerBy: false`, default is `true`
67-
showPowerBy = false
68-
69-
# To enable math typesetting , you could set `math: true`, default is `false`
70-
math = true
71-
72-
# To hidden post summary in home page, you could set `hiddenPostSummaryInHomePage: true`, default is `false`
73-
hiddenPostSummaryInHomePage = false
74-
75-
# Website copy write, default: '© Copyright 2021 ❤️ {params.author}'
76-
copyright = ''
32+
[social]
33+
github = 'https://github.com/ChainlessCoder'
34+
avatarLink = 'https://github.com/ChainlessCoder'
35+
author = 'Lum Ramabaja'
36+
description = 'My Blog'
37+
enableRSS = true
38+
enableComments = true
39+
enableGoogleAnalytics = true
40+
showToc = true
41+
customCSS = ["css/custom.css"]
42+
showPowerBy = false
43+
math = true
44+
hiddenPostSummaryInHomePage = false

layouts/partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer id="footer">
2-
{{ if .Site.Social }}
2+
{{ if .Site.Params.social }}
33
{{ partial "social.html" . }}
44
{{ end }}
55

layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<link rel="shortcut icon" href="{{ "/images/favicon.ico" | relURL }}" type="image/x-icon" />
3030

3131
{{ if .Site.Params.enableGoogleAnalytics }}
32-
{{ template "_internal/google_analytics_async.html" . }}
32+
{{- template "_internal/google_analytics.html" . -}}
3333
{{ end }}
3434

3535
{{ if or .Params.math .Site.Params.math }}

layouts/partials/navigation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
{{ end }}
1212

1313
{{ if .Site.Params.enableRSS }}
14-
<a class="button" href="{{ .Site.RSSLink }}">{{ with .Site.Params.subscribe }}{{ . }}{{ else }}{{ i18n "subscribe" }}{{ end }}</a>
14+
<a class="button" href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}">{{ with .Site.Params.subscribe }}{{ . }}{{ else }}{{ i18n "subscribe" }}{{ end }}</a>
1515
{{ end }}
1616
</nav>

layouts/partials/social.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div id="social">
22

3-
{{ range $key, $val := .Site.Social }}
3+
{{ range $key, $val := .Site.Params.social }}
44
<a class="symbol" href="{{ $val }}" rel="me" target="_blank">
5-
{{ $svg := print "svgs/" $key ".svg" }}
5+
{{ $svg := print "svgs/" $key ".svg" }}
66
{{ partial $svg (dict "fill" "#bbbbbb" "width" 28 "height" 28 ) }}
77
</a>
8-
{{ end }}
8+
{{ end }}
99

10-
</div>
10+
</div>
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
<footer id="footer">
2-
{{ if .Site.Social }}
3-
{{ partial "social.html" . }}
2+
{{ if .Site.Params.Social }}
3+
{{ partial "social.html" . }}
44
{{ end }}
55

66
<div class="copyright">
7-
{{ with .Site.Params.copyright }}
7+
{{ with .Site.Params.copyright }}
88
{{ . | markdownify }}
9-
{{ else }}
10-
© Copyright
11-
{{ now.Format "2006"}}
12-
<span class="split">
13-
{{ partial "svgs/heart.svg" (dict "fill" "#bbbbbb" "width" 15 "height" 15 ) }}
14-
</span>
15-
{{ .Site.Params.Author }}
16-
{{ end }}
9+
{{ else }}
10+
© Copyright
11+
{{ now.Format "2006"}}
12+
<span class="split">
13+
{{ partial "svgs/heart.svg" (dict "fill" "#bbbbbb" "width" 15 "height" 15 ) }}
14+
</span>
15+
{{ .Site.Params.Author }}
16+
{{ end }}
1717
</div>
1818

1919
{{ if ne .Site.Params.showPowerBy false }}
20-
<div class="powerby">
20+
<div class="powerby">
2121
{{ i18n "poweredBy" | safeHTML }}
22-
</div>
22+
</div>
2323
{{ end }}
2424
</footer>
2525

2626
{{ range .Site.Params.customJS }}
27-
{{ if ( or ( hasPrefix . "http://" ) ( hasPrefix . "https://" ) ) }}
28-
<!-- remote js -->
29-
<script src="{{ . }}"></script>
30-
{{ else }}
31-
<!-- local js -->
32-
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
33-
{{ end }}
27+
{{ if ( or ( hasPrefix . "http://" ) ( hasPrefix . "https://" ) ) }}
28+
<!-- remote js -->
29+
<script src="{{ . }}"></script>
30+
{{ else }}
31+
<!-- local js -->
32+
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
3433
{{ end }}
34+
{{ end }}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div id="social">
22

3-
{{ range $key, $val := .Site.Social }}
3+
{{ range $key, $val := .Site.Params.Social }}
44
<a class="symbol" href="{{ $val }}" rel="me" target="_blank">
5-
{{ $svg := print "svgs/" $key ".svg" }}
5+
{{ $svg := print "svgs/" $key ".svg" }}
66
{{ partial $svg (dict "fill" "#bbbbbb" "width" 28 "height" 28 ) }}
77
</a>
8-
{{ end }}
8+
{{ end }}
99

10-
</div>
10+
</div>

0 commit comments

Comments
 (0)