Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jamonholmgren committed Nov 30, 2023
1 parent 9541c85 commit 9fc2d30
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ web
static
scripts.js
styles.css
footer.html
header.html
head.html
layout.html
README.md
```

Expand All @@ -73,7 +71,7 @@ Qub's web server was originally based on [Yacy](https://github.com/smokingwheels
- [x] Static file serving (css, js, etc)
- [x] Binary file serving (images, fonts, etc)
- [x] Custom 404 page support
- [x] Basic dynamic variable support (e.g. `${year}` in web/footer.html, `${slug}` for use in your navigation, etc)
- [x] Basic dynamic variable support (e.g. `<!--$YEAR-->` in web/layout.html, etc)
- [x] Custom port support (via ./qub.conf)
- [ ] Customizable dynamic variable support (coming soon)
- [ ] 301 redirects support (coming soon)
Expand All @@ -84,20 +82,22 @@ It does not (and probably won't) support HTTPS or HTTP2. I recommend putting Clo

### Common included files

In the `web` folder, you'll find three files that are included on every page -- head.html, header.html, and footer.html.
In the `web` folder, you'll find a layout.html file.

The header and footer are both directly within the `<body>` tag, while head is within the `<head>` tag, like so:
This is the standard layout for your website, and includes your html's head and body sections,
with placeholder comments for dynamic content like what page is being rendered.

```html
<!DOCTYPE html>
<html>
<head>
<!-- head.html goes here -->
<!-- other stuff -->
<title><!--$TITLE--></title>
</head>
<body>
<!-- header.html goes here -->
<!-- routed page content goes here -->
<!-- footer.html goes here -->
<!-- whatever you want to wrap your page content with -->
<!--$BODY-->
<!-- footer content, etc -->
</body>
</html>
```
Expand Down
10 changes: 3 additions & 7 deletions src/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,9 @@ main() {
echo -e "${GREEN}${END} web/static/scripts.js"
curl -s $GITHUB_TEMPLATE/web/static/styles.css > "${DOMAIN}/web/static/styles.css"
echo -e "${GREEN}${END} web/static/styles.css"
curl -s $GITHUB_TEMPLATE/web/footer.html > "${DOMAIN}/web/footer.html"
replace_in_file "$DOMAIN/web/footer.html" "DOMAIN" "$DOMAIN"
echo -e "${GREEN}${END} web/footer.html"
curl -s $GITHUB_TEMPLATE/web/header.html > "${DOMAIN}/web/header.html"
echo -e "${GREEN}${END} web/header.html"
curl -s $GITHUB_TEMPLATE/web/head.html > "${DOMAIN}/web/head.html"
echo -e "${GREEN}${END} web/head.html"
curl -s $GITHUB_TEMPLATE/web/layout.html > "${DOMAIN}/web/layout.html"
replace_in_file "$DOMAIN/web/layout.html" "DOMAIN" "$DOMAIN"
echo -e "${GREEN}${END} web/layout.html"

# Make the binary files executable
chmod +x "${DOMAIN}/bin/*"
Expand Down

0 comments on commit 9fc2d30

Please sign in to comment.