{"id":16598456,"url":"https://github.com/robinl/gasby_observable_blog","last_synced_at":"2025-03-21T13:32:33.434Z","repository":{"id":42319458,"uuid":"209877317","full_name":"RobinL/gasby_observable_blog","owner":"RobinL","description":"See dev branch for source and readme","archived":false,"fork":false,"pushed_at":"2023-01-04T11:37:31.000Z","size":1172,"stargazers_count":8,"open_issues_count":24,"forks_count":1,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2025-03-18T01:51:28.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://robinl.github.io/gasby_observable_blog","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobinL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-20T20:39:17.000Z","updated_at":"2020-05-21T11:40:33.000Z","dependencies_parsed_at":"2023-02-02T10:46:23.364Z","dependency_job_id":null,"html_url":"https://github.com/RobinL/gasby_observable_blog","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinL%2Fgasby_observable_blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinL%2Fgasby_observable_blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinL%2Fgasby_observable_blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinL%2Fgasby_observable_blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobinL","download_url":"https://codeload.github.com/RobinL/gasby_observable_blog/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244806177,"owners_count":20513396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T00:08:43.104Z","updated_at":"2025-03-21T13:32:33.118Z","avatar_url":"https://github.com/RobinL.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Minimal template of a Gatsby blog hosted on Github pages where pages can be authored on https://observablehq.com.  Click [here](https://robinl.github.io/gasby_observable_blog/) for live demo.\n\nIn this template:\n- Some pages e.g. [here](https://robinl.github.io/gasby_observable_blog/gatsby-test/) and [here](https://robinl.github.io/gasby_observable_blog/gatsby-test-2/) contain interactive observable notebooks.  The author can select which cells to include in what order using a simple list.\n- Other pages e.g. [here](https://robinl.github.io/gasby_observable_blog/page1) are created from a json file [here](https://github.com/RobinL/gatsby_observable_template/blob/master/src/data/mydata.json).\n\n## Workflow\n\nIn this example we add [this notebook](https://observablehq.com/@robinl/gatsby-test) to our site.\n\n- Build the notebook on observabehq.com and publish it.\n- `yarn add` the notebook to your gatsby site.  In this case `yarn add https://api.observablehq.com/@robinl/gatsby-test.tgz\\?v\\=3`  (note the version 3 runtime at the end, which is required).\n- Run `refresh_notebooks.sh` to update your dependencies.\n- Add a new page to [`src/pages`](https://github.com/RobinL/gasby_observable_blog/tree/dev/src/pages) using [this file](https://github.com/RobinL/gasby_observable_blog/blob/dev/src/pages/gatsby-test-2.js) as a template\n- Push code back to Github, triggering Github Actions to build site  to master, which is then rendered as a github page.  You need to set up a token in your repo secrets for this to work, described [here](https://github.com/enriikke/gatsby-gh-pages-action#knobs--handles).\n\nNote you can choose which named cells to include in the blog using `output_order` (see [here](https://github.com/RobinL/gasby_observable_blog/blob/dev/src/pages/gatsby-test-2.js) or leave it blank to include everything see [here](https://github.com/RobinL/gasby_observable_blog/blob/dev/src/pages/gatsby-test.js))\n\nCells which are views need to also include `viewof` e.g.\n```\nlet output_order = [\n    \"first_cell\",\n    \"viewof myview\",\n    \"third_cell\"\n    ]\n```\n\nTo make it work on your Github pages, you'll want to update the `pathPrefix` variable in `gatsby_config.json` to your repo's name.\n\n## Notes/Issues\n\n- For a long time I was trying to generate all notebook pages from a `data.json` file, by trying to dynamically import modules from a variable.  I now do not thing this is possible because of the way webpack works - see [here](https://stackoverflow.com/questions/58011164/dynamic-module-import-in-component-for-gatsby-js-site)\n\n- User must install the notebook from the version 3 runtime e.g. `yarn add https://api.observablehq.com/@robin\nl/gatsby-test.tgz\\?v\\=3`.  This will make sure you can import `define` (rather than `notebook`) from the node package.  Some tangential discussion [here](https://talk.observablehq.com/t/runtime-v3-modules/1767).\n\n- For some reason, the yarn integrity check fails for observable notebook modules when they're installed from the `yarn.lock` file on github actions (`Integrity check failed for \"mypackage\" (computed integrity doesn't match our records,`).  Current solution is to delete the `resolved` line from `yarn.lock`.  This happens automatically when you run `refresh_notebooks.sh`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinl%2Fgasby_observable_blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinl%2Fgasby_observable_blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinl%2Fgasby_observable_blog/lists"}