Skip to content

Commit

Permalink
Added changes from main repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpech committed Mar 11, 2024
2 parents 18c590a + 4d7dca2 commit a5c44f7
Show file tree
Hide file tree
Showing 29 changed files with 223 additions and 116 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

# Ignore minimized files when diffing/grepping
*.min.js -diff
*.min.css -diff
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Based on the sample workflow for building and deploying a Hugo site to GitHub Pages
name: Build Hugo site

on:
# Build on all PRs
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allow one concurrent build per PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.120.1
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/" \
-s "./exampleSite/" \
--themesDir "../../"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./exampleSite/public

10 changes: 5 additions & 5 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.104.2
HUGO_VERSION: 0.120.1
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
Expand All @@ -51,7 +51,7 @@ jobs:
-s "./exampleSite/" \
--themesDir "../../"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: ./exampleSite/public

Expand All @@ -69,4 +69,4 @@ jobs:
success()
&& github.ref == 'refs/heads/master'
&& github.repository == 'halogenica/beautifulhugo'
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk

# Hugo's lock
.hugo_build.lock
exampleSite/public/
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ See https://hugo-theme-beautifulhugo.netlify.app/

Install Hugo and create a new site. See [the Hugo documentation](https://gohugo.io/getting-started/quick-start/) for details.

Add Beautifulhugo:
### Git Submodule

Add Beautifulhugo as git submodule:

$ git submodule add https://github.com/sunpech/beautifulhugo.git themes/beautifulhugo

### Hugo module

Initialize your site as hugo module:

$ hugo mod init github.com/USERNAME/SITENAME

Add Beautifulhugo module as a dependency of your site:

$ hugo mod get github.com/halogenica/beautifulhugo

### Site preview

Copy the content of `exampleSite` at the root of your project:

cp -r themes/beautifulhugo/exampleSite/* . -iv
Expand Down Expand Up @@ -60,7 +74,7 @@ pygmentsStyle = "trac"
pygmentsUseClassic = true
```

Pygments is mostly compatable with the newer Chroma. It is slower but has some additional theme options. I recommend Chroma over Pygments. Pygments will use `syntax.css` for highlighting, unless you also set the config `pygmentsUseClasses = false` which will generate the style code directly in the HTML file.
Pygments is mostly compatible with the newer Chroma. It is slower but has some additional theme options. I recommend Chroma over Pygments. Pygments will use `syntax.css` for highlighting, unless you also set the config `pygmentsUseClasses = false` which will generate the style code directly in the HTML file.

#### Highlight.js - Client side syntax highlighting
```
Expand Down Expand Up @@ -121,6 +135,15 @@ comments:

If you *don't* have the section `[Params.staticman]` in `config.toml`, you *won't* need the section `reCaptcha` in `staticman.yml`

### Site Disclaimer

If you need to put a Disclaimer on your website (e.g. "My views are my own and not my employer's"), you can do so via the following:

* Uncomment and edit the `disclaimerText` parameter in `config.toml`.
* If you need to adjust the disclaimer's styling, modify the declarations within the `footer div.disclaimer` selector in `static/css/main.css`.

> The code for the disclaimer text is in `layouts/partials/footer.html`. Moving this code block to another partial file (or relocating it within `footer.html`) will require changes to the css selector in `main.css` as well.
### Google Analytics

To add Google Analytics, simply sign up to [Google Analytics](https://www.google.com/analytics/) to obtain your Google Tracking ID, and add this tracking ID to the `googleAnalytics` parameter in `config.toml`.
Expand Down Expand Up @@ -203,6 +226,19 @@ This is column 2.
{{< endcolumns >}}
```

### Social Media Icons

In order to show social media icons in the footer, add a section like this to your `config.yaml`. You can see the full list of supported social media sites in `data/beautifulhugo/social.toml`.

```yaml
author:
name: "Author Name"
website: "https://example.com"
github: halogenica/beautifulhugo
twitter: username
discord: 96VAXXvjCB
```
## About
This is an adaptation of the Jekyll theme [Beautiful Jekyll](https://deanattali.com/beautiful-jekyll/) by [Dean Attali](https://deanattali.com/aboutme#contact). It supports most of the features of the original theme, and many new features. It has diverged from the Jekyll theme over time, with years of community updates.
Expand Down
36 changes: 36 additions & 0 deletions data/beautifulhugo/social.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ url = "https://weibo.com/%s"
title = "Weibo"
icon = "fab fa-weibo"

[[social_icons]]
id = "medium"
url = "https://medium.com/@%s"
title = "Medium"
icon = "fab fa-medium"

[[social_icons]]
id = "discord"
url = "https://discord.gg/%s"
Expand All @@ -172,3 +178,33 @@ id = "strava"
url = "https://www.strava.com/athletes/%s"
title = "Strava"
icon = "fab fa-strava"

[[social_icons]]
id = "steam"
url = "https://steamcommunity.com/id/%s"
title = "Steam"
icon = "fab fa-steam"

[[social_icons]]
id = "quora"
url = "https://www.quora.com/profile/%s"
title = "Quora"
icon = "fab fa-quora"

[[social_icons]]
id = "amazonwishlist"
url = "https://amzn.com/w/%s"
title = "Amazon Wishlist"
icon = "fab fa-amazon"

[[social_icons]]
id = "slideshare"
url = "https://www.slideshare.net/%s"
title = "Slideshare"
icon = "fab fa-slideshare"

[[social_icons]]
id = "angellist"
url = "https://www.angel.co/p/%s"
title = "AngelList"
icon = "fab fa-angellist"
2 changes: 1 addition & 1 deletion exampleSite/content/page/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ What else do you need?

### my history

To be honest, I'm having some trouble remembering right now, so why don't you just watch [my movie](http://en.wikipedia.org/wiki/The_Princess_Bride_%28film%29) and it will answer **all** your questions.
To be honest, I'm having some trouble remembering right now, so why don't you just watch [my movie](https://en.wikipedia.org/wiki/The_Princess_Bride_%28film%29) and it will answer **all** your questions.
4 changes: 2 additions & 2 deletions exampleSite/content/post/2015-02-20-test-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ date: 2015-02-20
tags: ["example", "markdown"]
---

You can write regular [markdown](http://markdowntutorial.com/) here and [Hugo](https://gohugo.io) will automatically convert it to a nice webpage. I strongly encourage you to [take 5 minutes to learn how to write in markdown](http://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc.
You can write regular [markdown](https://markdowntutorial.com/) here and [Hugo](https://gohugo.io) will automatically convert it to a nice webpage. I strongly encourage you to [take 5 minutes to learn how to write in markdown](https://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc.

**Here is some bold text**

Expand All @@ -23,7 +23,7 @@ Here's a useless table:

How about a yummy crepe?

![Crepe](http://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg)
![Crepe](https://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg)

Here's a code chunk with syntax highlighting:

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/post/2017-03-05-math-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $$
\phi = \frac{(1+\sqrt{5})}{2} = 1.6180339887\cdots
$$

Additional details can be found on [GitHub](https://github.com/Khan/KaTeX) or on the [Wiki](http://tiddlywiki.com/plugins/tiddlywiki/katex/).
Additional details can be found on [GitHub](https://github.com/KaTeX/KaTeX) or on the [project homepage](https://katex.org/).
<!--more-->

### Example 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ date: 2017-03-20
tags: ["example", "photoswipe"]
---

Beautiful Hugo adds a few custom shortcodes created by [Li-Wen Yip](https://www.liwen.id.au/heg/) and [Gert-Jan van den Berg](https://github.com/GjjvdBurg/HugoPhotoSwipe) for making galleries with [PhotoSwipe](http://photoswipe.com) .
Beautiful Hugo adds a few custom shortcodes created by [Li-Wen Yip](https://www.liwen.id.au/heg/) and [Gert-Jan van den Berg](https://github.com/GjjvdBurg/HugoPhotoSwipe) for making galleries with [PhotoSwipe](https://photoswipe.com) .

{{< gallery caption-effect="fade" >}}
{{< figure thumb="-thumb" link="/img/hexagon.jpg" >}}
Expand Down
4 changes: 4 additions & 0 deletions exampleSite/config.toml → exampleSite/hugo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
baseurl = "https://username.github.io"
DefaultContentLanguage = "en"
title = "Beautiful Hugo"
# Using theme as git submodule
theme = "beautifulhugo"
# Or when using theme as hugo module
# theme = "github.com/halogenica/beautifulhugo"
pygmentsStyle = "trac"
pygmentsUseClasses = true
pygmentsCodeFences = true
Expand Down Expand Up @@ -74,6 +77,7 @@ pygmentsCodefencesGuessSyntax = true
kaggle = "username"
weibo = "username"
slack = "username"
medium = "username"
discord = "invite code (https://discord.gg/XXXXXXX)"
strava = "userid"

Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/halogenica/beautifulhugo

go 1.20
56 changes: 0 additions & 56 deletions i18n/lmo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,62 +148,6 @@

translation: "Varda anca"

# Content

- id: dateFormat

translation: "2 January 2006"

- id: shortdateFormat

translation: "2 Jan 2006 15:04:05"

- id: postedOnDate

translation: "Publegaa il {{ .Count }}"

- id: lastModified

translation: "(Darrera modifega ell {{ .Count }})"

- id: translationsLabel

translation: "Alter lengov: "

- id: translationsSeparator

translation: ", "

- id: readMore

translation: "Lensg"

- id: olderPosts

translation: "Articol pussee vegg"

- id: newerPosts

translation: "Articoli pussee noeuv"

- id: previousPost

translation: "Articolo de prima"

- id: nextPost

translation: "Articolo dopo"

- id: readTime

translation: "megnuu"

- id: words

translation: "paroll"





# 404 page
Expand Down
8 changes: 4 additions & 4 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
{{ $data := .Data }}

<div class="container" role="main">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<article class="post-preview">
<div class="panel-group" id="accordion">
{{ range $key, $value := .Data.Terms.ByCount }}
<div class="panel panel-default">
<a class="collapsed" role="button" data-toggle="collapse" data-target="#collapse{{ $value.Name }}" data-parent="#accordion">
<div class="panel-heading" id="header{{ $value.Name }}">
<a class="collapsed" role="button" data-toggle="collapse" data-target="#collapse{{ $value.Name | anchorize }}" data-parent="#accordion">
<div class="panel-heading" id="header{{ $value.Name | anchorize }}">
<h4 class="panel-title">
{{ $value.Name }}
<span class="badge">{{ $value.Count }}</span>
</h4>
</div>
</a>
<div id="collapse{{ $value.Name }}" class="panel-collapse collapse">
<div id="collapse{{ $value.Name | anchorize }}" class="panel-collapse collapse">
<div class="panel-body">
<a href="{{ $.Site.LanguagePrefix | absURL }}/{{ $data.Plural }}/{{ $value.Name | urlize }}/" class="list-group-item view-all">
View all</a>
Expand Down
Loading

0 comments on commit a5c44f7

Please sign in to comment.