Skip to content

Commit c7eb8da

Browse files
committed
Embedded mode and docs
1 parent 3b4d8f6 commit c7eb8da

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
The Creative Commons License Chooser is meant to help people learn about CC licenses, and select the license that best fits their needs. The new version in this repo places greater importance on usability, and an educational experience of the six CC licenses.
44

55
## About
6+
67
Repository containing the source code for the new Creative Commons License Chooser. The new chooser is still in beta, and a beta deployment can be found [here](https://chooser-beta.creativecommons.org/).
78

89
This site is built using [Vue.js](https://vuejs.org/) (and vue-cli).
@@ -12,6 +13,7 @@ This site is built using [Vue.js](https://vuejs.org/) (and vue-cli).
1213
Tasks, issues, and discussion related to the release of the new chooser are tracked with the [`Launch Milestone`](https://github.com/creativecommons/chooser/milestone/1).
1314

1415
## Getting Started
16+
1517
Run the following commands in order to have the code up and running on your machine:
1618

1719
``` bash
@@ -24,6 +26,7 @@ $ npm run serve
2426
You should now have the application running and accessible at http://localhost:8080 (note: will run on a different port if 8080 is occupied, most common alternative port is 8081).
2527

2628
## Contributing
29+
2730
For information on contributing, please see [Creative Commons' Contribution Guidelines](https://opensource.creativecommons.org/contributing-code/)
2831

2932
If you create a PR for your work, but you are not finished yet, please include `WIP:` in the beginning of your PR title. When your work on your PR is completed, and you are ready for a final review, please remove the `WIP:` prefix from the title to indicate that your work is done.
@@ -35,16 +38,27 @@ If it says "No results matched your search", then there are no issues currently
3538
*If no progress has been made on an issue for seven days after assignment, the assignment will be removed to allow others to contribute.*
3639

3740
## Running Tests
41+
3842
You can run tests by executing:
3943

4044
```bash
4145
$ npm run test
4246
```
4347

4448
## CSS Build
49+
4550
The Chooser uses PostCSS plugin for PurgeCSS to make CSS bundle size smaller. It automatically removes unused CSS based on the classes found in the final built bundle. Some styles for dynamic components or dynamically-imported files can also be removed. If you find that the built site misses some styles, you can manually add the necessary classes or Regex expressions to the `safelist` array in the `postcss.config.js` file.
4651

4752
## Deployment
53+
4854
The chooser is deployed to GitHub Pages. The source files for the beta deployment are contained in the `./docs/` dir, and are live. Any changes to this directory's contents will be automatically deployed, so please take care when making modifications to this location.
4955

5056
To update the dist bundle, run ```$ npm run build```. This will also automatically copy the generated files from `./dist/` to `./docs/`.
57+
58+
## Output Modes
59+
60+
The site can be built in two different modes: `embedded` and `standalone`. `Embedded` mode removes the header and foter from the application, resulting in the following appearance:
61+
62+
<img src="static/embedded-screenshot.png" alt="Application built in embedded mode">
63+
64+
To build into embedded mode, set the environment variable `VUE_APP_CC_OUTPUT=embedded` on your server before building. If `VUE_APP_CC_OUTPUT` is unset or set to a different value, the app will build in the default `standalone` mode, with its own header and footer.

src/App.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div id="app">
3-
<header-section />
3+
<header-section v-if="!isEmbedded" />
44
<div
55
id="site-container"
66
class="container"
@@ -57,7 +57,7 @@
5757
</div>
5858
</div>
5959
</div>
60-
<footer-section />
60+
<footer-section v-if="!isEmbedded" />
6161
<chooser-modal
6262
:active-modal="openModal"
6363
@close="closeChooserModal"
@@ -89,6 +89,7 @@ export default {
8989
},
9090
data() {
9191
return {
92+
isEmbedded: process.env.VUE_APP_CC_OUTPUT === 'embedded' ?? false,
9293
currentStepId: 0,
9394
openModal: null,
9495
showLicense: false,

static/embedded-screenshot.png

447 KB
Loading

0 commit comments

Comments
 (0)