Skip to content

Commit 9730256

Browse files
author
Luke Sneeringer
committed
chore: Add the skeleton structure for an AIP site.
1 parent b4d459e commit 9730256

16 files changed

Lines changed: 926 additions & 0 deletions

.dockerignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Version control scaffolding
2+
.git
3+
.gitignore
4+
5+
# Docker scaffolding
6+
Dockerfile
7+
.dockerignore
8+
9+
# Translations
10+
*.mo
11+
12+
# Mac
13+
.DS_Store
14+
15+
# Mr Developer
16+
.mr.developer.cfg
17+
.project
18+
.pydevproject
19+
20+
# JetBrains
21+
.idea
22+
23+
# Built documentation
24+
docs/_build
25+
docs/_build_doc2dash
26+
27+
# Virtual environment
28+
env/
29+
coverage.xml
30+
31+
# Jekyll metadata
32+
.jekyll-metadata

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# pytest
2+
site/.coverage
3+
site/.pytest_cache
4+
site/htmlcov
5+
6+
# mypy
7+
.mypy_cache

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_includes/aip-nav.html
2+
_includes/svgs.html
3+
_sass/colors.scss

.prettierrc.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
printWidth: 79
3+
proseWrap: always
4+
singleQuote: true
5+
trailingComma: es5

CONTRIBUTING.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Contributing
2+
3+
We'd love to accept your patches and contributions to this project.
4+
5+
## Development Environment
6+
7+
If you are contributing AIP content (rather than code) and want to be able to
8+
view it in your browser, the easiest way to do so is to run the provided
9+
development server.
10+
11+
We use [GitHub Pages][1] to make this documentation available, and a specific
12+
[site generator][2] to build the site.
13+
14+
If you have [Docker][3] installed, clone this repository and run the `serve.sh`
15+
file at the root of the repository. This script does two things:
16+
17+
- It builds the provided Docker image (unless you already have it) and tags it
18+
as `aip-site`.
19+
- It runs the `aip-site` image.
20+
21+
The development server uses port 4000; point your web browser to
22+
`http://localhost:4000`, and you should see the site.
23+
24+
**Note:** After building the Docker image for the first time, you may
25+
experience issues if Python dependencies change underneath you. If this
26+
happens, remove your Docker image (`docker rmi aip-site`) and run `serve.sh`
27+
again.
28+
29+
### Arguments
30+
31+
Any arguments provided to `serve.sh` (or `docker run`) are forwarded (however,
32+
the current site generator does not honor any; this may change in the future).
33+
34+
### Hot reloading
35+
36+
The development server recognizes when files change (including static files)
37+
and local changes will be automatically reflected in your browser upon reload.
38+
39+
### Local Installation
40+
41+
It is possible to run the development server locally also. The general gist of
42+
how to do so correctly is:
43+
44+
- Install Python 3.8 if you do not already have it (direct install is fine, but
45+
[pyenv][5] is probably the best way if you have other Python projects).
46+
- Create a Python 3.8 [venv][6]. Once it is created, activate it in your shell
47+
(`source path/to/venv/bin/activate`).
48+
- `pip install git+https://github.com/aip-dev/site-generator.git`
49+
- `aip-site-serve .`
50+
51+
## Contributor License Agreement
52+
53+
Contributions to this project must be accompanied by a Contributor License
54+
Agreement. You (or your employer) retain the copyright to your contribution,
55+
this simply gives us permission to use and redistribute your contributions as
56+
part of the project. Head over to <https://cla.developers.google.com/> to see
57+
your current agreements on file or to sign a new one.
58+
59+
You generally only need to submit a CLA once, so if you have already submitted
60+
one (even if it was for a different project), you probably do not need to do it
61+
again.
62+
63+
## Code reviews
64+
65+
All submissions, including submissions by project members, require review. We
66+
use GitHub pull requests for this purpose. Consult
67+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
68+
information on using pull requests.
69+
70+
### Formatting
71+
72+
We use [prettier][4] to format Markdown, JavaScript, and (most) HTML, in order
73+
to ensure a consistent style throughout our source. You can add prettier as a
74+
plugin in most development environments.
75+
76+
[1]: https://pages.github.com/
77+
[2]: https://github.com/aip-dev/site-generator
78+
[3]: https://docker.com/
79+
[4]: https://prettier.io/
80+
[5]: https://github.com/pyenv/pyenv
81+
[6]: https://docs.python.org/3/library/venv.html

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM python:3.8-alpine
2+
3+
# Define the working directory.
4+
# Note: There is no code here; it is pulled from the repository by mounting
5+
# the directory (see `serve.sh`).
6+
WORKDIR /code/
7+
8+
# Install Python packages for this project.
9+
COPY requirements.txt /code/requirements.txt
10+
RUN apk add git && \
11+
pip install -r requirements.txt && \
12+
apk del git
13+
14+
# Set environment variables.
15+
ENV FLASK_ENV development
16+
17+
# Expose appropriate ports.
18+
EXPOSE 4000
19+
EXPOSE 35729
20+
21+
# Run the development server.
22+
# Reminder: Use -p with `docker run` to publish ports (see `serve.sh`).
23+
ENTRYPOINT ["aip-site-serve", "."]

0 commit comments

Comments
 (0)