diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 3d62184..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom: ["https://www.paypal.me/janraasch/29,00"] -github: ["janraasch"] diff --git a/.github/stale.yml b/.github/stale.yml index dc90e5a..86c4885 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,17 +1,18 @@ # Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 +daysUntilStale: 90 # Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 +daysUntilClose: 30 # Issues with these labels will never be considered stale exemptLabels: - pinned - security + - bug + - priority-high +exemptProjects: true +exemptMilestones: true # Label to use when marking an issue as stale -staleLabel: wontfix +staleLabel: no-activity # Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. +markComment: false # Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false +closeComment: false \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 569bd32..f931a91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,23 +10,24 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Hugo - uses: peaceiris/actions-hugo@v2.5.0 + uses: peaceiris/actions-hugo@v3.0.0 with: hugo-version: latest + extended: true - name: Build local ./exampleSite - run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://janraasch.github.io/hugo-scroll/ + run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://zjedi.github.io/hugo-scroll/ - name: Deploy to GitHub Pages if: github.event_name == 'push' - uses: peaceiris/actions-gh-pages@v3.8.0 + uses: peaceiris/actions-gh-pages@v4.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public diff --git a/.gitignore b/.gitignore index ea47378..0c3b764 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ public exampleSite/public +exampleSite/resources node_modules +*.lock +hugo-scroll.code-workspace diff --git a/.prettierignore b/.prettierignore index f8ebd30..7cace38 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,5 @@ -build -resources +assets/css/fontawesome +assets/css/normalize.css +layouts/_default/index.html public -static/fork-awesome -static/css/normalize.css -layouts/index.html +resources diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f5284ff --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +* Added for new features. +* Changed for changes in existing functionality. +* Deprecated for soon-to-be removed features. +* Removed for now removed features. +* Fixed for any bug fixes. +* Security in case of vulnerabilities. + +## [Unreleased](https://github.com/zjedi/hugo-scroll/compare/v.1.0.0...master) + +* **JS cleanup / CSS refactoring**, possibly causing some pain if you have extensive CSS customisations in screen.css #4, #61, #102. For backwards compatibility, a released tag `v1.0.0` was created just in case some projects needed to fix the legacy version. However, I won't actively support the legacy branch. +* New features: #70 , #46 , #118 +* More features #116 , #119 + +## [1.0.0 Legacy Snapshot](https://github.com/zjedi/hugo-scroll/releases/tag/v.1.0.0) + +## Template for new releases + +## [x.y.z](https://github.com/zjedi/hugo-scroll/compare/v1.0.0...vx.y.z) + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +### Security diff --git a/README.md b/README.md index f2ca754..f95e63d 100644 --- a/README.md +++ b/README.md @@ -1,97 +1,144 @@ -# Hugo Scroll ![Test](https://github.com/janraasch/hugo-scroll/workflows/CI/badge.svg?branch=master&event=push) [![Pay me][paypal-svg]][paypal-dot-me] [![Sponsor me][github-sponsors-svg]][github-sponsors] +

Hugo Scroll 📜 Demo

-📜 A [Hugo](https://gohugo.io/)-theme for pretty, quick and simple single-page websites. +Clean, responsive, single-page [Hugo](https://gohugo.io/) website theme. -![Screenshot Hugo Scroll Theme](https://raw.githubusercontent.com/janraasch/hugo-scroll/master/images/tn.png) +[![hugo-scroll](https://img.shields.io/badge/Hugo--Themes-HugoScroll-blue)](https://themes.gohugo.io/themes/hugo-scroll/) +![Test](https://github.com/zjedi/hugo-scroll/workflows/CI/badge.svg?branch=master&event=push) +[![Netlify Status](https://api.netlify.com/api/v1/badges/a56faf45-76fa-4bdf-b9d4-35cfc7d620cf/deploy-status)](https://app.netlify.com/sites/hugo-scroll/deploys) +[![GitHub](https://img.shields.io/github/license/zjedi/hugo-scroll)](https://github.com/zjedi/hugo-scroll/blob/master/LICENSE) +![code-size](https://img.shields.io/github/languages/code-size/zjedi/hugo-scroll) -## Demo +Promo image which may be a bit outdated:
+![Screenshot Hugo Scroll Theme](https://raw.githubusercontent.com/zjedi/hugo-scroll/master/images/tn.png) -For a current & working demo of this theme please check out https://janraasch.github.io/hugo-scroll/ 🎯. +## ⭐ Feature highlights -## Sponsor 💟 +- Responsive to screen size/shape +- SEO friendly +- Customizable +- Video cover +- [Font Awesome v6.6.0 Icons][font-awesome-icons] out of the box +- Header logo +- Visual guards to guarantee readability +- External links +- JS/CSS Assets optimized (Minification, Fingerprinting, pipeline-processed +into single file) +- git info in footer (opt-in) -Support my work on this theme via [GitHub Sponsors][github-sponsors] (recurring) or [PayPal][paypal-dot-me] (one-time). +## 🔑 Installation -[![GitHub Stats](https://github-readme-stats.vercel.app/api/?username=janraasch)][github-sponsors] +You need to install Hugo extended version. +If you already have a Hugo site on your machine, you can simply add this theme via -## Installation - -If you already have a hugo site on your machine, you can simply add this theme via - -``` -git submodule add https://github.com/janraasch/hugo-scroll.git themes/hugo-scroll +```cli +git submodule add https://github.com/zjedi/hugo-scroll.git themes/hugo-scroll ``` -Then, adjust the `config.toml` as detailed below. +Then, adjust the `hugo.toml` as detailed below & in the file comments. + +### Playing around with our example site If you simply want to check out the `exampleSite`, you can run -``` -git clone https://github.com/janraasch/hugo-scroll.git hugo-scroll +```cli +git clone https://github.com/zjedi/hugo-scroll.git hugo-scroll cd hugo-scroll hugo server --source=exampleSite --themesDir=../.. ``` -For more information read the official [setup guide][hugo-setup-guide] of Hugo. - -## Adjust configuration / config.toml - -Please check out the [config.toml](https://github.com/janraasch/hugo-scroll/blob/master/exampleSite/config.toml) included on the [exampleSite](https://github.com/janraasch/hugo-scroll/tree/master/exampleSite) of this theme. - -## Content & structure - -### Starting fresh +For more information, read the official [Hugo setup guide][hugo-setup-guide]. If you are starting fresh, simply copy over the contents of the `exampleSite`-directory included in this theme to your source directory. That should give you a good idea about how things work, and then you can go on from there to make the site your own. -### Adding content +Please check out the [hugo.toml](https://github.com/zjedi/hugo-scroll/blob/master/exampleSite/hugo.toml) included in the [exampleSite](https://github.com/zjedi/hugo-scroll/tree/master/exampleSite) of this theme. -You can add **a new section to the homepage** via running +You can add **a new section to the homepage** by running `hugo new homepage/my-new-content.md` (or craft the file manually) -``` -hugo new homepage/my-new-content.md +To create **a page separate from the homepage**, run `hugo new my-new-page.md` + +## 🔧 Feature details 🔨 + +### Customizing CSS + +Add a [`custom_head.html`](https://github.com/zjedi/hugo-scroll/blob/master/exampleSite/layouts/partials/custom_head.html) file to your `layouts/partials` directory. + +- You can use ` --> + /* define list element for unnumbered lists, leave empty for default list element */ + /* fa-asterisk is the default icon if this variable definition is missing completely */ + --ul-li-icon: fa-dashcube; /* this sets fa-dashcube as list icon */ + --ul-li-icon: ; /* this sets the default html list icon */ +} + +--> - - - +{{ with resources.Get "images/apple-touch-icon.png" }}{{ end }} +{{ with resources.Get "images/favicon.svg" }}{{ end }} +{{ range seq 9 4 }}{{ $size := pow 2 . }}{{ $file := replace "images/favicon-##x##.png" "##" $size }}{{ with resources.Get $file }} +{{ end }}{{ end }} + diff --git a/exampleSite/layouts/partials/custom_header_video.html b/exampleSite/layouts/partials/custom_header_video.html new file mode 100644 index 0000000..49ff1f5 --- /dev/null +++ b/exampleSite/layouts/partials/custom_header_video.html @@ -0,0 +1,11 @@ + diff --git a/exampleSite/static/images/board-bunch-cooking-food-349609.jpg b/exampleSite/static/images/board-bunch-cooking-food-349609.jpg index 2f5ee35..00fcf8a 100644 Binary files a/exampleSite/static/images/board-bunch-cooking-food-349609.jpg and b/exampleSite/static/images/board-bunch-cooking-food-349609.jpg differ diff --git a/exampleSite/static/images/happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg b/exampleSite/static/images/happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg deleted file mode 100644 index 86438dc..0000000 Binary files a/exampleSite/static/images/happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg and /dev/null differ diff --git a/exampleSite/static/images/photography-of-tomatoes-near-basil-leaves-1391487.jpg b/exampleSite/static/images/photography-of-tomatoes-near-basil-leaves-1391487.jpg deleted file mode 100644 index 271a8a5..0000000 Binary files a/exampleSite/static/images/photography-of-tomatoes-near-basil-leaves-1391487.jpg and /dev/null differ diff --git a/exampleSite/static/images/selective-focus-photography-of-pasta-with-tomato-and-basil-1279330.jpg b/exampleSite/static/images/selective-focus-photography-of-pasta-with-tomato-and-basil-1279330.jpg index 9a4d936..e49f5e9 100644 Binary files a/exampleSite/static/images/selective-focus-photography-of-pasta-with-tomato-and-basil-1279330.jpg and b/exampleSite/static/images/selective-focus-photography-of-pasta-with-tomato-and-basil-1279330.jpg differ diff --git a/exampleSite/static/images/static-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg b/exampleSite/static/images/static-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg new file mode 100644 index 0000000..71ebeb5 Binary files /dev/null and b/exampleSite/static/images/static-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg differ diff --git a/exampleSite/static/images/woman-pouring-juice-on-glass-3184192.jpg b/exampleSite/static/images/woman-pouring-juice-on-glass-3184192.jpg index 1824a4d..3f881e0 100644 Binary files a/exampleSite/static/images/woman-pouring-juice-on-glass-3184192.jpg and b/exampleSite/static/images/woman-pouring-juice-on-glass-3184192.jpg differ diff --git a/i18n/de.toml b/i18n/de.toml new file mode 100644 index 0000000..7563e59 --- /dev/null +++ b/i18n/de.toml @@ -0,0 +1,5 @@ +[email] +other = "Email" + +[phone] +other = "Telefon" diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..87afd30 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,5 @@ +[email] +other = "Email" + +[phone] +other = "Phone" diff --git a/images/screenshot.png b/images/screenshot.png index 2b7e54e..be4eeac 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index 4daa6bc..be4eeac 100644 Binary files a/images/tn.png and b/images/tn.png differ diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index b192fa0..cc95895 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,17 +1,27 @@ - - {{- partial "head.html" . -}} + + + {{- partial "head.html" . -}} + {{- partial "header.html" . -}} {{- block "main" . }}{{- end }} {{- partial "footer.html" . -}} - + + {{ $scriptJquery := resources.Get "js/jquery-3.6.3.min.js" }} - - + {{ $scriptIndex := resources.Get "js/index.js" }} + {{ $scriptPolyfill := resources.Get "js/css-vars-ponyfill.min.js" }} + {{ $js := slice $scriptJquery $scriptIndex $scriptPolyfill | resources.Concat "js/script.js" | resources.Minify | resources.Fingerprint }} + + + + + + diff --git a/layouts/_default/index.html b/layouts/_default/index.html new file mode 100644 index 0000000..0fa0938 --- /dev/null +++ b/layouts/_default/index.html @@ -0,0 +1,161 @@ +{{ define "main" }} +{{ $headless := .GetPage "./homepage" }} +{{ if hugo.IsMultihost }} + {{ $headless := .Site.GetPage "/homepage" }} +{{ end }} +{{ $sections := $headless.Resources.ByType "page" }} +{{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }} +{{ $content := where (where $sections "Params.external" "==" nil) "Params.detailed_page_homepage_content" "ne" false }} +{{ $langs := .Page.AllTranslations }} +{{ if hugo.IsMultihost }} + {{ $langs = .Site.Languages }} +{{ end }} + + +{{ if not .Params.header_use_video }} + {{ with $img := resources.Get .Params.header_image }} + {{ $image_options := $.Site.Params.image_options | default "webp q90 lanczos photo" -}} + + {{ end }} +