Source for creativecommons.github.io
⚠️ DO NOT MAKE CHANGES TO THE creativecommons/creativecommons.github.io REPO DIRECTLY.
This site is built using Lektor. All changes to opensource.creativecommons.org (creativecommons.github.io) must be made here and deployed via lektor (see Deployment, below).
The Creative Commons team is committed to fostering a welcoming community. This project and all other Creative Commons open source projects are governed by our Code of Conduct. Please report unacceptable behavior to [email protected] per our reporting guidelines.
See CONTRIBUTING.md
.
- See Contributors to creativecommons/creativecommons.github.io-source for a list of authors and their contributions to this project 😊
Make sure you have:
To install these, execute the following commands:
- macOS:
- Install Homebrew
- Install pipenv and node:
brew install pipenv node
- GNU/Linux:
- Installing Pipenv
- Install Node.js (or see the detailed instructions)
- Upate packges:
sudo apt update
- Install npm:
sudo apt install npm
- Clone this repository.
- Open your command line interface change directories to the repository root directory.
- Create a Python virtual environment and install the requirements for this
project:
pipenv install --dev
pipenv
doesn't always provide the best error messages (Provide better error
message if the project’s virtual environment is broken). If all
else fails, try removing the virtual environment and reinstalling:
- Remove virtual environment:
pipenv --rm
- Install virtual environment (including dev packages):
pipenv install --dev
- Start the Lektor development server:
pipenv run lektor server -f webpack
- You will be able to see the website at
127.0.0.1:5000/
.- The Lektor server will rebuild the site every time you change any content.
-
Should you get series of type errors that looks something like
npm ERR! typeerror Error: Missing required argument #1
, after runningpipenv run lektor server -f webpack
, this is most likely due to running an older version of Node.js.As stated above in Prerequisites, you should be running Node.js version 12+.
-
Should you get an
OSError: [Errno 28] inotify watch limit reached
after running any command, this means that your system file watcher is running out of allotted handles, usually because the workspace is large and contains many files.The solution is to run:
sudo sysctl fs.inotify.max_user_watches=524288
This increases your
inotify
watch limit (for the session) to 524288, which is the maximum value and is also enough to allow the setup go through. You can learn more about file watchers from this blog post or from the VS Code documentation.
We have continuous deployment set up. To deploy, push your code to the main
branch (or make a pull request against the main
branch. GitHub Actions
builds and deploys the site whenever it detects new commits on the main
branch.
The GitHub Actions configuration is located at
.github/workflows/lektor-build-deploy.yml
.
⚠️ For reference only, you should not need to not do this.
When you are ready to deploy a new version of the site, run lektor deploy
(assuming you have your GitHub SSH key already set up and you have access to
the creativecommons/creativecommons.github.io repository). That's
it, it's live on production!
Here's how the code is structured in the top level of the repository:
assets
: This directory contains the JavaScript and CSS files for the project built via webpack. Most of the JavaScript and CSS is third-party code and loaded via CDN so this is pretty empty.content
: The content of the site lives here. Here's an explanation of how content works in Lektor. This is probably what you'll be modifying most often.models
: All content in Lektor is associated with data models to define their schema. Currently, we only use the defaultpage
model that ships with Lektor.templates
: This is where the Jinja2 templates that render content are stored. See the Lektor template documentation for more information.webpack
: This is where all the webpack config files as well as Sass and JavaScript files for the project resides. The JavaScript and Sass files are compiled and saved in the assets folder during lektor build process.
- Lektor Plugins:
- nixjdm/lektor-atom: Lektor Atom plugin
- lektor/lektor-disqus-comments: Adds disqus comments to a Lektor website
- bancek/lektor-markdown-excerpt: Adds filter for Markdown body excerpt
- lektor/lektor-markdown-header-anchors: Adds support for anchors and table of contents to Markdown
- lektor/lektor-markdown-highlighter: Adds support for syntax highlighting in Markdown and templates
- terminal-labs/lektor-strip-html-tags: Strip HTML tags, effectively turning HTML into plain text
- lektor/lektor-webpack-support: Adds webpack support to lektor
/cc-vocabulary/
to https://cc-vocabulary.netlify.com/- Added so that the
opensource.creativecommons.org/cc-vocabulary/
will continue to work with that project moving to utilize Netlify.
- Added so that the
/cc-vue-vocabulary
to https://cc-vue-vocabulary.netlify.com/- Added so that the
opensource.creativecommons.org/cc-vue-vocabulary/
will continue to work with that project moving to utilize Netlify.
- Added so that the
/cc-fonts
to https://cc-fonts.netlify.com/- Added so that the
opensource.creativecommons.org/cc-fonts/
will continue to work with that project moving to utilize Netlify.
- Added so that the
The following load external data:
webpack/js/components.js
creativecommons/ccos-scripts/main/ccos/norm/labels.yml
creativecommons/ccos-scripts/main/ccos/norm/skills.yml
- GitHub Issues for the creativecommons organization using octokit - npm
All the content within this repository is licensed under a Creative Commons Attribution 4.0 International License unless otherwise specified.
This repository contains PNG icons that were converted from Font Awesome SVGs:
Font Awesome Free is free, open source, and GPL friendly. You can use it for commercial projects, open source projects, or really almost whatever you want. (Full Font Awesome Free license: https://fontawesome.com/license/free)
Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) In the Font Awesome Free download, the CC BY 4.0 license applies to all icons packaged as SVG and JS file types.