Skip to content

Commit ec2a4ba

Browse files
authored
Merge pull request #130 from profanity-im/improve-readme
Improve README
2 parents b285729 + 550634d commit ec2a4ba

2 files changed

Lines changed: 47 additions & 30 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Build and Deploy Site
2-
on: push
2+
on:
3+
push:
4+
branches: ["master"]
5+
pull_request:
6+
branches: ["master"]
7+
38
jobs:
49
build:
510
runs-on: ubuntu-latest
@@ -8,7 +13,6 @@ jobs:
813

914
steps:
1015
- uses: actions/checkout@v6
11-
- run: cat /etc/os-release
1216
- name: install dependencies
1317
run: |
1418
sudo dnf -y update
@@ -25,6 +29,7 @@ jobs:
2529
path: site
2630

2731
deploy:
32+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
2833
needs: build
2934

3035
permissions:

README.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,42 @@
11
Sources for https://profanity-im.github.io
22

3-
Most site are edited by hand.
4-
5-
Top level pages are generated from xml sources using [sblg](https://kristaps.bsd.lv/sblg/).
6-
The source file for the landing page is index.xml which contains html for everything other
7-
than the header and footer. The source files for other top level pages are in the folder
8-
`pagesource`. These are xml files which contain html content for everything other than the
9-
header and footer. Edit them by hand.
10-
11-
Blog entry sources are in the directory `blogsource/content/post`. These are markdown
12-
files which are processed by [lowdown](https://kristaps.bsd.lv/lowdown). To create a new
13-
blog entry enter the directory `blogsource`. Run `blog-post.sh` to create a blog post
14-
starter file. Edit the starter file created in `blogsource/content/post/` to add the
15-
content for the blog post. If you do not have a contributor profile, please create one in
16-
`blogsource/content/contributors`. See one of the existing contributor profiles for the
17-
formatting. Optionally add an image in jpeg format with name `username.jpg` to be used with
18-
your profile in `blogsource/content/contributors/img`.
19-
20-
Command references (main_fragment.html, toc_fragment.html), and apidocs are generated via
21-
`profanity docgen`. See the
22-
[release guide](https://github.com/profanity-im/profanity/blob/master/RELEASE_GUIDE.md) for
23-
details.
24-
25-
GitHubActions will build and deploy the website for updates to blog entries and to changes in
26-
the top level pages.
27-
28-
To build the site locally, type `make` in the top level directory. You will need to have
29-
[sblg](https://kristaps.bsd.lv/sblg/) and [lowdown](https://kristaps/bsd.lv/lowdown) installed
30-
on your system.
3+
The website is generated from XML and Markdown sources using [sblg](https://kristaps.bsd.lv/sblg/) and [lowdown](https://kristaps.bsd.lv/lowdown).
4+
5+
## Reference
6+
7+
| To Change... | Edit File(s) | Format |
8+
| :--- | :--- | :--- |
9+
| **Home Page (Landing)** | `index.xml` | XML Fragment |
10+
| **Top-Level Pages** (FAQ, Donate, etc.) | `pagesource/*.xml` | XML Fragment |
11+
| **Blog Posts** | `blogsource/content/post/*.md` | Markdown |
12+
| **Blog User Profiles** | `blogsource/content/contributors/*.md` | Markdown |
13+
| **Site Header/Footer (Home)** | `landing-template.xml` | HTML Template |
14+
| **Site Header/Footer (Manuals)** | `manual-template.xml` | HTML Template |
15+
| **Blog Post Layout** | `blogsource/content/post/blog-post-template.xml` | HTML Template |
16+
| **Theme Gallery Layout** | `gallery-template.xml` | HTML Template |
17+
| **Style** | `css/*.css` | CSS |
18+
19+
### Page Sources
20+
The source files for the landing page (`index.xml`) and other top level pages in `pagesource/` are XML fragments. They contain the HTML content for the body, which is then injected into the appropriate header and footer templates.
21+
22+
### Blog
23+
Blog posts and contributor profiles are written in Markdown.
24+
25+
To create a new blog entry:
26+
1. Enter the directory `blogsource`.
27+
2. Run `./blog-post.sh` to create a starter file in `blogsource/content/post/`.
28+
3. Edit the new `.md` file to add your content.
29+
30+
If you do not have a contributor profile, please create one in `blogsource/content/contributors/` using an existing profile as a template. You can optionally add a JPEG image (named `username.jpg`) to `blogsource/content/contributors/img/`.
31+
32+
### Documentation
33+
Command references (`main_fragment.html`, `toc_fragment.html`) and apidocs are generated via `profanity docgen`. See the [release guide](https://github.com/profanity-im/profanity/blob/master/RELEASE_GUIDE.md) for details.
34+
35+
### Build & Deploy
36+
GitHub Actions will automatically build and deploy the website to GitHub Pages on every push.
37+
38+
To build the site locally, run `make` in the top level directory. You will need `sblg` and `lowdown` installed on your system.
39+
40+
To preview the site locally, run `make install` which will create a directory `site`, open `site/index.html` in a web browser.
41+
42+
To remove the generated files and keep the source files, run `make clean`.

0 commit comments

Comments
 (0)