Skip to content

Commit

Permalink
Add GH pages publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
lauft committed May 4, 2024
1 parent 8cffb4b commit 2f34827
Show file tree
Hide file tree
Showing 22 changed files with 132 additions and 56 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Deploy GBF site to GitHub 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.124.1
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
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- 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 \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./html

# 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@v4
2 changes: 1 addition & 1 deletion content/anomaly/latest.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: plain
aliases:
- /latest/anomaly
- latest/anomaly
---
{{< latest_version anomaly >}}
2 changes: 1 addition & 1 deletion content/clog/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Clog is a colorized log tail utility.
Clog can spot patterns in an input stream and colorize or suppress the lines.
It can also decorate the lines with time- or date-stamps.

Visit the [Clog documentation home](/clog/docs) for full details.
Visit the [Clog documentation home](clog/docs) for full details.
28 changes: 14 additions & 14 deletions content/clog/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ menu: main

## Getting Started

- [What is Clog?](what)
- [How does Clog work?](how)
- [Download and build the tarball](download)
- [Clone the code repository and build the development snapshot](clone)
- [What is Clog?](clog/docs/what)
- [How does Clog work?](clog/docs/how)
- [Download and build the tarball](clog/docs/download)
- [Clone the code repository and build the development snapshot](clog/docs/clone)

## Usage

- [Getting Help](help)
- [Setup](setup)
- [Rule Syntax](syntax)
- [Rule Sections](sections)
- [Rule Patterns](patterns)
- [Rule Actions](actions)
- [Clog Options](options)
- [Color](color)
- [Getting Help](clog/docs/help)
- [Setup](clog/docs/setup)
- [Rule Syntax](clog/docs/syntax)
- [Rule Sections](clog/docs/sections)
- [Rule Patterns](clog/docs/patterns)
- [Rule Actions](clog/docs/actions)
- [Clog Options](clog/docs/options)
- [Color](clog/docs/color)

## Example Rule Sets

- [Syslog](example_syslog)
- [Apache](example_apache)
- [Syslog](clog/docs/example_syslog)
- [Apache](clog/docs/example_apache)
6 changes: 3 additions & 3 deletions content/clog/docs/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ The second rule colors the word \'red\' red.
The third puts blank lines around any line containing the word \'emphasize\'.
The fourth rule suppresses any line containing the word \'ignore\'.

![](/img/clog/action1.png)
![](img/clog/action1.png)

Here is a sample file that triggers every rule, so we should see the actions of all rules taken.
Can you predict what will happen?

![](/img/clog/action2.png)
![](img/clog/action2.png)

Here is the output:

![](/img/clog/action3.png)
![](img/clog/action3.png)

This shows rules precedence also - the second rule finds the word \'red\' in the blue line.
10 changes: 5 additions & 5 deletions content/clog/docs/color.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ black, red, blue, green, magenta, cyan, yellow, white

Shown here used as foreground and background colors:

![](/img/clog/color1.png)
![](img/clog/color1.png)

Foreground color (for text) is simply specified as one of the above colors, or not specified at all to use the default terminal text color.

Expand All @@ -45,7 +45,7 @@ green on yellow
on yellow
```

![](/img/clog/color2.png)
![](img/clog/color2.png)

These colors can be modified further, by making the foreground `bold`, or by making the background `bright`.
Some examples:
Expand Down Expand Up @@ -98,14 +98,14 @@ color2
color255
```

![](/img/clog/color3.png)
![](img/clog/color3.png)

This gives you access to all 256 colors, but doesn\'t help you much.
This range is a combination of 8 basic colors (color0 - color7), then 8 brighter variations (color8 - color15).
Then a block of 216 colors (color16 - color231).
Then a block of 24 gray colors (color232 - color255).

![](/img/clog/color4.png)
![](img/clog/color4.png)

The large block of 216 colors (6x6x6 = 216) represents a color cube, which can be addressed via RGB values from 0 to 5 for each component color.
A value of 0 means none of this component color, and a value of 5 means the most intense component color.
Expand Down Expand Up @@ -148,7 +148,7 @@ All colors in the 6th square have a red value of 5.
Within each square, blue ranges from 0 to 5 left to right, and within each square green ranges from 0 to 5, top to bottom.
This scheme takes some getting used to.

![](/img/clog/color5.png)
![](img/clog/color5.png)

The block of 24 gray colors can also be accessed as gray0 - gray23, in a continuous ramp from black to white.

Expand Down
2 changes: 1 addition & 1 deletion content/clog/docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ $ sudo make install

## Submitting a Patch

[See here for details](/clog/docs/clone/#submitting-a-patch).
[See here for details](clog/docs/clone/#submitting-a-patch).
2 changes: 1 addition & 1 deletion content/clog/docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ There are three source of help for Clog:
- Man page: `$ man clog`
- Online help that you are reading now

The recommendation is that you go to the [Online Documentation](/clog/docs) and read all of it, in order.
The recommendation is that you go to the [Online Documentation](clog/docs) and read all of it, in order.
This will give you the most thorough explanation of what Clog does.

The online documentation will likely always be more complete and correct, and will be updated between releases.
Expand Down
10 changes: 5 additions & 5 deletions content/clog/docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ You can use this option to select from several different rule files.
When the `--date` option is specified, the current date in the form `YYYY-MM-DD` is written before every line.
Using this rule set:

![](/img/clog/option1.png)
![](img/clog/option1.png)

Then applying it to this sample input (which contains no matches):

![](/img/clog/option2.png)
![](img/clog/option2.png)

This is the result:

![](/img/clog/option3.png)
![](img/clog/option3.png)

## The `--time` Option

Similarly, when the `--time` option is used, the current time, in the form `HH:MM:SS` is written before every line.
Here is an example:

![](/img/clog/option4.png)
![](img/clog/option4.png)

Note that both `--date` and `--time` can be specified, yielding a complete timestamp:

![](/img/clog/option5.png)
![](img/clog/option5.png)
6 changes: 3 additions & 3 deletions content/clog/docs/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: "Clog - Rule Patterns"
Rules apply when their pattern matches the input, then the actions are performed.
Here is an example:

![](/img/clog/pattern1.png)
![](img/clog/pattern1.png)

When the pattern is quoted as above, `"blue"`, then the pattern is interpreted as a direct match, character-for-character.
This means the input must contain exactly `blue` for a match.
Expand All @@ -19,12 +19,12 @@ This example will likely just run slower.
But regular expressions have capabilities that go beyond simple patterns.
Here is an example that allows for capitalization of the color names:

![](/img/clog/pattern2.png)
![](img/clog/pattern2.png)

Here is a regular expression that makes sure that the word \'blue\' is a complete word, and not merely part of a bigger word.
It does this by requiring that the \'b\' is preceded by a wo└d boundary, and the \'e\' is followed by a word boundary:

![](/img/clog/pattern3.png)
![](img/clog/pattern3.png)

Note that regular expression can become arbitrarily complex, and correspondingly slow.
If you can use a simple pattern, it is recommended for performance reasons.
Expand Down
6 changes: 3 additions & 3 deletions content/clog/docs/sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ If a rules belongs to the `default` section, then it applies when no section is

Here is an example rule file, containing two rules:

![](/img/clog/section1.png)
![](img/clog/section1.png)

The first rule is in the \'`default`\' section, and looks for the word \'red\', and colors it red.
The second rule is in the \'`special`\' section, and also looks for the word \'red\', and colors it as white on a red background.

Without the difference in sections, these rules conflict.
Here is a demonstration of these rules being used:

![](/img/clog/section2.png)
![](img/clog/section2.png)

Clog is invoked four times.
In the first command, no section is specified, so the \'`default`\' section is used, and you can see that the word \'red\' in the input is colored red.
Expand All @@ -34,4 +34,4 @@ Both rules apply, but because the \'`special`\' section is specified *last*, it

When the order of sections is reversed, the other rule has precedence.

![](/img/clog/section3.png)
![](img/clog/section3.png)
2 changes: 1 addition & 1 deletion content/clog/docs/what.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This rule is in the \'something\' section, the pattern is \'severe\', and the ac
Pattern \'severe\' should probably be more restrictive, because it will also match words like \'persevered\', but that is optional.

Full 16- and 256-color support is included, for the colorization of the log entries.
See [Color Specification](/clog/docs/color) for full details.
See [Color Specification](clog/docs/color) for full details.

Instead of coloring the whole line, specifying \'match\' instead will only color the parts of the line that match.

Expand Down
2 changes: 1 addition & 1 deletion content/clog/latest.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: plain
aliases:
- /latest/clog
- latest/clog
---
{{< latest_version clog >}}
6 changes: 3 additions & 3 deletions content/task/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ It maintains a task list, allowing you to add/remove, and otherwise manipulate y
Taskwarrior has a rich set of subcommands that allow you to do sophisticated things.
You'll find it has customizable reports, charts, GTD features, device syncing, documentation, extensions, themes, holiday files and much more.

* [Performance Testing](/task/performance)
* [Talks](talks) given at UBUCON
* [Performance Testing](task/performance)
* [Talks](task/talks) given at UBUCON
* [RFCs](https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/doc/devel/rfcs/)
* [What is the latest version?](/task/latest)
* [What is the latest version?](task/latest)
* [Future plans](https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/doc/devel/rfcs/plans.md)
* [Download](https://taskwarrior.org/download)

Expand Down
4 changes: 2 additions & 2 deletions content/task/latest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: plain
aliases:
- /latest/task
- /task/latest
- latest/task
- task/latest
---
{{< latest_version task >}}
4 changes: 2 additions & 2 deletions content/taskd/latest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: plain
aliases:
- /latest/taskd
- /taskd/latest
- latest/taskd
- taskd/latest
---
{{< latest_version taskd >}}
4 changes: 2 additions & 2 deletions content/tasksh/latest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: plain
aliases:
- /latest/tasksh
- /tasksh/latest
- latest/tasksh
- tasksh/latest
---
{{< latest_version tasksh >}}
4 changes: 2 additions & 2 deletions content/timew/latest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: plain
aliases:
- /latest/timew
- /timew/latest
- latest/timew
- timew/latest
---
{{< latest_version timew >}}
2 changes: 1 addition & 1 deletion content/vramsteg/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ If a program has a lengthy iterative operation, it may benefit from using vramst

## Command Usage

![Vramsteg command usage](/img/vramsteg.png)
![Vramsteg command usage](img/vramsteg.png)
2 changes: 1 addition & 1 deletion themes/bootstrap/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<div class="footer-item">
<p class="text-muted">
Copyright &copy; {{ now.Year }} <a href="https://github.com/GothenburgBitFactory">Göteborg Bit Factory</a>
Copyright &copy; {{ now.Year }} <a href="https://github.com/GothenburgBitFactory">Gothenburg Bit Factory</a>
</p>
<p class="text-muted">
Powered by <a href="https://gohugo.io">Hugo</a>
Expand Down
8 changes: 5 additions & 3 deletions themes/bootstrap/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<link rel="alternate" href="/index.xml" type="application/rss+xml" title="{{ .Site.Title }}">
<link rel="icon" href="{{ $baseUrl }}/favicon.ico">
<title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
<base href="{{ .Site.BaseURL }}">
<link rel="stylesheet" href="{{ $baseUrl }}/css/highlight/{{ with .Site.Params.highlightStyle }}{{ . }}{{ else }}default{{ end }}.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ $baseUrl }}/css/bootstrap-theme.min.css">
Expand All @@ -27,14 +28,15 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ $baseUrl }}/">{{ .Site.Title }}</a>
<a class="navbar-brand" href="{{ $baseUrl }}">{{ .Site.Title }}</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{{ $currentDir := split (trim .RelPermalink "/") "/" }}
{{ $deployDir := (split $baseUrl "/") | after 3 }}
{{ $currentDir := complement $deployDir (split (trim .RelPermalink "/") "/") }}
{{ with .Site.Menus.main }}
{{ range $menu := . }}
{{ $baseDir := split (trim .URL "/") "/" }}
{{ $baseDir := complement $deployDir (split (trim .URL "/") "/") }}
{{ if intersect $currentDir $baseDir }}
<li{{ if eq $currentDir $baseDir }} class="active"{{ end }}><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
Expand Down
Loading

0 comments on commit 2f34827

Please sign in to comment.