Skip to content

Commit

Permalink
Various changes around developer experience
Browse files Browse the repository at this point in the history
* add .envrc to download latest version of hugo on macos and Linux
* add list.html layout to support table-of-contents like view without
  manually updating announcements.md
* put RSS link into header on Section pages
* only build RSS for Section pages
* remove deprecated taxonomyGroup keyword
* add PR previews
* support multiple types of content to list on /news/ page
* rename /announcements/ to /news/
    * setup redirects for all existing pages that would be affected
  • Loading branch information
NeilHanlon committed Apr 5, 2024
1 parent 4f40593 commit a2ddd14
Show file tree
Hide file tree
Showing 21 changed files with 278 additions and 50 deletions.
24 changes: 24 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source_up_if_exists

PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')

test -d .bin || mkdir .bin

HUGO_VERSION=0.120.3
case "$(uname -m)" in
x86_64 | amd64)
GOARCH="amd64"
;;
arm64 | aarch64)
GOARCH="arm64"
;;
*)
GOARCH="amd64"
;;
esac

URL=https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_${PLATFORM}-${GOARCH}.tar.gz

test -f .bin/hugo || curl -Lso - $URL | gzip -dc | tar -C .bin -x hugo

PATH_add .bin
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.115.4
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: hugo
uses: floryn90/actions-hugo@1.0.1
if: github.event.action != 'closed'
with:
version: 0.115.4
image: ext-alpine
command: --minify --baseURL https://openela.github.io/openela.org/pr-preview/pr-${{ github.event.number }}

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./public/
2 changes: 1 addition & 1 deletion .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- 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
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ hugo.exe
hugo.linux
hugo.darwin

.bin/*
4 changes: 3 additions & 1 deletion archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
slug: "{{ .Name }}"
date: {{ .Date.Format "2024-03-04" }}
author: YOUR NAME HERE
draft: true
---

11 changes: 0 additions & 11 deletions content/announcements.md

This file was deleted.

Empty file added content/blog/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions content/blog/first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: My First Blog
slug: my-first-blog
date: 2024-04-05
type: blog
tags:
- engineering
- software
- upstream
---

stuff and things
4 changes: 3 additions & 1 deletion content/news/2023.09.07-current_status.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: OpenELA Current Status and What's Coming Next
Author: Alan Clark
Date: September 7th, 2023
Date: 2023-09-07
aliases:
- /announcements/openela-current-status-and-whats-coming-next
---
__Author:__ Alan Clark (CTO Office, SUSE) \
__Date:__ September 7th, 2023
Expand Down
6 changes: 3 additions & 3 deletions content/news/2023.11.02-governance_and_code_availability.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: OpenELA Marks Major Milestones in Governance and Code Availability
Author: OpenELA Community
Date: November 2nd, 2023
Date: 2023-11-02
aliases:
- /announcements/openela-marks-major-milestones-in-governance-and-code-availability
---
__Author:__ OpenELA Community \
__Date:__ November 2nd, 2023

----
* Source code for packages is now available (and more is on the way)
Expand Down
6 changes: 3 additions & 3 deletions content/news/2023.12.13-initiate-documentation-repository.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: OpenELA Initiates a Documentation Repository for the Community
Author: Antoinette O’Sullivan, senior director of documentation for Linux, virtualization, and systems, Oracle
Date: December 13, 2023
Date: 2023-12-13
aliases:
- /announcements/openela-initiates-a-documentation-repository-for-the-community
---
__Author:__ Antoinette O’Sullivan (senior director of documentation for Linux, virtualization, and systems, Oracle) \
__Date:__ December 13, 2023

----
* OpenELA is pleased to announce the creation of a user documentation repository
Expand Down
6 changes: 3 additions & 3 deletions content/news/2024.03.12-support-linux-kernel-4.14.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: OpenELA Announces kernel-lts Project in Support of Linux Kernel 4.14
Author: OpenELA Community
Date: March 12th, 2024
Date: 2024-03-12
aliases:
- /announcements/openela-announces-kernel-lts-project-in-support-of-linux-kernel-4.14
---
__Author:__ OpenELA Community \
__Date:__ March 12th, 2024

***As support from the larger open source community concludes, enterprise vendors team up to collaborate on long-term kernel maintenance***

Expand Down
9 changes: 9 additions & 0 deletions content/news/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: OpenELA News and Announcements
include_footer: true
sidebar: false
aliases:
- announcements/
---

Check out the latest announcements from OpenELA!
11 changes: 11 additions & 0 deletions content/news/first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: My First Blog
slug: my-first-blog
date: 2024-04-05
tags:
- engineering
- software
- upstream
---

stuff and things
5 changes: 4 additions & 1 deletion content/news/hello_world.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: CIQ, Oracle and SUSE Create Open Enterprise Linux Association for a Collaborative and Open Future

slug: hello_world
date: 2023-08-10
aliases:
- /announcements/hello_world
---

* New trade association brings together open source Enterprise Linux community
Expand Down
65 changes: 39 additions & 26 deletions hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
baseURL: http://OpenELA.org/
---
baseURL: https://openela.org/
languageCode: en-us
title: OpenELA
title: Open Enterprise Linux Association

module:
imports:
path: github.com/StefMa/hugo-fresh

disableKinds:
- taxonomy
- taxonomyTerm
outputs:
home:
- html
section:
- html
- rss
term:
- html

permalinks:
page:
news: /news/:year/:month/:slug/
section:
news: /news/

markup:
goldmark:
Expand All @@ -26,34 +38,36 @@ params:
# height: 28
font:
name: "Open Sans"
sizes: [400,600]
sizes: [400, 600]
hero:
title: Open Enterprise Linux Association
subtitle: OpenELA is a trade association of open source Enterprise Linux distribution developers
subtitle: |
OpenELA is a trade association of open source Enterprise Linux
distribution developers
buttontext: Read The Announcement
buttonlink: /news/hello_world
# Hero image (from static/images/___)
image: illustrations/hydrangea-hero.svg
clientlogos:
- logo: ciq
url: https://ciq.com
- logo: oracle
url: https://www.oracle.com
- logo: suse
url: https://www.suse.com
- logo: ciq
url: https://ciq.com
- logo: oracle
url: https://www.oracle.com
- logo: suse
url: https://www.suse.com
navbar:
- title: About
url: /about
- title: Join
url: /join
- title: Git/Main
url: https://github.com/orgs/openela-main/repositories
- title: FAQ
url: /faq
- title: Governance
url: https://github.com/openela/governance
- title: Announcements
url: /announcements
- title: About
url: /about
- title: Join
url: /join
- title: Git/Main
url: https://github.com/orgs/openela-main/repositories
- title: FAQ
url: /faq
- title: Governance
url: https://github.com/openela/governance
- title: News
url: /news
section3:
title: The Community Repository for Enterprise Linux Sources
subtitle: No subscriptions. No passwords. No barriers. Freeloaders welcome.
Expand Down Expand Up @@ -83,4 +97,3 @@ params:
title: ""
column3:
title: ""

40 changes: 40 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{ define "main" }}

{{ partial "navbar.html" . }}
{{ partial "navbar-clone.html" . }}


<section class="section is-medium">
<div class="container">
<div class="columns">
<div class="column is-centered-tablet-portrait">
<h1 class="title section-title">{{ .Title }}</h1>
<h5 class="subtitle is-5 is-muted">{{ .Params.Subtitle }}</h5>
<div class="divider"></div>
</div>
</div>

<div class="content">
{{ .Content }}
<ul>
<!-- Ranges through content/news/*.md -->
{{ $pages := where .Site.RegularPages "Type" "in" (slice "blog" "news" "announcement") }}
{{ range $pages.ByDate.Reverse }}
<li>
<a href="{{ .Permalink }}">{{if .Type }}<span class=postType>{{.Type}}</span>{{ end }}{{ .Title }}</a> (<em>{{ .Date.Format "January" }} {{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }}, {{ .Date.Format "2006" }}</em>)
</li>
{{ end }}
</ul>
</div>
</div>
</section>

{{ if .Params.include_footer }}
{{ partial "footer.html" . }}
{{ end }}

{{ if .Params.sidebar }}
{{ partial "single/sidebar.html" . }}
{{ end }}

{{ end }}
1 change: 1 addition & 0 deletions layouts/blog
45 changes: 45 additions & 0 deletions layouts/news/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{ define "main" }}

{{ partial "navbar.html" . }}
{{ partial "navbar-clone.html" . }}


<section class="section is-medium">
<div class="container">
<article>
<header>
<div class="columns">
<div class="column is-centered-tablet-portrait">
<h1 class="title section-title">{{ .Title }}</h1>
<h5 class="subtitle is-5 is-muted">{{ .Params.Subtitle }}</h5>
<h6><strong>Published on:</strong> {{ .Date.Format "January 2, 2006" }}</h6>
<h6><strong>Author:</strong> {{ default "The OpenELA Team" .Params.author }}</h6>
<div class="divider"></div>
</div>
</div>
</header>

<section>
<div class=content>
{{ .Content }}
</div>
</section>

<footer>
{{ if .Params.tags }}
<p>Tags:
{{ range .Params.tags }}
<a href="/tags/{{ . | urlize }}">{{ . }}</a>
{{ end }}
</p>
{{ end }}
</footer>
</article>
</div>
</section>

{{ partial "footer.html" . }}

{{ partial "single/sidebar.html" . }}

{{ end }}
11 changes: 11 additions & 0 deletions layouts/partials/meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ template "_internal/google_analytics.html" . }}
{{ if eq .Site.Params.openGraph true }}
{{ template "_internal/opengraph.html" . }}
{{ end }}
<meta name="description" content="{{ if .Params.summary }}{{ .Params.summary }}{{ else if .Site.Params.Description }}{{ .Site.Params.Description }}{{ else }}Hardcoded description; the author should update :){{ end }}" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
Loading

0 comments on commit a2ddd14

Please sign in to comment.