Skip to content

Commit ab7d7f3

Browse files
authored
1.12.0 (#1706)
* 1.12.0 * better exported files example; img 100%
1 parent a598fc2 commit ab7d7f3

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The app’s title. If specified, this text is appended to page titles with a sep
110110

111111
Whether to show the sidebar. Defaults to true if **pages** is not empty.
112112

113-
## home <a href="https://github.com/observablehq/framework/pull/1689" class="observablehq-version-badge" data-version="prerelease" title="Added in #1689"></a>
113+
## home <a href="https://github.com/observablehq/framework/releases/tag/v1.12.0" class="observablehq-version-badge" data-version="^1.12.0" title="Added in 1.12.0"></a>
114114

115115
An HTML fragment to render the link to the home page in the top of the sidebar. Defaults to the [app’s title](#title), if any, and otherwise the word “Home”. If specified as a function, receives an object with the page’s `title`, (front-matter) `data`, and `path`, and must return a string.
116116

docs/embeds.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
keywords: embedded analytics, embeds, iframe, exporting, exports
33
---
44

5-
# Embedding <a href="https://github.com/observablehq/framework/pull/1637" class="observablehq-version-badge" data-version="prerelease" title="Added in #1637"></a>
5+
# Embedding <a href="https://github.com/observablehq/framework/releases/tag/v1.12.0" class="observablehq-version-badge" data-version="^1.12.0" title="Added in 1.12.0"></a>
66

77
In addition to standalone apps, you can use Framework to embed interactive views within other applications. Framework supports multiple approaches to embedding:
88

@@ -109,16 +109,37 @@ Some web tooling such as Vite and Webpack erroneously rewrite external dynamic i
109109
110110
## Exported files
111111
112-
In addition to modules, you can declare specific files to export using the [**dynamicPaths** config option](./config#dynamic-paths). Exported files are published under a stable URL that can be linked to and loaded from an external application. Exported files can be either [static files](./files) or generated dynamically by [data loaders](./data-loaders), and can use [parameterized routes](./params). For example, to export the file `/robots.txt`:
112+
You can declare specific files to export using the [**dynamicPaths** config option](./config#dynamic-paths). Exported files are published under a stable URL that can be linked to and loaded from an external application. Exported files can be either [static](./files) or generated dynamically by [data loaders](./data-loaders). And you can use [parameterized routes](./params).
113+
114+
For example, say you want to chart downloads of open-source libraries you maintain. You could use a data loader to server-side render SVG with Observable Plot. (See Plot’s [Getting Started](https://observablehq.com/plot/getting-started#plot-in-node-js) guide.) In your config file, list the charts you want to build:
113115
114116
```js run=false
115117
export default {
116118
dynamicPaths: [
117-
"/robots.txt"
119+
"/@observablehq/framework/downloads-dark.svg",
120+
"/@observablehq/framework/downloads.svg",
121+
"/@observablehq/plot/downloads-dark.svg",
122+
"/@observablehq/plot/downloads.svg",
123+
"/@observablehq/runtime/downloads-dark.svg",
124+
"/@observablehq/runtime/downloads.svg"
118125
]
119126
};
120127
```
121128
129+
Once your app is deployed, you can then load the generated SVG into another app — or READMEs on GitHub — using the `img` tag. For example, below is a chart of daily downloads of Observable Framework powered by our [open-source analytics](https://github.com/observablehq/oss-analytics/).
130+
131+
<picture>
132+
<source media="(prefers-color-scheme: dark)" srcset="https://observablehq.observablehq.cloud/oss-analytics/@observablehq/framework/downloads-dark.svg">
133+
<img style="margin-top: 1rem;" alt="Daily downloads of Observable Framework" src="https://observablehq.observablehq.cloud/oss-analytics/@observablehq/framework/downloads.svg">
134+
</picture>
135+
136+
```html run=false
137+
<picture>
138+
<source media="(prefers-color-scheme: dark)" srcset="https://observablehq.observablehq.cloud/oss-analytics/@observablehq/framework/downloads-dark.svg">
139+
<img alt="Daily downloads of Observable Framework" src="https://observablehq.observablehq.cloud/oss-analytics/@observablehq/framework/downloads.svg">
140+
</picture>
141+
```
142+
122143
## Iframe embeds
123144
124145
You can alternatively embed Framework pages using iframes. Pages that are intended to be embedded via iframe typically disable Framework’s built-in user interface using [Markdown front matter](./markdown#front-matter):

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Or with Yarn:
148148

149149
You should see something like this:
150150

151-
<pre data-copy="none"><b class="green">Observable Framework</b> v1.11.0
151+
<pre data-copy="none"><b class="green">Observable Framework</b> v1.12.0
152152
↳ <u><a href="http://127.0.0.1:3000/" style="color: inherit;">http://127.0.0.1:3000/</a></u></pre>
153153

154154
<div class="note">

docs/imports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Unlike `npm:` imports, Node imports do not support semver ranges: the imported v
9898

9999
Imports from `node_modules` are cached in `.observablehq/cache/_node` within your [source root](./config#root) (typically `src`). You shouldn’t need to clear this cache as it is automatically managed, but feel free to clear it you like.
100100

101-
## JSR imports <a href="https://github.com/observablehq/framework/pulls/957" class="observablehq-version-badge" data-version="prerelease" title="Added in #957"></a>
101+
## JSR imports <a href="https://github.com/observablehq/framework/releases/tag/v1.12.0" class="observablehq-version-badge" data-version="^1.12.0" title="Added in 1.12.0"></a>
102102

103103
You can import a package from [JSR (the JavaScript Registry)](https://jsr.io/) using the `jsr:` protocol. As an example, to import a [pseudorandom number generator](https://jsr.io/@std/random) from the [Deno Standard Library](https://deno.com/blog/std-on-jsr):
104104

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@observablehq/framework",
33
"license": "ISC",
4-
"version": "1.12.0-alpha.5",
4+
"version": "1.12.0",
55
"type": "module",
66
"publishConfig": {
77
"access": "public"

src/style/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ tt {
8989
}
9090

9191
img {
92-
max-width: calc(100vw - 28px);
92+
max-width: 100%;
9393
}
9494

9595
p,

0 commit comments

Comments
 (0)