Skip to content

Commit cb0b2ef

Browse files
authored
Merge pull request #22 from openandroidinstaller-dev/page-updates
Genaral website update/overhaul
2 parents 138be37 + 68aefa4 commit cb0b2ef

21 files changed

+762
-259
lines changed

.github/workflows/build-pr.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build website PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
types:
8+
- closed
9+
10+
concurrency:
11+
group: "builders"
12+
cancel-in-progress: true
13+
14+
jobs:
15+
if_merged:
16+
if: github.event.pull_request.merged == true
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
ref: main
23+
fetch-depth: 0
24+
- name: Install dependencies
25+
run: |
26+
curl -sSL https://install.python-poetry.org | python3 -
27+
make install
28+
- name: Build website
29+
run: make website
30+
- name: Commit files
31+
run: |
32+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
33+
git config --local user.name "github-actions[bot]"
34+
git commit -a -m "Built website"
35+
- name: Push changes
36+
uses: ad-m/github-push-action@master
37+
with:
38+
branch: main

.github/workflows/build.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build website
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- 'main'
9+
paths:
10+
- './templates/**'
11+
12+
concurrency:
13+
group: "builders"
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
ref: main
24+
fetch-depth: 0
25+
- name: Install dependencies
26+
run: |
27+
curl -sSL https://install.python-poetry.org | python3 -
28+
make install
29+
- name: Build website
30+
run: make website
31+
- name: Commit files
32+
run: |
33+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
34+
git config --local user.name "github-actions[bot]"
35+
git commit -a -m "Built website"
36+
- name: Push changes
37+
uses: ad-m/github-push-action@master
38+
with:
39+
branch: main

.github/workflows/pages.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ name: Deploy static content to Pages
33

44
on:
55
# Runs on pushes targeting the default branch
6-
push:
7-
branches: ["main"]
6+
#push:
7+
# branches: ["main"]
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
1111

12+
workflow_run:
13+
workflows:
14+
- Build website
15+
- Build website PR
16+
types:
17+
- completed
18+
1219
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1320
permissions:
1421
contents: read
@@ -29,14 +36,14 @@ jobs:
2936
runs-on: ubuntu-latest
3037
steps:
3138
- name: Checkout
32-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
3340
- name: Setup Pages
34-
uses: actions/configure-pages@v2
41+
uses: actions/configure-pages@v3
3542
- name: Upload artifact
3643
uses: actions/upload-pages-artifact@v1
3744
with:
3845
# Upload entire repository
39-
path: './public/'
46+
path: "./public/"
4047
- name: Deploy to GitHub Pages
4148
id: deployment
42-
uses: actions/deploy-pages@v1
49+
uses: actions/deploy-pages@v2

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
11
# Website for the OpenAndroidInstaller project
2+
3+
## Website build workflow
4+
5+
This website is made with Bulma and gets build to a static page via the Python tools `make`, `poetry` and `jinja2`.
6+
7+
To build the website follow the two following steps:
8+
9+
- Install the dependencies:
10+
11+
```
12+
make install
13+
```
14+
15+
- Build the website:
16+
17+
```
18+
make website
19+
```

build.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717
"imprint.html",
1818
"privacy.html",
1919
"feedback.html",
20+
"404.html",
2021
]
2122

2223
# Load template files and write the rendered HTML
2324
for page in pages:
2425
# render the templates
2526
template = env.get_template(page)
2627
output = template.render(
27-
version="v0.4.4-beta",
28-
n_supported_devices=62,
28+
version="v0.5.0-beta",
29+
n_supported_devices=73,
2930
)
3031

3132
# write to file

public/.htaccess

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
##START HTTP Security Header##
2+
3+
#Content Security Policy - CSP-HEADER
4+
Header set Content-Security-Policy "frame-ancestors 'self'; default-src 'none'; script-src 'self' plausible.io peertube.tv opencollective.com liberapay.com; script-src-attr 'none'; script-src-elem 'self'; object-src 'self' img.shields.io; img-src 'self' opencollective.com liberapay.com; media-src 'self'; connect-src 'self'; frame-src 'self' img.shields.io peertube.tv; form-action 'self'; base-uri 'self'; font-src 'self'; style-src 'self'; style-src-elem 'self'; style-src-attr 'self';"
5+
6+
#HTTP Content-Types
7+
AddCharset UTF-8 .html
8+
9+
#Public Key Pins
10+
Header set Public-Key-Pins "pin-sha256=\"base64+primary==\"; pin-sha256=\"base64+backup==\"; max-age=5184000; includeSubDomains"
11+
12+
#Strict-Transport-Security
13+
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
14+
15+
#X-Content-Type-Options
16+
Header always set X-Content-Type-Options "nosniff"
17+
18+
#X-Frame-Options
19+
Header always set X-Frame-Options "SAMEORIGIN"
20+
21+
#X-Xss-Protection
22+
Header always set X-Xss-Protection "1; mode=block"
23+
24+
#Referrer-Policy
25+
Header set Referrer-Policy "no-referrer, same-origin"
26+
27+
##END HTTP Security Header##
28+
29+
#HTTP Cache
30+
Header set Cache-Control "max-age=604800"
31+
# "max-age=604800" -> 1 Week
32+
# "max-age=2592000" -> 30 Days
33+
# "max-age=31536000" -> 1 Year
34+
35+
Error pages
36+
ErrorDocument 404 404.html
37+
38+
##START File Extensions##
39+
40+
RewriteEngine on
41+
42+
# Remove .html
43+
RewriteCond %{REQUEST_FILENAME} !-d
44+
RewriteCond %{REQUEST_FILENAME}\.html -f
45+
RewriteRule ^(.*)$ $1.html
46+
47+
##END File Extensions##
-70.5 KB
Binary file not shown.
-131 KB
Binary file not shown.
-112 KB
Binary file not shown.
-132 KB
Binary file not shown.

public/static/custom.css

+55
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,61 @@ html {
22
scroll-behavior: smooth;
33
}
44

5+
.px-6 ul {
6+
list-style: unset;
7+
}
8+
9+
.round {
10+
border-radius: 4px;
11+
}
12+
13+
.hover-transition {
14+
transition: ease-in 250ms;
15+
}
16+
17+
.hover-transition:hover {
18+
transition: ease-in 250ms;
19+
}
20+
21+
#pf-funding-logos {
22+
width: 333px;
23+
}
24+
25+
.pt-5 {
26+
border-top: 1px solid #dee2e6;
27+
}
28+
29+
#user {
30+
display: block;
31+
}
32+
33+
/*Donation options*/
34+
35+
#donate-widgets {
36+
margin: auto;
37+
margin-top: 10px;
38+
}
39+
40+
.opencollective,
41+
#gh-sponsors {
42+
display: flex !important;
43+
margin: auto !important;
44+
}
45+
46+
.liberapay {
47+
display: flex !important;
48+
width: 50% !important;
49+
margin-bottom: 10px;
50+
margin-left: 46.05px !important;
51+
}
52+
53+
.liberapay-nojs {
54+
display: flex;
55+
margin: auto;
56+
margin-top: -20px;
57+
margin-bottom: 10px;
58+
}
59+
560
/* Style the tab content */
661
.tabcontent {
762
display: none;
Binary file not shown.

templates/404.html

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{% extends "base.html" %}
2+
{% block title %}404 | OpenAndroidInstaller{% endblock %}
3+
{% block robot %}
4+
<meta name="robots" content="noindex,nofollow">
5+
<meta name="googlebot" content="noindex,nofollow">
6+
{% endblock %}
7+
{% block content %}
8+
<head>
9+
<link rel="stylesheet" href="/public/static/style.css">
10+
<link rel="stylesheet" href="/public/static/custom.css">
11+
</head>
12+
<!-- Header -->
13+
<section class="hero is-small">
14+
<div class="hero-body">
15+
<div class="container has-text-centered">
16+
<h1 class="is-size-1 is-size-3-mobile has-text-weight-bold">Error 404</h1>
17+
<p class="subtitle is-4">Oops! - The requested page does not exist or was not found.</p>
18+
</div>
19+
</div>
20+
</section>
21+
<!-- Header End -->
22+
23+
<section class="section">
24+
<div class="container is-max-desktop">
25+
<!-- Content -->
26+
<div class="content">
27+
<!-- Content End -->
28+
</div>
29+
</section>
30+
31+
<!-- Contribution Banner -->
32+
<section class="section has-background-primary">
33+
<div class="container">
34+
<div class="is-vcentered columns is-multiline">
35+
<div class="column is-6 is-5-desktop mb-4">
36+
<h2 class="has-text-white mt-2 mb-3 is-size-1 is-size-3-mobile has-text-weight-bold">You think something is wrong?
37+
</h2>
38+
</div>
39+
<div class="column is-5 ml-auto">
40+
<div class="mx-auto box p-6 has-background-light has-text-centered">
41+
<a class="button is-link is-fullwidth hover-transition" id="contribute-button"
42+
href="mailto:[email protected]">Write an e-mail</a>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
</section>
48+
<!-- Contribution Banner End -->
49+
{% endblock %}

0 commit comments

Comments
 (0)