mirror of
https://github.com/andwati/andwati.com.git
synced 2026-11-29 11:48:48 +00:00
polishing
This commit is contained in:
@@ -27,7 +27,7 @@ Mostly random stuff and a few tutorials. I'll see where this goes.Although some
|
|||||||
I use hugo as a static site generator.After trying a couple of blogging platforms and trying to build a few from scratch I decided to
|
I use hugo as a static site generator.After trying a couple of blogging platforms and trying to build a few from scratch I decided to
|
||||||
throw in the towel and opt in for a ready made solution, no need reinventing the wheel.
|
throw in the towel and opt in for a ready made solution, no need reinventing the wheel.
|
||||||
|
|
||||||
Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.Hugo provides a robust theming system that is easy to implement but capable of producing even the most complicated websites.Hugo's Go-based templating provides just the right amount of logic to build anything from the simple to complex. For this site I decided to go with the [even theme](https://github.com/olOwOlo/hugo-theme-even). The commenting system is implemented using [Utterances](https://utteranc.es/)
|
Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.Hugo provides a robust theming system that is easy to implement but capable of producing even the most complicated websites.Hugo's Go-based templates provide just the right amount of logic to build anything from the simple to complex. For this site I decided to go with the [even theme](https://github.com/olOwOlo/hugo-theme-even). The commenting system is implemented using [Utterances](https://utteranc.es/)
|
||||||
|
|
||||||
# Blog site hosting
|
# Blog site hosting
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ Now with all that fluff out of the way, let's get to business. The steps have be
|
|||||||
|
|
||||||
## Step 1: Installing the PostgreSQL Package
|
## Step 1: Installing the PostgreSQL Package
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ sudo pacman -Syu postgresql
|
$ sudo pacman -Syu postgresql
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -60,13 +60,13 @@ You can switch to the PostgreSQL user by executing the following command:
|
|||||||
|
|
||||||
- If you have sudo and are in sudoers
|
- If you have sudo and are in sudoers
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ sudo -iu postgres
|
$ sudo -iu postgres
|
||||||
```
|
```
|
||||||
|
|
||||||
- Otherwise using su:
|
- Otherwise using su:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ su
|
$ su
|
||||||
# su -l postgres
|
# su -l postgres
|
||||||
```
|
```
|
||||||
@@ -77,20 +77,20 @@ Before PostgreSQL can function correctly, the database cluster must be initializ
|
|||||||
|
|
||||||
### 2.1 We can confirm the installed PostgreSQL version by running:
|
### 2.1 We can confirm the installed PostgreSQL version by running:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ postgres --version ─╯
|
$ postgres --version ─╯
|
||||||
postgres (PostgreSQL) 15.1
|
postgres (PostgreSQL) 15.1
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2.2 Set applicable entries in **/etc/locale.gen**
|
### 2.2 Set applicable entries in **/etc/locale.gen**
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ echo "en_US.UTF-8 UTF-8" | sudo tee /etc/locale.gen
|
$ echo "en_US.UTF-8 UTF-8" | sudo tee /etc/locale.gen
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2.3 Then run **\*\*locale-gen\*\*** to generate locale settings
|
### 2.3 Then run **\*\*locale-gen\*\*** to generate locale settings
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ sudo locale-gen
|
$ sudo locale-gen
|
||||||
Generating locales...
|
Generating locales...
|
||||||
en_US.UTF-8... done
|
en_US.UTF-8... done
|
||||||
@@ -101,7 +101,7 @@ Generation complete.
|
|||||||
|
|
||||||
You must first log in as the **postgres** user using the following command before you can initialize PostgreSQL’s data directory:
|
You must first log in as the **postgres** user using the following command before you can initialize PostgreSQL’s data directory:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
sudo su - postgres
|
sudo su - postgres
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ sudo su - postgres
|
|||||||
|
|
||||||
### 3.1 Check PostgreSQL status with the following command:
|
### 3.1 Check PostgreSQL status with the following command:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ systemctl status postgresql ─╯
|
$ systemctl status postgresql ─╯
|
||||||
postgresql.service - PostgreSQL database server
|
postgresql.service - PostgreSQL database server
|
||||||
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; preset: disabled)
|
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; preset: disabled)
|
||||||
@@ -124,19 +124,19 @@ $ systemctl status postgresql
|
|||||||
|
|
||||||
### 3.2 Start the PostgreSQL service by running the following command:
|
### 3.2 Start the PostgreSQL service by running the following command:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
sudo systemctl start postgresql
|
sudo systemctl start postgresql
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.3 Enable the PostgreSQL service to start automatically at boot by running the following command:
|
### 3.3 Enable the PostgreSQL service to start automatically at boot by running the following command:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ sudo systemctl enable postgresql
|
$ sudo systemctl enable postgresql
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.4 Verify that PostgreSQL is running by running the following command:
|
### 3.4 Verify that PostgreSQL is running by running the following command:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
$ sudo systemctl status postgresql ─╯
|
$ sudo systemctl status postgresql ─╯
|
||||||
● postgresql.service - PostgreSQL database server
|
● postgresql.service - PostgreSQL database server
|
||||||
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: disabled)
|
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: disabled)
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ Access-Control-Allow-Origin: *
|
|||||||
|
|
||||||
# How browsers handle Subresource Integrity
|
# How browsers handle Subresource Integrity
|
||||||
|
|
||||||
Web browsers employ several mechanisms to handle Subresource Integrity (SRI). When a <script> or <link> element with an integrity attribute is encountered by the browser, it compares the script or stylesheet to the expected hash given in the integrity value before executing the script or applying the stylesheet.
|
Web browsers employ several mechanisms to handle Subresource Integrity (SRI). When a **script** or **link** element with an integrity attribute is encountered by the browser, it compares the script or stylesheet to the expected hash given in the integrity value before executing the script or applying the stylesheet.
|
||||||
|
|
||||||
For resources served from a different domain than the document in which it's embedded, the browser also checks the resource using Cross-Origin Resource Sharing (CORS) to ensure that the origin serving the resource allows it to be shared with the requesting domain. This additional check is important for preventing unauthorized access to sensitive resources.
|
For resources served from a different domain than the document in which it's embedded, the browser also checks the resource using Cross-Origin Resource Sharing (CORS) to ensure that the origin serving the resource allows it to be shared with the requesting domain. This additional check is important for preventing unauthorized access to sensitive resources.
|
||||||
|
|
||||||
@@ -113,9 +113,9 @@ If the script or stylesheet fails to match its associated integrity value, the b
|
|||||||
|
|
||||||
# References
|
# References
|
||||||
|
|
||||||
- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
|
- [https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)
|
||||||
- https://www.srihash.org/
|
- [https://www.srihash.org/](https://www.srihash.org/)
|
||||||
- https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
|
- [https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
|
||||||
- https://html.spec.whatwg.org/multipage/semantics.html#attr-script-integrity
|
- [https://html.spec.whatwg.org/multipage/semantics.html#attr-script-integrity](https://html.spec.whatwg.org/multipage/semantics.html#attr-script-integrity)
|
||||||
- https://html.spec.whatwg.org/multipage/semantics.html#attr-link-integrity
|
- [https://html.spec.whatwg.org/multipage/semantics.html#attr-link-integrity](https://html.spec.whatwg.org/multipage/semantics.html#attr-link-integrity)
|
||||||
- https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute
|
- [https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute](https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute)
|
||||||
@@ -8,5 +8,9 @@
|
|||||||
⬡
|
⬡
|
||||||
<a href="/contact">Contact</a>
|
<a href="/contact">Contact</a>
|
||||||
</nav>
|
</nav>
|
||||||
<p>© 2022 - {{ now() | date(format="Y") }} Ian Andwati.</p>
|
<p>
|
||||||
|
© 2022 -
|
||||||
|
{{ now() | date(format="%Y") }}
|
||||||
|
Ian Andwati.
|
||||||
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,5 @@
|
|||||||
{% extends "page.html" %}
|
{% extends "page.html" %}
|
||||||
{% import "post_macros.html" as post_macros %}
|
{% import "post_macros.html" as page_macros %}
|
||||||
{% block meta %}
|
{% block meta %}
|
||||||
<meta name="description" content="{{ page.description }}" />
|
<meta name="description" content="{{ page.description }}" />
|
||||||
<meta property="og:site_name" content="andwati.com" />
|
<meta property="og:site_name" content="andwati.com" />
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
<article id="content">
|
<article id="content">
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
|
{{ page_macros::meta(page=page) }}
|
||||||
</header>
|
</header>
|
||||||
{{ page.content | safe }}
|
{{ page.content | safe }}
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% macro meta(page) %}
|
{% macro meta(page) %}
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
<time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time>
|
<time datetime="{{ page.date }}">{{ page.date | date(format="%B %d,%Y") }}</time>
|
||||||
{% if page.taxonomies.tags %}
|
{% if page.taxonomies.tags %}
|
||||||
<span class="accent">⬡</span>
|
<span class="accent">⬡</span>
|
||||||
{% for tag in page.taxonomies.tags %}
|
{% for tag in page.taxonomies.tags %}
|
||||||
@@ -18,7 +18,8 @@
|
|||||||
{{ self::meta(page=page) }}
|
{{ self::meta(page=page) }}
|
||||||
{% if page.summary %}{{ page.summary | safe }}{% endif %}
|
{% if page.summary %}{{ page.summary | safe }}{% endif %}
|
||||||
<nav>
|
<nav>
|
||||||
<a href="{{ page.permalink }}">Read More</a>
|
<a href="{{ page.permalink }}">Read More →</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
%d%
|
||||||
</article>
|
</article>
|
||||||
{% endmacro snippet %}
|
{% endmacro snippet %}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% extends "section.html" %}
|
{% extends "section.html" %}
|
||||||
{% import "post_macros.html" as post_macros %}
|
{% import "post_macros.html" as post_macros %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main class="content">
|
<main id="content">
|
||||||
<header>
|
<header>
|
||||||
<h1>Posts</h1>
|
<h1>Posts</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in New Issue
Block a user