diff --git a/.gitattributes b/.gitattributes index bdb0cabc..f75b655e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..6c35640b --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 + diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 8001df9c..015785be 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -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 @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index 81b9599b..36c960b6 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,7 @@ $RECYCLE.BIN/ Network Trash Folder Temporary Items .apdisk + +# Hugo's lock +.hugo_build.lock +exampleSite/public/ diff --git a/README.md b/README.md index a00427ab..30a58770 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` @@ -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`. @@ -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. diff --git a/data/beautifulhugo/social.toml b/data/beautifulhugo/social.toml index 7f1daf09..5f868987 100644 --- a/data/beautifulhugo/social.toml +++ b/data/beautifulhugo/social.toml @@ -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" @@ -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" diff --git a/exampleSite/content/page/about.md b/exampleSite/content/page/about.md index ee61a995..355e7540 100644 --- a/exampleSite/content/page/about.md +++ b/exampleSite/content/page/about.md @@ -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. \ No newline at end of file +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. \ No newline at end of file diff --git a/exampleSite/content/post/2015-02-20-test-markdown.md b/exampleSite/content/post/2015-02-20-test-markdown.md index 1b360593..e8c579d4 100644 --- a/exampleSite/content/post/2015-02-20-test-markdown.md +++ b/exampleSite/content/post/2015-02-20-test-markdown.md @@ -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** @@ -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: diff --git a/exampleSite/content/post/2017-03-05-math-sample.md b/exampleSite/content/post/2017-03-05-math-sample.md index 8ecf6660..f778777f 100644 --- a/exampleSite/content/post/2017-03-05-math-sample.md +++ b/exampleSite/content/post/2017-03-05-math-sample.md @@ -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/). ### Example 1 diff --git a/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md b/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md index 3daf1723..0ec2f47f 100644 --- a/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md +++ b/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md @@ -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" >}} diff --git a/exampleSite/config.toml b/exampleSite/hugo.toml similarity index 95% rename from exampleSite/config.toml rename to exampleSite/hugo.toml index 7ce04db9..90b9520c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/hugo.toml @@ -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 @@ -74,6 +77,7 @@ pygmentsCodefencesGuessSyntax = true kaggle = "username" weibo = "username" slack = "username" + medium = "username" discord = "invite code (https://discord.gg/XXXXXXX)" strava = "userid" diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..47e42f76 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/halogenica/beautifulhugo + +go 1.20 diff --git a/i18n/lmo.yaml b/i18n/lmo.yaml index 92ece42a..f78d0143 100644 --- a/i18n/lmo.yaml +++ b/i18n/lmo.yaml @@ -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 diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 88e6d318..8cad3205 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -3,20 +3,20 @@ {{ $data := .Data }}