Skip to content

Commit d45700d

Browse files
committed
Add initial scaffolding for website
Signed-off-by: lucperkins <[email protected]>
1 parent ed8936c commit d45700d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+17332
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[Makefile]
8+
indent_style = tab
9+
10+
[*.{html,js,json,md,sass,yaml}]
11+
indent_style = space
12+
indent_size = 2

netlify.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build]
2+
base = "website"
3+
publish = "public"
4+
command = "make production-build"
5+
6+
[build.environment]
7+
HUGO_VERSION = "0.55.0"
8+
9+
[context.deploy-preview]
10+
command = "make preview-build"
11+
12+
[context.branch-deploy]
13+
command = "make preview-build"

website/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Hugo-generated assets
2+
/public
3+
/resources

website/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
serve:
2+
hugo server \
3+
--buildDrafts \
4+
--buildFuture \
5+
--disableFastRender \
6+
--enableGitInfo
7+
8+
production-build:
9+
hugo \
10+
--enableGitInfo \
11+
--minify
12+
13+
preview-build:
14+
hugo \
15+
--baseURL $(DEPLOY_PRIME_URL) \
16+
--buildDrafts \
17+
--buildFuture \
18+
--enableGitInfo \
19+
--minify
20+

website/assets/js/app.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function navbarToggle() {
2+
const burger = $('.navbar-burger'),
3+
menu = $('.navbar-menu');
4+
5+
burger.click(function() {
6+
[burger, menu].forEach(function(elem) {
7+
elem.toggleClass('is-active');
8+
});
9+
});
10+
}
11+
12+
$(function() {
13+
navbarToggle();
14+
});

website/assets/sass/style.sass

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{ $fonts := site.Params.fonts }}
2+
{{ $fontSlice := (slice) }}
3+
{{ range $fonts }}
4+
{{ $fontSlice = $fontSlice | append (printf "%s:%s" (replace .name " " "+") (delimit .sizes ",")) }}
5+
{{ end }}
6+
{{ $fontsUrl := printf "https://fonts.googleapis.com/css?family=%s" (delimit $fontSlice "|") }}
7+
{{ $sansSerifFont := (index (where $fonts "type" "sans_serif") 0).name }}
8+
{{ $fontAwesomeVersion := site.Params.font_awesome_version }}
9+
{{ $fontAwesomeUrl := printf "https://use.fontawesome.com/releases/v%s/css/all.css" $fontAwesomeVersion }}
10+
11+
$sig-security-dark-blue: #4a6ca4
12+
$sig-security-light-blue: #85c2d2
13+
14+
@charset "utf-8"
15+
@import url({{ $fontsUrl }})
16+
@import url({{ $fontAwesomeUrl }})
17+
18+
@import "bulma/sass/utilities/initial-variables"
19+
@import "bulma/sass/utilities/functions"
20+
21+
$family-sans-serif: '{{ $sansSerifFont }}', sans-serif
22+
$primary: $sig-security-dark-blue
23+
24+
@import "bulma/sass/utilities/derived-variables"
25+
@import "bulma/bulma"
26+
27+
.page
28+
display: flex
29+
flex-direction: column
30+
min-height: 100vh
31+
32+
.main
33+
flex: 1

website/config.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title = "SIG Security Events"
2+
disableKinds = ["section", "taxonomy", "taxonomyTerm"]
3+
4+
[params]
5+
font_awesome_version = "5.10.1"
6+
7+
[params.logos]
8+
navbar = "sig-security-horizontal-color.png"
9+
10+
[[params.fonts]]
11+
name = "PT Sans"
12+
sizes = [300, 400, 600, 700]
13+
type = "sans_serif"

website/content/.gitkeep

Whitespace-only changes.

website/layouts/_default/baseof.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>{{ block "title" . }}{{ site.Title }}{{ end }}</title>
5+
{{ partial "css.html" . }}
6+
</head>
7+
<body class="page has-navbar-fixed-top">
8+
<main class="main">
9+
{{ partial "navbar.html" . }}
10+
11+
{{ block "main" . }}
12+
{{ end }}
13+
</main>
14+
15+
{{ partial "footer.html" . }}
16+
{{ partial "javascript.html" . }}
17+
</body>
18+
</html>

website/layouts/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{ define "main" }}
2+
{{ partial "home/hero.html" . }}
3+
{{ end }}

website/layouts/partials/css.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{ $inServerMode := site.IsServer }}
2+
{{ $sass := "sass/style.sass" }}
3+
{{ $target := "css/style.css" }}
4+
{{ $includes := (slice "node_modules") }}
5+
{{ $cssDevOpts := (dict "targetPath" $target "includePaths" $includes "enableSourceMap" true) }}
6+
{{ $cssProdOpts := (dict "targetPath" $target "includePaths" $includes "outputStyle" "compressed") }}
7+
{{ $cssOpts := cond $inServerMode $cssDevOpts $cssProdOpts }}
8+
{{ $css := resources.Get $sass | resources.ExecuteAsTemplate $sass . | toCSS $cssOpts }}
9+
{{ if $inServerMode }}
10+
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
11+
{{ else }}
12+
{{ $prodCss := $css | fingerprint }}
13+
<link rel="stylesheet" href="{{ $prodCss.RelPermalink }}" integrity="{{ $prodCss.Data.Integrity }}">
14+
{{ end }}

website/layouts/partials/footer.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<footer class="footer has-background-dark">
2+
3+
</footer>
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ $title := site.Title }}
2+
<section class="hero is-light">
3+
<div class="hero-body">
4+
<div class="container">
5+
<p class="title is-size-1 is-size-2-mobile has-text-weight-light">
6+
{{ $title }}
7+
</p>
8+
</div>
9+
</div>
10+
</section>
+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{{ $.Scratch.Add "index" slice }}
2+
{{ range site.Pages }}
3+
{{ $.Scratch.Add "index" (dict "title" .Title "url" .Permalink "body" .Plain "summary" .Summary) }}
4+
{{ end }}
5+
{{ $idx := $.Scratch.Get "index" | jsonify }}
6+
<script src="https://unpkg.com/lunr/lunr.js"></script>
7+
<script src="https://code.jquery.com/jquery-3.4.0.min.js" integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg=" crossorigin="anonymous"></script>
8+
{{ $app := resources.Get "js/app.js" | fingerprint }}
9+
<script src="{{ $app.RelPermalink }}" integrity="{{ $app.Data.Integrity }}"></script>
10+
11+
<script>
12+
var searchBar = $('#search-bar'),
13+
searchDropdown = $('#search-dropdown'),
14+
searchMenu = $('#search-menu'),
15+
searchContent = $('#search-content');
16+
17+
var docs = JSON.parse('{{ $idx }}'),
18+
store = [],
19+
indexer = function() {
20+
this.ref('url');
21+
this.field('title', {boost:100});
22+
this.field('body');
23+
this.field('summary');
24+
25+
// Importance of document length
26+
this.b(0);
27+
28+
// How quickly a boost given by a common word reaches saturation
29+
this.k1(1.3);
30+
};
31+
32+
var idx = lunr(function() {
33+
this.use(indexer);
34+
docs.forEach(function(doc) {
35+
this.add(doc);
36+
37+
store[doc.url] = {
38+
'title': doc.title,
39+
'summary': doc.summary
40+
}
41+
}, this);
42+
});
43+
44+
searchBar.on('focusin', function() {
45+
searchBar.on('keyup', function() {
46+
const searchTerm = searchBar.val().toLowerCase();
47+
48+
if (searchTerm) {
49+
const finalSearchTerm = `${searchTerm}*`;
50+
const results = idx.search(finalSearchTerm);
51+
52+
if (results.length > 0) {
53+
searchMenu.show();
54+
55+
searchContent.empty();
56+
57+
var numAdded = 0;
58+
59+
results.forEach(function(res) {
60+
const url = res.ref,
61+
title = store[url].title,
62+
summary = store[url].summary;
63+
64+
const item = `
65+
<a class="dropdown-item" href="${url}">
66+
<p class="is-size-5 has-text-weight-medium">
67+
${title}
68+
</p>
69+
70+
<p>
71+
${summary.substring(0, 50)}...
72+
</p>
73+
</a>
74+
`
75+
76+
if (numAdded < 8) {
77+
searchContent.append(item);
78+
numAdded++;
79+
}
80+
});
81+
82+
searchContent.show();
83+
}
84+
} else {
85+
searchContent.hide();
86+
}
87+
});
88+
});
89+
90+
searchBar.on('focusout', function() {
91+
92+
});
93+
</script>

website/layouts/partials/navbar.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{ $home := site.BaseURL }}
2+
{{ $logo := printf "img/logos/%s" site.Params.logos.navbar | relURL }}
3+
<nav class="navbar is-light is-fixed-top">
4+
<div class="container">
5+
<div class="navbar-brand">
6+
<a class="navbar-item" href="{{ $home }}">
7+
<img src="{{ $logo }}">
8+
</a>
9+
10+
11+
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
12+
<span aria-hidden="true"></span>
13+
<span aria-hidden="true"></span>
14+
<span aria-hidden="true"></span>
15+
</a>
16+
</div>
17+
</div>
18+
</nav>

website/node_modules/.yarn-integrity

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)