This commit is contained in:
101
README.md
101
README.md
@@ -2,7 +2,12 @@
|
||||
|
||||
This repository hosts my personal website and project portfolio.
|
||||
|
||||
The site is built with [Hugo](https://gohugo.io/), a fast static site generator, and is intended to showcase my work, projects, background, and selected professional information in a simple and maintainable format.
|
||||
The site is built with [Hugo](https://gohugo.io/), and this repository now includes a minimal custom Hugo setup with:
|
||||
|
||||
- a homepage
|
||||
- a projects section
|
||||
- reusable layouts
|
||||
- custom styling without an external theme
|
||||
|
||||
## Purpose
|
||||
|
||||
@@ -61,7 +66,7 @@ The generated files will be placed in the `public/` directory.
|
||||
|
||||
## Project Structure
|
||||
|
||||
Typical Hugo projects use a structure similar to the following:
|
||||
This repository currently follows a structure similar to the following:
|
||||
|
||||
```text
|
||||
.
|
||||
@@ -70,12 +75,11 @@ Typical Hugo projects use a structure similar to the following:
|
||||
├── content/
|
||||
├── layouts/
|
||||
├── static/
|
||||
├── themes/
|
||||
├── config.toml
|
||||
├── hugo.toml
|
||||
└── README.md
|
||||
```
|
||||
|
||||
Depending on the Hugo version and configuration style, the main config file may also be named `hugo.toml`, `hugo.yaml`, or `hugo.json`.
|
||||
Depending on the Hugo configuration style, the main config file may also be named `config.toml`, `hugo.yaml`, or `hugo.json` in other projects.
|
||||
|
||||
## Content Management
|
||||
|
||||
@@ -86,6 +90,23 @@ Portfolio content is generally managed through the `content/` directory. Typical
|
||||
- updating images and downloadable assets in `static/`
|
||||
- adjusting layouts and partials in `layouts/`
|
||||
|
||||
The current starter content is in:
|
||||
|
||||
- `content/_index.md`
|
||||
- `content/projects/_index.md`
|
||||
- `content/projects/*.md`
|
||||
|
||||
The current templates are in:
|
||||
|
||||
- `layouts/index.html`
|
||||
- `layouts/_default/list.html`
|
||||
- `layouts/_default/single.html`
|
||||
- `layouts/partials/`
|
||||
|
||||
The current styles are in:
|
||||
|
||||
- `assets/css/main.css`
|
||||
|
||||
To create a new content page:
|
||||
|
||||
```bash
|
||||
@@ -105,6 +126,76 @@ Typical deployment options include:
|
||||
|
||||
Deployment generally consists of building the site with Hugo and publishing the contents of the `public/` directory.
|
||||
|
||||
### Automated Deployment With Gitea
|
||||
|
||||
If your repository is hosted on Gitea, a practical approach is to use Gitea Actions with a workflow that:
|
||||
|
||||
- runs on every push to `main`
|
||||
- builds the Hugo site
|
||||
- uploads the generated `public/` directory to your server over SSH
|
||||
|
||||
This repository includes a starter workflow in `.gitea/workflows/deploy.yml`.
|
||||
|
||||
This assumes Gitea Actions is enabled and that you have at least one runner available for the repository.
|
||||
|
||||
To use it, you need a Gitea runner and the following repository secrets:
|
||||
|
||||
- `DEPLOY_HOST`: hostname or IP of your server
|
||||
- `DEPLOY_PORT`: SSH port, usually `22`
|
||||
- `DEPLOY_USER`: SSH user used for deployment
|
||||
- `DEPLOY_PATH`: target directory served by your web server
|
||||
- `DEPLOY_SSH_KEY`: private SSH key for the deployment user
|
||||
|
||||
Example target path:
|
||||
|
||||
```text
|
||||
/var/www/portfolio
|
||||
```
|
||||
|
||||
Typical server-side setup:
|
||||
|
||||
- create a dedicated deployment user
|
||||
- add the matching public SSH key to `~/.ssh/authorized_keys`
|
||||
- configure Nginx or Caddy to serve the deployment directory
|
||||
- ensure the deployment user has write permission on the target directory
|
||||
|
||||
#### Nginx Example
|
||||
|
||||
An example Nginx server block is included in `deploy/nginx/portfolio.conf`.
|
||||
|
||||
Typical installation steps on the server:
|
||||
|
||||
1. copy the config to `/etc/nginx/sites-available/portfolio.conf`
|
||||
2. update `server_name` with your real domain
|
||||
3. keep the `root` aligned with `DEPLOY_PATH`, for example `/var/www/portfolio`
|
||||
4. enable the site with a symlink into `/etc/nginx/sites-enabled/`
|
||||
5. test the configuration with `nginx -t`
|
||||
6. reload Nginx with `systemctl reload nginx`
|
||||
|
||||
Example commands:
|
||||
|
||||
```bash
|
||||
sudo cp deploy/nginx/portfolio.conf /etc/nginx/sites-available/portfolio.conf
|
||||
sudo ln -s /etc/nginx/sites-available/portfolio.conf /etc/nginx/sites-enabled/portfolio.conf
|
||||
sudo nginx -t
|
||||
sudo systemctl reload nginx
|
||||
```
|
||||
|
||||
If your server already uses HTTPS, keep Nginx terminating TLS and serving the files from `/var/www/portfolio`. If you do not yet have HTTPS, a common next step is to issue a certificate with Let's Encrypt and Certbot.
|
||||
|
||||
The deployment flow is then:
|
||||
|
||||
1. push changes to `main`
|
||||
2. Gitea Actions builds the site with `hugo --minify`
|
||||
3. the workflow synchronizes `public/` to the server with `rsync`
|
||||
4. Nginx serves the static files directly from the deployment directory
|
||||
|
||||
If you prefer, this can also be adapted to:
|
||||
|
||||
- deploy to a Docker container
|
||||
- publish to object storage such as S3-compatible hosting
|
||||
- trigger a remote script on your server after upload
|
||||
|
||||
## Notes
|
||||
|
||||
- keep content in Markdown for simple maintenance
|
||||
|
||||
Reference in New Issue
Block a user