Skip to content

Commit

Permalink
Switch from Ruby+Middleman to Hugo (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
zofrex authored Sep 26, 2024
1 parent 8d22083 commit 4cefcc9
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 458 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/update-deps.yml

This file was deleted.

8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.bundle
.cache
.DS_Store
.sass-cache
build/
/public/
/resources/_gen/
/.hugo_build.lock
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

11 changes: 0 additions & 11 deletions Gemfile

This file was deleted.

126 changes: 0 additions & 126 deletions Gemfile.lock

This file was deleted.

11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,10 @@ Please note it is not a pre-requisite for contributing incidents to this repo to

### Requirements

* Ruby
* Bundler

Install the dependencies with:

```
bundle install
```
* [Hugo](https://gohugo.io)

### Running

```
bundle exec middleman serve
hugo serve
```
File renamed without changes.
51 changes: 0 additions & 51 deletions config.rb

This file was deleted.

1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disableKinds = ["taxonomy", "rss", "sitemap"]
15 changes: 7 additions & 8 deletions source/layouts/layout.liquid → layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@
gtag('config', 'UA-12922701-4');
</script>
<meta charset="utf-8">
<title>{% if current_page.data.title %}{{ current_page.data.title | escape }} || {% endif %}How Many Days Has It Been Since a JWT alg:none Vulnerability?</title>
{% stylesheet_link_tag styles %}
<title>How Many Days Has It Been Since a JWT alg:none Vulnerability?</title>
{{- $style := resources.Get "styles.scss" | css.Sass }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="@zofrex" />
<meta property="og:title" content="{% if current_page.data.title %}{{ current_page.data.title | escape }} || {% endif %} How Many Days Has It Been Since a JWT alg=none Vulnerability?" />
{% if_content_for description %}
<meta property="og:description" content="{% yield_content description escape %}" />
{% end_if_content_for %}
<meta property="og:title" content="How Many Days Has It Been Since a JWT alg:none Vulnerability?" />
<meta property="og:description" content="{{ block "description" . }}{{ end }}" />
</head>
<body>
<header>
<div class="top"><div class="inner">The more important statistic is that it has been {{ data.misc.russian_invasion_of_ukraine | since }} since Russia invaded Ukraine.</div></div>
<div class="top"><div class="inner">The more important statistic is that it has been {{ partial "since.html" .Site.Data.misc.russian_invasion_of_ukraine }} since Russia invaded Ukraine.</div></div>
<div class="bottom"><div class="inner">Ukraine needs our help and support. If you can, please <a href="https://www.forbes.com/sites/gabbyshacknai/2022/02/24/10-ways-to-help-the-people-of-ukraine-right-now/">donate</a>.</div></div>
</header>
<main>
{{ yield }}
{{ block "main" . }}{{ end }}
</main>
<footer>
<p class="attribution">made by <a href="https://www.zofrex.com">zofrex</a></p>
Expand Down
13 changes: 13 additions & 0 deletions layouts/_default/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- define "description" -}}
{{- $latest := partial "latest.html" . -}}
It has been {{ partial "since.html" $latest.date }} since the last alg:none JWT vulnerability.
{{- end -}}

{{ define "main" }}
{{ $latest := partial "latest.html" . }}

<h1>It has been <span class="since">{{ partial "since.html" $latest.date }}</span> since the last alg:none JWT vulnerability.</h1>

<p>{{ $latest.description | safe.HTML }}</p>

{{ end }}
3 changes: 3 additions & 0 deletions layouts/partials/latest.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ $sorted := sort .Site.Data.vulns "date" "desc" }}
{{ $latest := index $sorted 0 }}
{{ return $latest }}
8 changes: 8 additions & 0 deletions layouts/partials/since.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- $date := . | time -}}
{{- $duration := now.Sub $date -}}
{{- $days := div $duration.Hours 24 | math.Floor -}}
{{- if eq $days 1.0 -}}
1 day
{{- else -}}
{{ $days }} days
{{- end -}}
Loading

0 comments on commit 4cefcc9

Please sign in to comment.