-
Notifications
You must be signed in to change notification settings - Fork 56
docs: Add getting started>download page #2908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
d30b847
cf538de
e4fa7a1
7181f62
20dcecb
f57d7e4
b414f11
dc99876
ad18f1f
c499789
a511cde
b2eac0b
7404a20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,126 @@ aliases: | |
toc: true | ||
--- | ||
|
||
{{< callout-soon "page" >}} | ||
## Compiled CSS and JS | ||
|
||
Download ready-to-use compiled code for **OUDS Web v{{< param current_version >}}** to easily drop into your project, which includes: | ||
|
||
- Compiled and minified CSS bundles (see [CSS files comparison]({{< docsref "/getting-started/contents#css-files" >}})) | ||
- Compiled and minified JavaScript plugins (see [JS files comparison]({{< docsref "/getting-started/contents#js-files" >}})) | ||
|
||
This doesn't include documentation, source files, or any optional JavaScript dependencies like Popper. | ||
|
||
<a href="{{< param "download.dist" >}}" class="btn btn-default" onclick="dataLayer.push({'event': 'clic', 'site_name':'accessibility-boosted', 'phase':'prod', 'track_category':'download', 'track_name':'getting started', 'track_cible':'download source'});">Download</a> | ||
|
||
## Source files | ||
|
||
Compile OUDS Web with your own asset pipeline by downloading our source Sass, JavaScript, and documentation files. This option requires some additional tooling: | ||
|
||
- [Sass compiler]({{< docsref "/getting-started/contribute#sass" >}}) for compiling Sass source files into CSS files | ||
- [Autoprefixer](https://github.com/postcss/autoprefixer) for CSS vendor prefixing | ||
vprothais marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Should you require our full set of [build tools]({{< docsref "/getting-started/contribute#tooling-setup" >}}), they are included for developing OUDS Web and its docs, but they're likely unsuitable for your own purposes. | ||
|
||
<a href="{{< param "download.source" >}}" class="btn btn-default" onclick="dataLayer.push({'event': 'clic', 'site_name':'accessibility-boosted', 'phase':'prod', 'track_category':'download', 'track_name':'getting started', 'track_cible':'download source'});">Download source</a> | ||
|
||
## Examples | ||
|
||
If you want to download and examine our [examples]({{< docsref "/examples" >}}), you can grab the already built examples: | ||
|
||
<a href="{{< param "download.dist_examples" >}}" class="btn btn-default" onclick="dataLayer.push({'event': 'clic', 'site_name':'accessibility-boosted', 'phase':'prod', 'track_category':'download', 'track_name':'getting started', 'track_cible':'download examples source'});">Download examples</a> | ||
|
||
## CDN via jsDelivr | ||
|
||
Skip the download with [jsDelivr](https://www.jsdelivr.com/) to deliver cached version of OUDS Web's compiled CSS and JS to your project. | ||
|
||
```html | ||
<link href="https://cdn.jsdelivr.net" rel="preconnect" crossorigin="anonymous"> | ||
<link href="{{< param "cdn.css" >}}" rel="stylesheet" integrity="{{< param "cdn.css_hash" >}}" crossorigin="anonymous"> | ||
<script src="{{< param "cdn.js_bundle" >}}" integrity="{{< param "cdn.js_bundle_hash" >}}" crossorigin="anonymous"></script> | ||
``` | ||
|
||
If you're using our compiled JavaScript and prefer to include Popper separately, add Popper before our JS, via a CDN preferably. | ||
|
||
```html | ||
<script src="{{< param "cdn.popper" >}}" integrity="{{< param "cdn.popper_hash" >}}" crossorigin="anonymous"></script> | ||
<script src="{{< param "cdn.js" >}}" integrity="{{< param "cdn.js_hash" >}}" crossorigin="anonymous"></script> | ||
``` | ||
|
||
{{< callout warning >}} | ||
**Resource hint**: make sure to use [`preconnect`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/preconnect) where appropriate (**only** when given URL **will** be used). | ||
{{< /callout >}} | ||
|
||
### Alternative CDNs | ||
|
||
We recommend [jsDelivr](https://www.jsdelivr.com/) and use it ourselves in our documentation. However, in some cases—like in some specific countries or environments—you may need to use other CDN providers like [cdnjs](https://cdnjs.com/) or [unpkg](https://www.unpkg.com). | ||
|
||
You'll find the same files on these CDN providers, albeit with different URLs. With unpkg, you can [use this direct OUDS Web unpkg link](https://www.unpkg.com/browse/@ouds/web@{{< param "current_version" >}}/) to copy and paste link to each dist file from any version of OUDS Web. | ||
|
||
{{< callout warning>}} | ||
**If the SRI hashes differ for a given file, you shouldn't use the files from that CDN, because it means that the file was modified by someone else.** | ||
{{< /callout >}} | ||
|
||
Note that you should compare same length hashes, e.g. `sha384` with `sha384`, otherwise it's expected for them to be different. | ||
As such, you can use an online tool like [SRI Hash Generator](https://www.srihash.org/) to make sure that the hashes are the same for a given file. Alternatively, assuming you have OpenSSL installed, you can achieve the same from the CLI, for example: | ||
|
||
```sh | ||
openssl dgst -sha384 -binary ouds-web.min.js | openssl base64 -A | ||
``` | ||
|
||
vprothais marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### npm | ||
|
||
Install OUDS Web in your Node.js powered apps with [the npm package](https://www.npmjs.com/package/@ouds/web): | ||
|
||
```sh | ||
npm install @ouds/web@{{< param "current_version" >}} | ||
``` | ||
|
||
`const ouds-web = require('ouds-web')` or `import ouds-web from 'ouds-web'` will load all of OUDS Web's plugins onto a `ouds-web` object. | ||
The `ouds-web` module itself exports all of our plugins. You can manually load OUDS Web's plugins individually by loading the `/js/dist/*.js` files under the package's top-level directory. | ||
|
||
OUDS Web's `package.json` contains some additional metadata under the following keys: | ||
|
||
- `sass` - path to OUDS Web's main [Sass](https://sass-lang.com/) source file | ||
- `style` - path to OUDS Web's non-minified CSS that's been compiled using the default settings (no customization) | ||
|
||
{{< callout info >}} | ||
{{< partial "callouts/info-npm-starter.md" >}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this callout we refer to Bootstrap and not OUDS Web, as we do not have an examples repository this might be ok but I think we should at least mention that Bootstrap's examples are 'somewhat' compatible with OUDS Web... Or getting rid of this callout for now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This starter is already listed in the "example" page. A callout is available on the example page explaining very briefly how to alert bootstrap example for them to work with Ouds. Maybe we could replace the direct link to the repo here by a link to the starter section of example page (/examples/#starters) ? |
||
{{< /callout >}} | ||
|
||
### yarn | ||
|
||
Install OUDS Web in your Node.js powered apps with [the yarn package](https://yarnpkg.com/en/package/@ouds/web): | ||
|
||
```sh | ||
yarn add @ouds/web@{{< param "current_version" >}} | ||
``` | ||
|
||
{{< callout warning >}} | ||
**Yarn 2+ (aka Yarn Berry) doesn't support the `node_modules` directory by default**: using the [twbs/examples Sass & JS example](https://github.com/twbs/examples/tree/main/sass-js) needs some adjustments: | ||
```sh | ||
yarn config set nodeLinker node-modules # Use the node_modules linker | ||
touch yarn.lock # Create an empty yarn.lock file | ||
yarn install # Install the dependencies | ||
yarn start # Start the project | ||
``` | ||
{{< /callout >}} | ||
|
||
### Composer | ||
|
||
You can also install and manage OUDS Web's Sass and JavaScript using [Composer](https://getcomposer.org/): | ||
|
||
```sh | ||
composer require orange-opensource/orange-boosted-bootstrap:{{< param current_version >}} | ||
``` | ||
|
||
### NuGet | ||
|
||
If you develop in .NET Framework, you can also install and manage OUDS Web's [CSS](https://www.nuget.org/packages/ouds-web) or [Sass](https://www.nuget.org/packages/ouds-web.sass) and JavaScript using [NuGet](https://www.nuget.org/). Newer projects should use [libman](https://learn.microsoft.com/en-us/aspnet/core/client-side/libman/) or another method as NuGet is designed for compiled code, not frontend assets. | ||
|
||
```powershell | ||
Install-Package ouds-web | ||
``` | ||
|
||
```powershell | ||
Install-Package ouds-web.sass | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.