Add webdav upload script and docs
This commit is contained in:
parent
d6c414f887
commit
bf3e635a1c
7 changed files with 426 additions and 36 deletions
19
README.md
19
README.md
|
@ -20,13 +20,14 @@ The website will be built to the `./dist` folder.
|
|||
|
||||
## Blogging with Joplin
|
||||
|
||||
You can use Joplin to write and manageyour blog posts, instead of just placing the Markdown files in the
|
||||
You can use Joplin to write and manage your blog posts, instead of just placing the Markdown files in the
|
||||
`src/content/blog` folder.
|
||||
|
||||
1. Install [Joplin](https://joplinapp.org/)
|
||||
2. Start the Web Clipper Service: Tools > Options > Web Clipper > Start Web Clipper Service
|
||||
3. Run `npm run joplin`
|
||||
4. Allow the request for an API token on the Joplin app
|
||||
- You can also place the Joplin token in an `.env` file in the format `JOPLIN_KEY=your_token`.
|
||||
|
||||
The script will look for a notebook named `Blog`. It will then download all notes from that notebook, alongside their
|
||||
attachments, and place them in the `src/content/blog` folder.
|
||||
|
@ -46,6 +47,22 @@ In order, to have an ogImage (also known as article cover):
|
|||
```
|
||||
Note the `.` (dot) instead of `:` (colon)!
|
||||
|
||||
## Uploading to WebDav
|
||||
|
||||
I have found that a quick and easy way to deploy the website is via WebDav and compatible software on the server side, like
|
||||
[this](https://github.com/mholt/caddy-webdav) plugin for Caddy.
|
||||
|
||||
To simplify uploading to WebDav, I have created a script, which can be run with `npm run upload`.
|
||||
|
||||
You have to set the following environment variables:
|
||||
- `WEBDAV_ENDPOINT`: The URL of the WebDav server, e.g. `https://example.com/webdav/`
|
||||
- `WEBDAV_USERNAME`: The username for the WebDav server
|
||||
- `WEBDAV_PASSWORD`: The password for the WebDav server
|
||||
- `WEBDAV_PATH`: The path to the folder on the server, e.g. `/public_html/` (default: `/`)
|
||||
|
||||
The script will upload the `./dist` folder, so make sure you run `npm run build` before the upload script.
|
||||
Note that running the script will clear the remote folder before uploading the files.
|
||||
|
||||
## License
|
||||
|
||||
The original [Astro Paper](https://github.com/satnaing/astro-paper) is licensed under the MIT License, Copyright © 2025
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue