Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort tags & authors (hide count1) #23

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/gh-pages.yml

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
# https://gohugo.io/hosting-and-deployment/hosting-on-github/
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main

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

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.111.3
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: Install Dart Sass Embedded
run: sudo snap install dart-sass-embedded
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# CW23 Improvements

For the 2023 Collaborations Worskshop the CW21 hack idea was revisited to improve:

* The look and feel of the content
* The metadata used for the hack ideas
* The content in terms of enhancements

People involved:

* Heather Turner, worked on content improvement
* Finn Bacall, Hugo improvement
* Joao Morado, Hugo improvements
* Jez Cope, Metadata improvements
* Patricia Herterich, Metadata improvements
* Ugur Yilmaz, Hugo improvements
* Gaurav Bhalerao, Hugo improvements
* Mario Antonioletti, Content improvements

# Exploring previous Collaborations Workshop ideas (CW-ideas)

This is a fork of a repo originally produced for a hack day project at the [2021 Collaborations Workshop](http://www.software.ac.uk/cw21). The website presents the collaborative ideas and hackday pitches generated at previous Collaborations Workshops and makes them available through an easily browseable and searchable interface.

A live version of the website is hosted at:
Expand Down Expand Up @@ -34,10 +54,5 @@ Tasks divided orthogonally
- Provisioning a GitHub repo (Robin)

## Hack day presentation
Available [here](https://docs.google.com/presentation/d/1GOjaNzfhDBwjr1lmJOlYjHYNzxpctGAla5PxpZDzOIQ/edit?usp=sharing).



## ToDo
CW21 hack day presentation is available [here](https://docs.google.com/presentation/d/1GOjaNzfhDBwjr1lmJOlYjHYNzxpctGAla5PxpZDzOIQ/edit?usp=sharing).

- [ ] Implementation of ordering: hack-day > hack-ideas > collaborative-ideas in `by_type.html` and `by_year.html` at `themes/PaperMod/layouts/_default` could be done much more elegantly - it's a bit of a hack just now.
8 changes: 8 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,16 @@ menu:
name: By type
url: /bytype/
weight: 25
- identifier: byauthors
name: By Authors
url: /byauthors/
weight: 25
- identifier: search
name: Search
url: /search
weight: 30

taxonomies:
author: "author"
tag: "tags"
category: "categories"
5 changes: 5 additions & 0 deletions content/by_authors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "By Authors"
layout: "by_authors"
url: "/byauthors/"
---
5 changes: 5 additions & 0 deletions themes/PaperMod/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@
code {
direction: ltr
}

.prize-tag.prize-1 { color: #c98016 }
.prize-tag.prize-2 { color: #7f7f7f }
.prize-tag.prize-3 { color: #da7c47 }
.prize-tag.prize-other { color: #256d8a }
22 changes: 22 additions & 0 deletions themes/PaperMod/layouts/_default/by_authors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{ define "main" }}
<main aria-role="main">
<header class="homepage-header">
{{ with .Params.subtitle }}
<span class="subtitle">{{.}}</span>
{{ end }}
</header>
<br>

<ul class="terms-tags">
{{ range .Site.Taxonomies.author.ByCount }}
{{ $count := .Count }}
{{if gt $count 1}}
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}<sup><strong><sup>{{ $count }}</sup></strong></sup></a></a></li>
{{ else }}
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a></a></li>
{{ end }}
{{ end }}
</ul>

</main>
{{ end }}
37 changes: 1 addition & 36 deletions themes/PaperMod/layouts/_default/by_type.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,6 @@
{{ end }}
</header>
<br>
{{ range (.Site.RegularPages.GroupByParam "type")}}
{{ if eq .Key "hack-day"}}
<h3>{{ .Key }}</h3>
<div>
<ul>
{{range .Pages}}
<li><a href="{{.Permalink}}">{{.Title}}</a></li>
{{end}}
</ul>
</div></br>
{{ end }}
{{ end }}
{{ range (.Site.RegularPages.GroupByParam "type")}}
{{ if eq .Key "hack-ideas"}}
<h3>{{ .Key }}</h3>
<div>
<ul>
{{range .Pages}}
<li><a href="{{.Permalink}}">{{.Title}}</a></li>
{{end}}
</ul>
</div></br>
{{ end }}
{{ end }}
{{ range (.Site.RegularPages.GroupByParam "type")}}
{{ if eq .Key "collaborative-ideas"}}
<h3>{{ .Key }}</h3>
<div>
<ul>
{{range .Pages}}
<li><a href="{{.Permalink}}">{{.Title}}</a></li>
{{end}}
</ul>
</div></br>
{{ end }}
{{ end }}
{{- partial "grouped_by_type.html" . -}}
</main>
{{ end }}
43 changes: 4 additions & 39 deletions themes/PaperMod/layouts/_default/by_year.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,9 @@
{{ end }}
</header>
<br>
{{ range (.Site.RegularPages.GroupByParam "year").Reverse}}
<h3>{{ .Key }}</h3>
{{ range (.Pages.GroupByParam "type").Reverse}}
{{ if eq .Key "hack-day" }}
<div>
<dl>
<dt><strong>{{ .Key }}</strong></dt>
{{range .Pages}}
<dd><a href="{{.Permalink}}">{{.Title}}</a></dd>
{{end}}
</dl>
</div>
{{ end }}
{{ end }}
{{ range (.Pages.GroupByParam "type").Reverse}}
{{ if eq .Key "hack-ideas" }}
<div>
<dl>
<dt><strong>{{ .Key }}</strong></dt>
{{range .Pages}}
<dd><a href="{{.Permalink}}">{{.Title}}</a></dd>
{{end}}
</dl>
</div>
{{ end }}
{{ end }}
{{ range (.Pages.GroupByParam "type").Reverse}}
{{ if eq .Key "collaborative-ideas" }}
<div>
<dl>
<dt><strong>{{ .Key }}</strong></dt>
{{range .Pages}}
<dd><a href="{{.Permalink}}">{{.Title}}</a></dd>
{{end}}
</dl>
</div>
{{ end }}
{{ end }}
{{ end }}
{{- range (.Site.Pages.GroupByParam "year").Reverse -}}
<h3>{{ .Key }}</h3>
{{- partial "grouped_by_type.html" . -}}
{{- end -}}
</main>
{{ end }}
8 changes: 6 additions & 2 deletions themes/PaperMod/layouts/_default/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ <h1>{{ .Title }}</h1>

<ul class="terms-tags">
{{- $type := .Type }}
{{- range $key, $value := .Data.Terms.Alphabetical }}
{{- range $key, $value := .Data.Terms.ByCount }}
{{- $name := .Name }}
{{- $count := .Count }}
{{- with $.Site.GetPage (printf "/%s/%s" $type $name) }}
<li>
<a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a>
{{ if gt $count 1 }}
<a href="{{ .Permalink }}">{{ .Name }}<sup><strong><sup>{{ $count }}</sup></strong></sup> </a>
{{ else }}
<a href="{{ .Permalink }}">{{ .Name }}</a>
{{- end }}
</li>
{{- end }}
{{- end }}
Expand Down
32 changes: 32 additions & 0 deletions themes/PaperMod/layouts/partials/grouped_by_type.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- $pages := cond (eq .Pages nil) site.RegularPages .Pages -}}
{{- $hack_day := where $pages "Params.type" "hack-day" | group "Hack Day" -}}
{{- $hack_ideas := where $pages "Params.type" "hack-ideas" | group "Hack Ideas" -}}
{{- $collaborative_ideas := where $pages "Params.type" "collaborative-ideas" | group "Collaborative Ideas" -}}
{{- $groups := slice $hack_day $hack_ideas $collaborative_ideas -}}
{{ range $groups }}
<div>
<dl>
<dt><strong>{{ .Key }}</strong></dt>
{{ range .Pages }}
<dd>
<a href="{{.Permalink}}">{{.Title}}</a>
{{ if eq .Params.prize 1 }}
<span class="prize-tag prize-{{- .Params.prize -}}">🥇 1st Place</span>
{{ else }}
{{ if eq .Params.prize 2 }}
<span class="prize-tag prize-{{- .Params.prize -}}">🥈 2nd Place</span>
{{ else }}
{{ if eq .Params.prize 3 }}
<span class="prize-tag prize-{{- .Params.prize -}}">🥉 3rd Place</span>
{{ else }}
{{ if ne .Params.prize nil }}
<span class="prize-tag prize-other">🏅 Winner</span>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</dd>
{{ end }}
</dl>
</div>
{{ end }}