Skip to content

Commit 4947c09

Browse files
committed
adding more screenshots
1 parent 9fdd27a commit 4947c09

File tree

6 files changed

+29
-3
lines changed

6 files changed

+29
-3
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ npm install eleventy-plugin-scad
3333
- Can also be set with the environment variable `ELEVENTY_SCAD_LAYOUT`
3434
- **collectionPage** _(default: true)_: Set `false` to disable the generation of a listing page with links from the `scad` tagged files _(uses Collections API)_
3535
- Can also be set with the environment variable `ELEVENTY_SCAD_COLLECTION_PAGE`
36+
- **collectionPageTitle** _(default: SCAD Collection)_: Set to a string for the title of the collection page.
37+
- Can also be set with the environment variable `ELEVENTY_SCAD_COLLECTION_PAGE_TITLE`
3638
- **verbose** _(default: false)_: Set `true` to view the compilation output from OpenSCAD
3739
- If your model uses `echo()` this is how to see the output
3840
- Can also be set with the environment variable `ELEVENTY_SCAD_VERBOSE`
@@ -129,9 +131,21 @@ export default (eleventyConfig) => {
129131
};
130132
```
131133

134+
## Collection Page
135+
136+
As of version `0.9.0` the default collection page shows a grid of cards instead of a list of links.
137+
![New Collection Layout](./images/collection.png)
138+
139+
## Renderer
140+
141+
Each `scad` file is rendered and exported as an STL for inspection
142+
![three.js renderer](./images/renderer.png)
143+
132144
## Color Schemes
133145

134-
OpenSCAD has built-in color schemes which can be toggled during export.
146+
OpenSCAD has built-in color schemes which can be set before export.
147+
148+
> NOTE: This only affects the output of the thumbnails.
135149
136150
```js
137151
import { addOpenSCADPlugin } from "eleventy-plugin-scad";
@@ -148,7 +162,7 @@ export default (eleventyConfig) => {
148162
};
149163
```
150164

151-
The model in the examples below is a [Turner's Cube][tcube] and the scad code for it is [here](./scripts/turnercube.scad).
165+
The model in the examples below is a [Turner's Cube][tcube] and the scad code for it is [here](./scripts/turnercube.scad) if you want to make one too.
152166

153167
| ColorScheme | Thumbnail |
154168
| -------------- | ---------------------------------------------------------- |

images/collection.png

109 KB
Loading

images/renderer.png

410 KB
Loading

src/lib/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function getOptionsFromEnv(
3030
theme: getEnv("ELEVENTY_SCAD_THEME") as ModelViewerTheme,
3131
layout: getEnv("ELEVENTY_SCAD_LAYOUT"),
3232
launchPath: getEnv("ELEVENTY_SCAD_LAUNCH_PATH"),
33+
collectionPageTitle: getEnv("ELEVENTY_SCAD_COLLECTION_PAGE_TITLE"),
3334
thumbnailColorScheme: getEnv(
3435
"ELEVENTY_SCAD_THUMBNAIL_COLOR_SCHEME",
3536
) as ThumbnailColorScheme,

test/_11ty/test.eleventy-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function (eleventyConfig) {
1616
launchPath: "docker",
1717
theme: "Swiss",
1818
thumbnailColorScheme: "ClearSky",
19-
collectionPageTitle: "Dev Collection",
19+
collectionPageTitle: "New Collection Layout",
2020
// noSTL: true,
2121
// verbose: false,
2222
});

test/core/options.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe("parseOptions()", () => {
2020
expect(data?.layout).toBe(SCAD_VIEWER_LAYOUT);
2121
expect(data?.theme).toBe(DEFAULT_PLUGIN_THEME);
2222
expect(data?.thumbnailColorScheme).toBe("Cornfield");
23+
expect(data?.collectionPageTitle).toBe("SCAD Collection");
2324
expect(data?.resolveLaunchPath).toBe(true);
2425
expect(data?.collectionPage).toBe(true);
2526
expect(data?.verbose).toBe(true);
@@ -66,6 +67,16 @@ describe("parseOptions()", () => {
6667
expect(data?.resolveLaunchPath).toBe(false);
6768
});
6869

70+
test(`ELEVENTY_SCAD_COLLECTION_PAGE_TITLE sets theme`, () => {
71+
const title = "fancy title";
72+
process.env.ELEVENTY_SCAD_COLLECTION_PAGE_TITLE = title;
73+
74+
const { success, data } = parseOptions({}, process.env);
75+
76+
expect(success).toBeTruthy();
77+
expect(data?.collectionPageTitle).toBe(title);
78+
});
79+
6980
test(`ELEVENTY_SCAD_COLLECTION_PAGE sets collectionPage`, () => {
7081
process.env.ELEVENTY_SCAD_COLLECTION_PAGE = "false";
7182

0 commit comments

Comments
 (0)