Skip to content

Commit

Permalink
Merge pull request #646 from molgenis/bug/cdns
Browse files Browse the repository at this point in the history
Make CDN files local to protect users online
  • Loading branch information
clemens-tolboom authored Mar 7, 2024
2 parents 5333b1c + 132daa5 commit 1271a33
Show file tree
Hide file tree
Showing 23 changed files with 109 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ service provides the following features:
* **configure DataSHIELD analysis profiles**. [DataSHIELD analysis profiles](https://www.datashield.org/help/standard-profiles-and-plaforms) are
Docker images that contain a collection of multiple [DataSHIELD analysis packages](https://www.datashield.org/help/community-packages).

![DataSHIELD overview](https://raw.githubusercontent.com/molgenis/molgenis-service-armadillo/master/docs/img/overview-datashield.png)
![DataSHIELD overview](./img/overview-datashield.png)

## Older versions

Expand Down
43 changes: 43 additions & 0 deletions docs/_cdns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Get rid of CDNs

We need to protect our reseachers and make the docs more performant.

- `mkdir _cdns`
- Check index.html for external links
- fetch all external references

> When adding a new docs tree ie `v3.2.0` make sure to follow these same/similar steps
```bash
wget cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css
wget cdn.jsdelivr.net/npm/docsify@4 --output-document=docsify@4.js
wget cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js
wget unpkg.com/docsify/lib/plugins/search.min.js
```

- scan files for external links and change those.
- `vue.css` has link to fonts list

```bash
wget https://fonts.googleapis.com/css\?family\=Roboto+Mono\|Source+Sans+Pro:300,400,600 --output-document=fonts.css
```

- fetch the fonts now listed in `fonts.css`
- fetch those fonts in `./fonts/`

```bash
wget https://fonts.gstatic.com/s/robotomono/v23/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_ROW9.ttf
wget https://fonts.gstatic.com/s/sourcesanspro/v22/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdr.ttf
wget https://fonts.gstatic.com/s/sourcesanspro/v22/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7g.ttf
wget https://fonts.gstatic.com/s/sourcesanspro/v22/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdr.ttf
```

- Adjust the link to the downloaded fonts

```bash
vi fonts.css
# replace all paths ie
# https://fonts.gstatic.com/s/sourcesanspro/v22/xxx.ttf
# into
# ./fonts/xxx.ttf
```
1 change: 1 addition & 0 deletions docs/_cdns/docsify-sidebar-collapse.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/_cdns/docsify@4.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions docs/_cdns/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
src: url(./fonts/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_ROW9.ttf) format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: url(./fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdr.ttf) format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7g.ttf) format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 600;
src: url(./fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdr.ttf) format('truetype');
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions docs/_cdns/search.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1271a33

Please sign in to comment.