diff options
author | Joe Hutchinson <hutch7995@gmail.com> | 2022-02-10 08:19:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 08:19:08 +0300 |
commit | f7848361fc4c8963e4e094c1ce5ebe5f8a387a38 (patch) | |
tree | b599a30997fbe582ed51e586f00b08ae34efe531 | |
parent | d49083abec1ff414a5140a9a01f0d21c88fc7f1c (diff) |
Mobile card active and GitHub Actions (#71)
* Remove js for mobile card click style
* Add headshot alt text and update example site
* Add html validator github action
* Debug GA
* Fix GA bug
-rw-r--r-- | .github/workflows/main.yml | 28 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | assets/css/style.css | 3 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | exampleSite/content/posts/aether-features/index.md | 2 | ||||
-rw-r--r-- | exampleSite/content/posts/creating-a-new-theme/index.md | 2 | ||||
-rw-r--r-- | exampleSite/content/posts/goisforlovers/index.md | 11 | ||||
-rw-r--r-- | exampleSite/content/posts/hugoisforlovers/index.md | 9 | ||||
-rw-r--r-- | exampleSite/content/posts/migrate-from-jekyll/index.md | 2 | ||||
-rw-r--r-- | layouts/_default/home.html | 2 | ||||
-rw-r--r-- | layouts/_default/li-next.html | 5 | ||||
-rw-r--r-- | layouts/_default/li.html | 3 | ||||
-rw-r--r-- | layouts/partials/home-card.html | 2 |
13 files changed, 54 insertions, 17 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7c85603 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,28 @@ +name: Validate Generated Files + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Install Dependencies + run: | + sudo snap install hugo + pip install html5validator + + - name: Build Example Site + run: | + cd exampleSite/ + hugo --minify + + - name: Validate Generated Files + run: html5validator --root exampleSite/public/ --also-check-css --ignore katex @@ -38,6 +38,7 @@ disqusShortname = "Your shortname for Disqus - optional" description = "The website's description"
bgimg = "Path, within the 'assets' folder, of the image used for the page background - optional"
headshotimg = "Path, within the 'assets' folder, of the image used for the home page header - optional"
+ headshotalt = "Alt text for the headshotimg - should be used with headshotimg"
rssinmenu = whether you would like a RSS feed link to appear in the nav menu and footer (true, false) - optional
facebook = "URL to your Facebook account, icon link will be included in the footer - optional"
flicker = "URL to your Flicker account, icon link will be included in the footer - optional"
diff --git a/assets/css/style.css b/assets/css/style.css index 1c62f08..b6e8c81 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -10,7 +10,6 @@ body { align-items: center; width: 100%; box-sizing: border-box; - word-break: break-word; } p { margin: 1.5em 0; @@ -458,7 +457,7 @@ footer { margin: 0; } @media screen and (pointer: coarse) { - .card-hover { + .card:active { transform: scale(0.95); box-shadow: 0 0.4rem 2rem 0 rgba(0,0,0,0.2); } diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d286c3c..af88763 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -10,6 +10,7 @@ themesDir = "../../" brand = "aether" description = "aether Hugo theme for blogs" headshotimg = "img/faceshot.jpg" + headshotalt = "Generic grey headshot picture" [markup] [markup.highlight] diff --git a/exampleSite/content/posts/aether-features/index.md b/exampleSite/content/posts/aether-features/index.md index c29d9bc..22987d3 100644 --- a/exampleSite/content/posts/aether-features/index.md +++ b/exampleSite/content/posts/aether-features/index.md @@ -10,6 +10,8 @@ draft: false resources: - name: featuredImage src: "mdd-iphone.jpg" + params: + description: "An iphone with a website featuring the aether theme" --- Hugo combined with the Aether theme turns easy to write markdown into powerful web pages. KaTeX, Highlight.js, and Hugo provides the ability to create mathmatical symobols, equations, highlighted code, tables, lists, and much more. diff --git a/exampleSite/content/posts/creating-a-new-theme/index.md b/exampleSite/content/posts/creating-a-new-theme/index.md index 8159821..f296d6e 100644 --- a/exampleSite/content/posts/creating-a-new-theme/index.md +++ b/exampleSite/content/posts/creating-a-new-theme/index.md @@ -9,6 +9,8 @@ draft: false resources: - name: featuredImage src: "nyc.jpg" + params: + description: "The New York City skyline" --- diff --git a/exampleSite/content/posts/goisforlovers/index.md b/exampleSite/content/posts/goisforlovers/index.md index f581909..2f24361 100644 --- a/exampleSite/content/posts/goisforlovers/index.md +++ b/exampleSite/content/posts/goisforlovers/index.md @@ -15,11 +15,12 @@ categories = [ "Development", "golang", ] -[[resources]] - name = "featuredImage" - src = "lucas-benjamin-565254-unsplash.jpg" - [resources.params] - description = "Alt description for the featured image" +[resources] +name = "featuredImage" +src = "lucas-benjamin-565254-unsplash.jpg" + +[resources.params] +description = "A jellyfish with neon colors with a dark background" +++ Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for diff --git a/exampleSite/content/posts/hugoisforlovers/index.md b/exampleSite/content/posts/hugoisforlovers/index.md index 52ebf7d..877edc4 100644 --- a/exampleSite/content/posts/hugoisforlovers/index.md +++ b/exampleSite/content/posts/hugoisforlovers/index.md @@ -15,9 +15,12 @@ categories = [ "Development", "golang", ] -[[resources]] - name = "featuredImage" - src = "andrew-neel-609846-unsplash.jpg" +[resources] +name = "featuredImage" +src = "andrew-neel-609846-unsplash.jpg" + +[resources.params] +description = "A person sitting on a hardwood floor on their laptop" +++ ## Step 1. Install Hugo diff --git a/exampleSite/content/posts/migrate-from-jekyll/index.md b/exampleSite/content/posts/migrate-from-jekyll/index.md index 7b323ab..7086cf1 100644 --- a/exampleSite/content/posts/migrate-from-jekyll/index.md +++ b/exampleSite/content/posts/migrate-from-jekyll/index.md @@ -7,6 +7,8 @@ title: Migrate to Hugo from Jekyll resources: - name: featuredImage src: "yan-ots-257617-unsplash.jpg" + params: + description: "Colorful buildings alongside a body of water" --- ## Move static content to `static` diff --git a/layouts/_default/home.html b/layouts/_default/home.html index 820a2f2..7ec6bb8 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -17,7 +17,7 @@ {{ $faceshot_x2 := .Resize "544x Lanczos" }} {{ $faceshot_x3 := .Resize "816x Lanczos" }} <source srcset="{{ $faceshot.Permalink }} 1x, {{ $faceshot_x2.Permalink }} 2x, {{ $faceshot_x3.Permalink }} 3x"> - <img class="home-faceshot" src="{{ $faceshot.Permalink }}" {{ with .Params.description -}} alt="{{ . }}" {{- end }}> + <img class="home-faceshot" src="{{ $faceshot.Permalink }}" {{ with $.Site.Params.headshotalt -}} alt="{{ . }}" {{- end }}> </picture> </div> {{ end -}} diff --git a/layouts/_default/li-next.html b/layouts/_default/li-next.html index ad7adf1..ced83df 100644 --- a/layouts/_default/li-next.html +++ b/layouts/_default/li-next.html @@ -1,5 +1,4 @@ -<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)" - href="{{ .Permalink }}" class="card blog-card bc-next" rel="bookmark" > +<a href="{{ .Permalink }}" class="card blog-card bc-next" rel="bookmark" > {{ with .Resources.GetMatch "featuredImage" }} <div class="card-img-container"> <p class="card-img-overlay">Next Article</p> @@ -16,7 +15,7 @@ <h2 class="card-title">{{ .Title | markdownify }}</h2> <p class="card-text">{{ if (isset .Params "description") }}{{ index .Params "description" | htmlUnescape }}{{ else }}{{ .Summary | plainify | htmlUnescape }}{{ end }}</p> <div class="card-subtext muted-text"> - <p>Posted <time datetime="{{ .PublishDate.Format "2006-01-02 12:00" }}">{{ .PublishDate.Format "Jan 2, 2006" }}</time></p> + <p>Posted <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "Jan 2, 2006" }}</time></p> {{ if (isset .Params "categories") }}<p>{{ range .Params.categories }}#{{ . }} {{ end }}</p>{{ end }} </div> </article> diff --git a/layouts/_default/li.html b/layouts/_default/li.html index 10831a9..4cdb678 100644 --- a/layouts/_default/li.html +++ b/layouts/_default/li.html @@ -1,5 +1,4 @@ -<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)" - href="{{ .Permalink }}" class="card blog-card" rel="bookmark" > +<a href="{{ .Permalink }}" class="card blog-card" rel="bookmark" > {{ with .Resources.GetMatch "featuredImage" }} <div class="card-img-container"> <picture> diff --git a/layouts/partials/home-card.html b/layouts/partials/home-card.html index 7435a58..504e4ca 100644 --- a/layouts/partials/home-card.html +++ b/layouts/partials/home-card.html @@ -1,4 +1,4 @@ -<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)" +<a href="{{ .Site.BaseURL }}" class="card home-card" style="background-image: url({{if isset .Site.Params "homeimg"}} {{ (resources.Get .Site.Params.homeimg).Permalink | safeCSS }} {{ else }} {{ (resources.Get "img/grey-cloud.jpg").Permalink | safeCSS }} {{ end }})" rel="bookmark" > Home </a>
\ No newline at end of file |