Skip to content
This repository was archived by the owner on Feb 10, 2020. It is now read-only.

Commit 5ee61a1

Browse files
authored
Merge branch 'master' into patch-1
2 parents 0891a49 + 4e4f834 commit 5ee61a1

File tree

100 files changed

+8422
-1537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+8422
-1537
lines changed

.circleci/config.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
version: 2
2+
3+
defaults: &defaults
4+
docker:
5+
- image: canonicalwebteam/dev
6+
7+
jobs:
8+
test-site:
9+
<<: *defaults
10+
steps:
11+
- checkout
12+
- run:
13+
name: Install dependencies
14+
command: yarn
15+
- run:
16+
name: Install bower dependencies
17+
command: bower --allow-root install
18+
- run:
19+
name: Build the site resources
20+
command: yarn run build-all
21+
- run:
22+
name: Run the site server
23+
command: PORT=80 ./bin/serve
24+
background: true
25+
- run:
26+
name: Check site is accessible
27+
command: sleep 4 && curl --head --fail --retry-delay 5 --retry 10 --retry-connrefused http://localhost
28+
lint-content:
29+
<<: *defaults
30+
steps:
31+
- checkout
32+
- run:
33+
name: Install dependencies
34+
command: yarn
35+
- run:
36+
name: Lint content
37+
command: yarn lint-content
38+
lint-style:
39+
<<: *defaults
40+
steps:
41+
- checkout
42+
- run:
43+
name: Install dependencies
44+
command: yarn
45+
- run:
46+
name: Lint style
47+
command: yarn lint-style
48+
lint-js:
49+
<<: *defaults
50+
steps:
51+
- checkout
52+
- run:
53+
name: Install dependencies
54+
command: yarn
55+
- run:
56+
name: Lint JS
57+
command: yarn lint-js
58+
lint-polymer:
59+
<<: *defaults
60+
steps:
61+
- checkout
62+
- run:
63+
name: Install yarn dependencies
64+
command: yarn
65+
- run:
66+
name: Install bower dependencies
67+
command: bower --allow-root install
68+
- run:
69+
name: Lint polymer
70+
command: yarn lint-polymer
71+
72+
workflows:
73+
version: 2
74+
build:
75+
jobs:
76+
- test-site
77+
- lint-content
78+
- lint-style
79+
- lint-js
80+
- lint-polymer

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Done
2+
3+
[List of work items including drive-bys]
4+
5+
## QA
6+
7+
- Check out this feature branch
8+
- Run the site using the command `./run serve`
9+
- View the site locally in your web browser at: [http://0.0.0.0:8016/](http://0.0.0.0:8016/)
10+
- [List additional steps to QA the new features or prove the bug has been resolved]
11+
12+
13+
## Issue / Card
14+
15+
[List of links to Github issues/bugs and cards if needed - e.g. `Fixes #1`]
16+
17+
## Screenshots
18+
19+
[if relevant, include a screenshot]

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# [generated] Bracketed sections updated by Yeoman generator
2-
# generator-canonical-webteam@2.1.1
2+
# generator-canonical-webteam@3.2.1
33

44
# [os] OS & editor files
55
Desktop.ini
@@ -41,6 +41,7 @@ package-lock.json
4141
/parts/
4242
/prime/
4343
/stage/
44+
*.egg-info
4445
.snapcraft/
4546
*.snap
4647
_site/
@@ -50,6 +51,7 @@ _site/
5051
.docker-project
5152
.*.hash
5253
.envrc
54+
.env.local
5355
env/
5456
env[23]/
5557

.stylelintrc

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,120 @@
1-
extends:
2-
- 'stylelint-config-polymer'
31
processors:
42
- 'stylelint-processor-html'
53
rules:
4+
'at-rule-empty-line-before':
5+
- always
6+
-
7+
except:
8+
- blockless-after-same-name-blockless
9+
- first-nested
10+
-
11+
ignore:
12+
- after-comment
13+
'at-rule-name-case': lower
14+
'at-rule-name-space-after': always-single-line
15+
'at-rule-semicolon-newline-after': always
16+
'block-closing-brace-empty-line-before': never
17+
'block-closing-brace-space-before': always-single-line
18+
'block-no-empty': true
19+
'block-opening-brace-newline-after': always-multi-line
20+
'block-opening-brace-space-after': always-single-line
21+
'block-opening-brace-space-before': always
22+
'color-hex-case': lower
23+
'color-hex-length': short
24+
'color-no-invalid-hex': true
25+
'comment-empty-line-before':
26+
- always
27+
-
28+
except:
29+
- first-nested
30+
-
31+
ignore:
32+
- stylelint-commands
33+
'comment-no-empty': true
34+
'comment-whitespace-inside': always
35+
'custom-property-empty-line-before':
36+
- always
37+
-
38+
except:
39+
- after-custom-property
40+
- first-nested
41+
-
42+
ignore:
43+
- after-comment
44+
- inside-single-line-block
45+
'declaration-bang-space-after': never
46+
'declaration-bang-space-before': always
47+
'declaration-block-no-shorthand-property-overrides': true
48+
'declaration-block-semicolon-newline-after': always-multi-line
49+
'declaration-block-semicolon-space-after': always-single-line
50+
'declaration-block-semicolon-space-before': never
51+
'declaration-block-single-line-max-declarations': 1
52+
'declaration-block-trailing-semicolon': always
53+
'declaration-colon-newline-after': always-multi-line
54+
'declaration-colon-space-after': always-single-line
55+
'declaration-colon-space-before': never
56+
'function-calc-no-unspaced-operator': true
57+
'function-comma-newline-after': always-multi-line
58+
'function-comma-space-after': always-single-line
59+
'function-comma-space-before': never
60+
'function-linear-gradient-no-nonstandard-direction': true
61+
'function-max-empty-lines': 0
62+
'function-name-case': lower
63+
'function-parentheses-newline-inside': always-multi-line
64+
'function-parentheses-space-inside': never-single-line
65+
'indentation': 2
66+
'keyframe-declaration-no-important': true
67+
'length-zero-no-unit': true
68+
'max-empty-lines': 1
69+
'media-feature-colon-space-after': always
70+
'media-feature-colon-space-before': never
71+
'media-feature-name-case': lower
72+
'media-feature-parentheses-space-inside': never
73+
'media-feature-range-operator-space-after': always
74+
'media-feature-range-operator-space-before': always
75+
'media-query-list-comma-newline-after': always-multi-line
76+
'media-query-list-comma-space-after': always-single-line
77+
'media-query-list-comma-space-before': never
78+
'no-eol-whitespace': true
79+
'no-extra-semicolons': true
80+
'no-invalid-double-slash-comments': true
81+
'no-missing-end-of-source-newline': true
82+
'number-leading-zero': always
83+
'number-no-trailing-zeros': true
84+
'property-case': lower
85+
'selector-attribute-brackets-space-inside': never
86+
'selector-attribute-operator-space-after': never
87+
'selector-attribute-operator-space-before': never
88+
'selector-combinator-space-after': always
89+
'selector-combinator-space-before': always
90+
'selector-list-comma-newline-after': always
91+
'selector-list-comma-space-before': never
92+
'selector-max-empty-lines': 0
93+
'selector-pseudo-class-case': lower
94+
'selector-pseudo-class-no-unknown':
95+
- true
96+
- ignorePseudoClasses:
97+
- host
98+
'selector-pseudo-class-parentheses-space-inside': never
99+
'selector-pseudo-element-case': lower
100+
'selector-pseudo-element-colon-notation': double
101+
'selector-pseudo-element-no-unknown':
102+
- true
103+
- ignorePseudoElements:
104+
- 'content'
105+
- 'shadow'
106+
'selector-type-case': lower
107+
'selector-type-no-unknown':
108+
- true
109+
- ignoreTypes:
110+
- /^[a-zA-Z]([a-zA-Z0-9]*-[a-zA-Z0-9]+)+/
111+
'shorthand-property-no-redundant-values': true
112+
'string-no-newline': true
113+
'unit-case': lower
114+
'unit-no-unknown': true
115+
'value-list-comma-newline-after': always-multi-line
116+
'value-list-comma-space-after': always-single-line
117+
'value-list-comma-space-before': never
6118
'block-closing-brace-newline-after': null
7119
'block-closing-brace-newline-before': null
8120
'function-url-quotes': always

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

HACKING.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ We also make use of a `./run` script that we generate with our [generator-canoni
2121
- `./run help`: Print help.
2222

2323
NPM/Yarn scripts:
24-
- `./run node yarn run serve-live`: Run local server with live content.
25-
- `./run node yarn run build-all`: Generate live tutorials and build live site.
26-
- `./run node yarn run build-site`: Build site to `build` folder.
27-
- `./run node yarn run build-tutorials`: Generate live tutorials.
28-
- `./run node yarn run polymer [args]`: Run a command through Polymer.
24+
- `./run exec yarn run serve-live`: Run local server with live content.
25+
- `./run exec yarn run build-all`: Generate live tutorials and build live site.
26+
- `./run exec yarn run build-site`: Build site to `build` folder.
27+
- `./run exec yarn run build-tutorials`: Generate live tutorials.
28+
- `./run exec yarn run start-server`: Start sever with production config.
29+
- `./run exec yarn run polymer [args]`: Run a command through Polymer.
2930

3031

3132
### Running without Docker
@@ -48,10 +49,12 @@ $ bower install
4849
#### Quick start
4950

5051
Start up a local server which watches the `examples` folder:
52+
5153
``` bash
52-
$ ./yarn run serve examples
54+
$ yarn run serve ./examples
5355
```
54-
The `examples` in the command can be replaced with another path.
56+
57+
The `./examples` in the command can be replaced with another path.
5558

5659

5760
#### Usage
@@ -63,14 +66,13 @@ Scripts are set up through the `package.json` file and run through Yarn:
6366
- `yarn run serve-live`: Run local server with live content.
6467
- `yarn run build-site`: Build site to `build` folder.
6568
- `yarn run build-tutorials`: Generate live tutorials.
69+
- `yarn run start-server`: Generate live tutorials.
6670
- `yarn run polymer [args]`: Run a command through Polymer.
6771

6872

6973
## Building Your Application
7074

71-
Running the build command will generate a `build/` folder with `bundled/` and `unbundled/` sub-folders
72-
containing a bundled (Vulcanized) and unbundled builds, both run through HTML,
73-
CSS, and JS optimizers.
75+
Running the build command will generate a `build/` folder with `bundled/` and `unbundled/` sub-folders containing bundled (Vulcanized) and unbundled builds. These builds are run through HTML, CSS, and JS optimizers.
7476

7577

7678
## Dependency management
@@ -82,17 +84,25 @@ When updating NPM packages, please use `yarn add` rather than `npm install`. As
8284

8385
## Technology
8486

85-
tutorials.ubuntu.com is built with Google's Polymer, using web components. You can find information about these at the following links:
8687

87-
- https://www.polymer-project.org/1.0/
88-
- https://www.webcomponents.org/community/articles/why-web-components
88+
### Build tools
89+
90+
The build tool for Tutorials is managed in the [ubuntu/tutorial-deployment](https://github.com/ubuntu/tutorial-deployment) repository. This is used to convert the markdown source files into HTML during the build step, using [Google's `claat`](https://github.com/googlecodelabs/tools/tree/master/claat). It is also used to run a development server which automatically rebuilds tutorials as you work on them.
8991

92+
### API
93+
The `api` folder contains static json metadata which is created during build.
9094

91-
### Our build tools
95+
This `tutorial-deployment` tool creates `./api/codelabs.json` which contains json metadata for all the tutorials. During the build step, some smaller API files are generated with `./bin/build-api-feeds`. These files list recent tutorials by category.
96+
97+
### Website
98+
99+
tutorials.ubuntu.com is built with Google's Polymer, using web components. You can find information about these at the following links:
92100

93-
Our tooling used to serve and generate this project is available at our [Ubuntu tutorial deployment repository](https://github.com/ubuntu/tutorial-deployment).
101+
- https://www.polymer-project.org/1.0/docs/
102+
- https://www.webcomponents.org/community/articles/why-web-components
94103

104+
The website app has a primary entrypoint at `./src/ubuntu-tutorials-app.html`. All traffic to the app is routed through this file and it manages the routing and state. When the website is loaded the primary `api/codelabs.json` is loaded and used to provide metadata to the website components.
95105

96-
### Google's claat
106+
Tutorials are loaded via AJAX and pushed into the page as required. It loads them via URL, which are served as files from this website. These sources could be moved to a seperate server as needed, being wary of [cross origin policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
97107

98-
Underneath the `codelabs` command, we are using [Google's `claat`](https://github.com/googlecodelabs/tools/tree/master/claat). In that repository, you will find information on the tool and how to download it.
108+
During the build step, the website is compiled and built into the `build` folder. This folder contains multiple builds for different browser compatibilities which can be customised in the `./polymer.json` file. The Polymer server serves the best version depending on the browser. For example, if the browser does not support the latest ES6 features Polymer will serve the bundle with polyfills to support it.

images/Helpful-no-24px.svg

Lines changed: 0 additions & 20 deletions
This file was deleted.

images/Helpful-unsure-24px.svg

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)