-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various changes around developer experience
* 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 * support multiple types of content to list on /news/ page * rename /announcements/ to /news/ * setup redirects for all existing pages that would be affected Signed-off-by: Neil Hanlon <[email protected]>
- Loading branch information
1 parent
154c740
commit 614104f
Showing
18 changed files
with
251 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ hugo.exe | |
hugo.linux | ||
hugo.darwin | ||
|
||
.bin/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
--- | ||
title: "{{ replace .Name "-" " " | title }}" | ||
title: {{ replace .Name "-" " " | title }} | ||
slug: {{ .Name }} | ||
date: {{ .Date }} | ||
author: YOUR NAME HERE | ||
draft: true | ||
--- | ||
|
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
news |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,41 @@ | ||
### Mac Instructions (M1) | ||
# openela.org website | ||
|
||
The openela.org website is managed using `Hugo`. You can install it using your favorite package manager. | ||
|
||
## Setup | ||
|
||
Ensure you have the "Extended" version of Hugo, which includes features required by this repository. | ||
|
||
### Linux | ||
|
||
Hugo is available in many package managers (but not EPEL, yet). Downloading the latest release binary from github is an easy option. | ||
|
||
### Mac | ||
|
||
**Prerequisites** | ||
`brew install go` | ||
`brew install hugo` | ||
`brew install sass/sass/sass` | ||
|
||
**Build** | ||
`hugo` | ||
## Building locally | ||
|
||
To build the static site to the `public/` folder (i.e., for release) run `hugo`. | ||
|
||
To run hugo in server mode and view the site in real time on your computer as you make updates, run `hugo server` | ||
|
||
By default this will run the service locally on http://localhost:1313/ | ||
|
||
## Adding Content | ||
|
||
To add new content to the site, decide what type of content it is (announcement, blog, news), and run | ||
|
||
``` | ||
hugo new content content/<type>/Post-Title-Separated-By-Dashes.md | ||
``` | ||
|
||
For example, to create a new Blog post titled "My First Blog" with the url /blog/my-first-blog, you'd run | ||
|
||
**Run Locally** | ||
`hugo server` | ||
``` | ||
hugo new content content/blog/my-first-blog.md | ||
``` | ||
|
||
By default this will run the service locally on http://localhost:1313/ | ||
Then, open the file and edit as required. Make sure to set the post to *not* be a draft before publishing it. |
Oops, something went wrong.