Add fontawesome

This commit is contained in:
ItsDrike 2021-08-25 11:05:43 +02:00
parent 21f4356ff9
commit 753f8f0e1a
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD
5 changed files with 41 additions and 9 deletions

View file

@ -8,9 +8,16 @@ This is the source code for my personal portfolio, hosted on [my website](http:/
## Building the website
The website is built using [hugo](https://gohugo.io/), but you will also need `npm` for [Bootstrap SASS](https://getbootstrap.com/docs/5.0/customize/sass/).
The `npm` dependencies are listed in [`package.json`](./package.json) and can be installed simply by running `npm install`.
The website is built using [hugo](https://gohugo.io/), but you will also need `npm`.
`npm` is necessary for the ease of version control it provides for the packages we need. These include things such as:
- [Bootstrap SASS](https://getbootstrap.com/docs/5.0/customize/sass/)
- [Font Awesome (Free)](https://fontawesome.com/).
After all NPM requirements are satisfied, to build the static webpage, run [`./scripts/build.sh`](./scripts/build.sh), which will create a `./public` directory.
This directory will contain all static files and can be used as a location for the file server. You can also use [`./scripts/server.sh`](./scripts/server.sh), which
will start the server directly with hugo. By default, this will use `http://localhost:1313`.
All `npm` dependencies are listed in [`package.json`](./package.json) and can be installed simply by running `npm install`.
After all NPM requirements are satisfied, to build the static webpage and `hugo` is installed, run [`./scripts/build.sh`](./scripts/build.sh),
which will create a `./public` directory. This directory will contain all static files and can be used as a location for the file server.
You can then use any file server of your liking to make the webpage available, if you want to stick to hugo, you can also use
[`scripts/server.sh`](./scripts/server.sh), however using this can be a bit slower than using some other tools.
If using the script, it will start the server directly with hugo on `http://localhost:1313`.

View file

@ -5,6 +5,7 @@
<title>{{ partial "title-item.html" . }}{{ .Site.Title }}</title>
{{ partial "style.html" "scss/style.scss" }}
{{ partial "style.html" "css/highlight.css" }}
{{ partial "style.html" "css/font-awesome.css" }}
</head>
<body>
{{ block "main" . }}{{ end }}

15
package-lock.json generated
View file

@ -5,9 +5,19 @@
"packages": {
"": {
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"bootstrap": "^5.1.0"
}
},
"node_modules/@fortawesome/fontawesome-free": {
"version": "5.15.4",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz",
"integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg==",
"hasInstallScript": true,
"engines": {
"node": ">=6"
}
},
"node_modules/@popperjs/core": {
"version": "2.9.3",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.3.tgz",
@ -32,6 +42,11 @@
}
},
"dependencies": {
"@fortawesome/fontawesome-free": {
"version": "5.15.4",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz",
"integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg=="
},
"@popperjs/core": {
"version": "2.9.3",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.3.tgz",

View file

@ -1,5 +1,6 @@
{
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"bootstrap": "^5.1.0"
}
}

View file

@ -6,11 +6,19 @@ rm -rf "$OUTPUT_DIR"
mkdir -p "$STATIC_BUILD"
cp -r "$STATIC_SRC/img" "$STATIC_BUILD/img"
cp -r "$STATIC_SRC/js" "$STATIC_BUILD/js"
cp -r "$STATIC_SRC/css" "$STATIC_BUILD/css"
cp -r "$STATIC_SRC/scss" "$STATIC_BUILD/scss"
mkdir -p "$STATIC_SRC/img"
cp -r "$STATIC_SRC/img/*" "$STATIC_BUILD/img"
mkdir -p "$STATIC_SRC/js"
cp -r "$STATIC_SRC/js/*" "$STATIC_BUILD/js"
mkdir -p "$STATIC_SRC/css"
cp -r "$STATIC_SRC/css/*" "$STATIC_BUILD/css"
cp -r "$BASEDIR/node_modules/@fortawesome/fontawesome-free/css/all.min.css" "$STATIC_BUILD/css/font-awesome.css"
hugo gen chromastyles --style=monokai > "$STATIC_BUILD/css/highlight.css"
mkdir -p "$STATIC_SRC/scss"
cp -r "$STATIC_SRC/scss/*" "$STATIC_BUILD/scss"
hugo -vDEF --gc $@