-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e2c1135
Showing
27 changed files
with
1,666 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Publish on GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Deno environment | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
|
||
- name: Build site | ||
run: deno task build | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: '_site' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lint_and_fmt: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
deno: [v1.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: ${{ matrix.deno }} | ||
- name: Lint files | ||
run: deno lint | ||
- name: Check formatting | ||
run: deno fmt --check | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
deno: [v1.x, canary] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: ${{ matrix.deno }} | ||
- name: Run unit tests on Deno | ||
run: deno test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": true, | ||
"deno.unstable": true, | ||
"deno.config": "./deno.json", | ||
"[json][jsonc][markdown][typescript][typescriptreact]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Cataclysm: Bright Nights Blog | ||
|
||
Weekly changelogs and development updates for Cataclysm: Bright Nights. | ||
|
||
## How to run | ||
|
||
```sh | ||
git https://github.com/scarf005/bn-blog | ||
cd bn-blog | ||
deno task serve | ||
``` | ||
|
||
## License | ||
|
||
[AGPL 3.0 only](./LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { lume } from "./lume_core.ts" | ||
import relativeUrls from "lume/plugins/relative_urls.ts" | ||
import inline from "lume/plugins/inline.ts" | ||
import minifyHTML from "lume/plugins/minify_html.ts" | ||
|
||
const site = lume() | ||
|
||
site.copy([".css"]) | ||
site.ignore("./README.md") | ||
site.data("layout", "_includes/base.ts") | ||
site.use(relativeUrls()) | ||
if (Deno.env.get("MINIFY")) { | ||
site.use(inline()) | ||
site.use(minifyHTML()) | ||
} | ||
export default site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export const repo = "https://github.com/scarf005/bn-blog" | ||
|
||
const footer = /*html*/ ` | ||
<footer> | ||
© 2023 <a href="https://github.com/scarf005">scarf</a> | ||
| <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL-3.0-Only</a> | ||
| <a href="${repo}">Source</a> | ||
</footer> | ||
` | ||
|
||
const render = (title: string, { content, head = "" }: Lume.Data): string => /*html*/ ` | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>${title}</title> | ||
<link rel="stylesheet" href="/assets/style.css" inline /> | ||
${head} | ||
</head> | ||
<body> | ||
<main> | ||
<h1>${title}</h1> | ||
${content} | ||
</main> | ||
${footer} | ||
</body> | ||
</html> | ||
` | ||
|
||
export default (data: Lume.Data) => { | ||
const title = data.title ?? data.page.data.basename | ||
|
||
return render(title, data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ul { | ||
list-style: none; | ||
} | ||
|
||
ul ul li { | ||
list-style: disc; | ||
} | ||
|
||
ul ul li li { | ||
list-style: circle; | ||
} | ||
|
||
ul ul li li li { | ||
list-style: square; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
body { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin: 40px auto; | ||
max-width: 800px; | ||
line-height: 1.6; | ||
font-size: 18px; | ||
color: #444; | ||
} | ||
|
||
img { | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
|
||
a { | ||
text-decoration-line: underline; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3 { | ||
line-height: 1.2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"exclude": ["_site"], | ||
"tasks": { | ||
"lume": "echo \"import 'lume/cli.ts'\" | deno run --unstable -A -", | ||
"build": "MINIFY=1 deno task lume", | ||
"serve": "deno task lume -s" | ||
}, | ||
"fmt": { | ||
"semiColons": false, | ||
"lineWidth": 100, | ||
"useTabs": true, | ||
"proseWrap": "never" | ||
}, | ||
"compilerOptions": { | ||
"types": ["lume/types.ts"], | ||
"exactOptionalPropertyTypes": true, | ||
"noErrorTruncation": true | ||
}, | ||
"unstable": ["ffi", "http"], | ||
"nodeModulesDir": false, | ||
"imports": { | ||
"lume/": "https://deno.land/x/[email protected]/" | ||
} | ||
} |
Oops, something went wrong.