Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit b2d8242

Browse files
committed
initial commit, empty blog
0 parents  commit b2d8242

19 files changed

+234
-0
lines changed

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 3
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+

.github/workflows/main.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
env:
8+
APP: nais-blog
9+
TEAM: plattformsikkerhet
10+
IMAGE: docker.pkg.github.com/${{ github.repository }}/nais-blog:${{ github.sha }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v1
19+
- name: run hugo build
20+
uses: klakegg/[email protected]
21+
- name: build docker image
22+
run: docker build . --pull -t ${{ env.IMAGE }}
23+
- name: push docker image
24+
run: |
25+
echo "$GITHUB_TOKEN" | docker login --username "$GITHUB_REPOSITORY" --password-stdin https://docker.pkg.github.com
26+
docker push ${{ env.IMAGE }}
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
deploy-dev-gcp:
31+
name: Deploy to dev-gcp
32+
needs: build
33+
if: "github.ref == 'refs/heads/main'"
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v1
37+
- uses: nais/deploy/actions/deploy@v1
38+
env:
39+
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
40+
CLUSTER: dev-gcp
41+
RESOURCE: .nais/nais.yml
42+
VARS: .nais/dev.yml

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
public/
2+
.DS_Store

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "themes/hugo-tailwind-journal"]
2+
path = themes/hugo-tailwind-journal
3+
url = https://github.com/ianrodrigues/hugo-tailwind-journal.git

.nais/dev.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ingresses:
2+
- https://nais-blog.dev.nav.no
3+

.nais/nais.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: nais.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: nais-blog
5+
namespace: plattformsikkerhet
6+
labels:
7+
team: plattformsikkerhet
8+
spec:
9+
image: {{ image }}
10+
port: 80
11+
replicas:
12+
min: 1
13+
max: 1
14+
cpuThresholdPercentage: 50
15+
liveness:
16+
path: /internal/isalive
17+
port: 8080
18+
initialDelay: 5
19+
periodSeconds: 5
20+
failureThreshold: 30
21+
readiness:
22+
path: /internal/isready
23+
port: 8080
24+
initialDelay: 5
25+
periodSeconds: 5
26+
failureThreshold: 30
27+
resources:
28+
limits:
29+
cpu: 500m
30+
memory: 512Mi
31+
requests:
32+
cpu: 200m
33+
memory: 256Mi
34+
tokenx:
35+
enabled: true
36+
37+
ingresses:
38+
{{#each ingresses as |url|}}
39+
- {{url}}
40+
{{/each}}

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @navikt/plattformsikkerhet

Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM nginx:alpine
2+
3+
LABEL MAINTAINER=navikt
4+
5+
COPY public/ /usr/share/nginx/html
6+
COPY nginx/headers.conf /etc/nginx/conf.d/
7+
COPY nginx/nais.conf /etc/nginx/conf.d/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 NAV IKT
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# nais-blog
2+
3+
Blog for the [platform](https://nais.io) team @ [NAV](https://nav.no)
4+
5+
## 🛠 Add content
6+
7+
Make sure you have [Hugo](https://gohugo.io) installed.
8+
* Run `hugo new posts/my-awesome-post/my-awesome-post.md` (or one of the other supported [formats](https://gohugo.io/content-management/formats/))
9+
* Edit your content , inspecting it as you go by running the live-reloading server `hugo server -D`. The `-D` parameter tells Hugo to also include drafts, all new content is marked as a draft by default.
10+
* When finished editing, mark the content as ready by setting the `draft` parameter to false in the front matter (the comment-like metadata section at the top).
11+
* Create a pull request in this repository. The content is automatically published when the pull request is merged.
12+
13+
## ⚖️ License
14+
15+
Licensed under the [MIT License](LICENSE)
16+
17+
## 👥 Contact
18+
19+
This project is currently maintained by the organisation [@nais](https://github.com/nais).
20+
21+
If you need to raise an issue or question about this code, please create an issue here and tag it with the appropriate label.
22+
23+
For contact requests within the [@nais](https://github.com/nais) org, you can use the slack channel #pig_sikkerhet
24+
25+
If you need to contact anyone directly, please see contributors.

archetypes/default.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
description: ""
4+
date: {{ .Date }}
5+
draft: true
6+
author: Unknown Author
7+
tags: []
8+
---

config.toml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
title = "Nais Blog"
2+
theme = "hugo-tailwind-journal"
3+
pygmentsCodeFences = true
4+
pygmentsUseClasses = true
5+
uglyurls = true
6+
7+
[taxonomies]
8+
tag = "tags"
9+
10+
[permalinks]
11+
posts = "/posts/:year/:month/:title/"
12+
13+
[params]
14+
author = "Nais-teamet"
15+
avatar = "images/nais-logo.png"
16+
description = "Løst og fast fra teamet bak nais.io"
17+
tagline = "Løst og fast fra teamet bak nais.io"
18+

layouts/_default/single.html

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{ define "heading" }}
2+
<div>
3+
{{ partial "back-home.html" . }}
4+
5+
<!-- Title and Publication Date -->
6+
<h1 class="text-4xl font-bold">{{ .Title }}</h1>
7+
<time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "02 Jan 2006" }}</time>
8+
({{ $.Param "author" }})
9+
10+
<!-- Tags -->
11+
{{ with .Params.tags }}
12+
<ol class="mt-4">
13+
{{ range . }}
14+
<li class="inline-block">
15+
<a class="border-none text-gray-800 text-xs bg-gray-400 hover:bg-gray-600 hover:text-white rounded-sm px-3 py-1" href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a>
16+
</li>
17+
{{ end }}
18+
</ol>
19+
{{ end }}
20+
</div>
21+
{{ end }}
22+
23+
{{ define "content" }}
24+
<article class="mb-12">
25+
{{ .Content }}
26+
</article>
27+
{{ end }}

nginx/headers.conf

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
add_header Content-Security-Policy "default-src 'self';";
2+
add_header Strict-Transport-Security max-age=3600;
3+
add_header X-XSS-Protection "1; mode=block";
4+
add_header X-Frame-Options DENY;
5+
add_header X-Content-Type-Options nosniff;
6+
7+
server_tokens off;

nginx/nais.conf

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
server {
2+
listen 8080;
3+
4+
location /internal/isalive {
5+
access_log off;
6+
return 200 "ALIVE\n";
7+
add_header Content-Type text/plain;
8+
}
9+
10+
location /internal/isready {
11+
access_log off;
12+
return 200 "READY\n";
13+
add_header Content-Type text/plain;
14+
}
15+
}

static/favicon.ico

1.12 KB
Binary file not shown.

static/images/nais-logo.png

16.2 KB
Loading

static/images/nav-logo.png

10.1 KB
Loading

themes/hugo-tailwind-journal

Submodule hugo-tailwind-journal added at 32cd3a6

0 commit comments

Comments
 (0)