-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use lume, overhaul frontpage and add a target list
- Loading branch information
Showing
417 changed files
with
7,369 additions
and
84,369 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,27 @@ | ||
name: Build pages | ||
|
||
on: | ||
pull_request: | ||
|
||
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 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
/target | ||
**/*.rs.bk | ||
Cargo.lock | ||
|
||
# Generated Zola files should not be added to git | ||
public/ | ||
/_cache | ||
.DS_Store |
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 |
---|---|---|
@@ -1,16 +1,26 @@ | ||
# probe.rs | ||
# The new probe.rs webpage | ||
|
||
## Development | ||
|
||
The entire webpage is built with [zola](https://www.getzola.org/) which is based on statically compiled Markdown and [tera](https://github.com/Keats/tera) templates. | ||
You can run the file watcher & compiler with `zola serve` during development. The webpage will automatically be reloaded everytime you change any involved file. | ||
## Goals | ||
|
||
Currently, zola version 0.14 or higher is used. | ||
- Create a more appealing frontpage that tells the visitor a bit better what we | ||
have to offer. | ||
- Provide simple installation instructions. Part of this initiative is building | ||
proper release artifacts in the pipeline (see | ||
[#1721](https://github.com/probe-rs/probe-rs/pull/1721)). | ||
- Make the entry into `probe-rs` usage even easier. | ||
- Explain how one uses `probe-rs run` properly. | ||
- How to troubleshoot | ||
- How to enable logs | ||
- What are common errors | ||
- Can we also add hints in our error messages | ||
- Clean up docs a lot and explain in more detail. | ||
- Add a searchable list of provided targets with information about each target. | ||
|
||
You can install the latest build of zola by running `cargo install --git https://github.com/getzola/zola`. You will need the runtime and development packages for libsass installed on your OS. | ||
## Development | ||
|
||
## Deployment | ||
[Install](https://deno.land/[email protected]/getting_started/installation) deno | ||
which is the JS runtime to generate all webpage docs. | ||
|
||
To deploy the webpage we use Docker. | ||
The container can be built with `scripts/build_docker.sh` and run locally with `scripts/run_docker.sh`. | ||
To deploy the container for the `probe.rs` domain, please contact @Yatekii or @tiwalun. | ||
You need a GitHub API token with repository read access to circumvent API rate | ||
limiting. Store it in the `GITHUB_TOKEN` environment variable for the deno | ||
process to pick up. Run `deno task serve` in this repository root. |
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,116 @@ | ||
import lume from "lume/mod.ts"; | ||
import jsx from "lume/plugins/jsx.ts"; | ||
import vento from "lume/plugins/vento.ts"; | ||
import attributes from "lume/plugins/attributes.ts"; | ||
import base_path from "lume/plugins/base_path.ts"; | ||
import code_highlight from "lume/plugins/code_highlight.ts"; | ||
import date from "lume/plugins/date.ts"; | ||
import esbuild from "lume/plugins/esbuild.ts"; | ||
import eta from "lume/plugins/eta.ts"; | ||
import feed from "lume/plugins/feed.ts"; | ||
import filter_pages from "lume/plugins/filter_pages.ts"; | ||
import inline from "lume/plugins/inline.ts"; | ||
import mdx from "lume/plugins/mdx.ts"; | ||
import picture from "lume/plugins/picture.ts"; | ||
import imagick from "lume/plugins/imagick.ts"; | ||
import sass from "lume/plugins/sass.ts"; | ||
import source_maps from "lume/plugins/source_maps.ts"; | ||
import svgo from "lume/plugins/svgo.ts"; | ||
import toc from "https://deno.land/x/[email protected]/toc/mod.ts"; | ||
import readingTime from "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/reading_time/mod.ts"; | ||
import { Page } from "lume/core.ts"; | ||
|
||
const markdown = { | ||
plugins: [toc], | ||
keepDefaultPlugins: true, | ||
}; | ||
|
||
const site = lume( | ||
{ | ||
location: new URL("https://probe.rs"), | ||
dest: "./target", | ||
src: "./src", | ||
server: { | ||
// open: true, | ||
}, | ||
}, | ||
{ markdown } | ||
); | ||
|
||
site.copy("static", "."); | ||
site.copy([".gif"]); | ||
site.use(jsx()); | ||
site.use(vento()); | ||
site.use(attributes()); | ||
site.use(base_path()); | ||
site.use(code_highlight()); | ||
site.use(date()); | ||
site.use(esbuild()); | ||
site.use(eta()); | ||
site.use(feed()); | ||
site.use(filter_pages()); | ||
site.use(inline()); | ||
site.use(mdx()); | ||
site.use(picture()); | ||
site.use(imagick()); | ||
site.use(sass()); | ||
site.use(source_maps()); | ||
site.use(svgo()); | ||
site.use(readingTime()); | ||
site | ||
.scopedUpdates((path) => path.endsWith(".png") || path.endsWith(".jpg")) | ||
.filter("slice", (arr, length) => arr.slice(0, length)) | ||
.process([".html"], (page) => { | ||
const doc = page.document!; | ||
const blocks = doc.querySelectorAll("probe-rs-code"); | ||
|
||
blocks.forEach((block, i) => { | ||
const pres = (block as unknown as HTMLElement).querySelectorAll( | ||
":scope > pre" | ||
); | ||
|
||
const menu = doc.createElement("ul"); | ||
menu.setAttribute("role", "tablist"); | ||
menu.setAttribute("aria-label", "Code Tabs"); | ||
menu.classList.add("probe-rs-code-menu"); | ||
|
||
pres.forEach((pre, j) => { | ||
const title = pre.querySelector("code")!.getAttribute("title")!; | ||
|
||
const li = doc.createElement("li"); | ||
li.setAttribute("role", "presentation"); | ||
|
||
const button = doc.createElement("button"); | ||
button.setAttribute("role", "tab"); | ||
button.setAttribute("aria-selected", j === 0 ? true : false); | ||
button.setAttribute("aria-controls", `panel-${i + 1}-${j + 1}`); | ||
button.setAttribute("id", `tab-${i + 1}-${j + 1}`); | ||
button.setAttribute("tabindex", j === 0 ? 0 : -1); | ||
button.innerText = title; | ||
button.classList.add("probe-rs-code-tab"); | ||
|
||
if (j > 0) { | ||
pre.setAttribute("hidden", "true"); | ||
} else { | ||
button.classList.add("is-active"); | ||
} | ||
|
||
pre.setAttribute("role", "tabpanel"); | ||
pre.setAttribute("aria-labelledby", `tab-${i + 1}-${j + 1}`); | ||
pre.setAttribute("id", `panel-${i + 1}-${j + 1}`); | ||
pre.setAttribute("tabindex", "0"); | ||
|
||
li.append(button); | ||
menu.appendChild(li); | ||
}); | ||
|
||
(block as unknown as HTMLElement).prepend(menu as unknown as Node); | ||
}); | ||
}) | ||
.preprocess([".md"], (page: Page) => { | ||
page.data.excerpt ??= (page.data.content as string).split( | ||
/<!--\s*more\s*-->/i, | ||
)[0]; | ||
}); | ||
|
||
export default site; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.