This repo is used as a template to create and publish AI Alliance “microsites”. It is setup as a GitHub template repo, which you can use to create a new repo. Even if you aren't creating a microsite, you can use this procedure to create a new AI Alliance repo for other purposes. Just delete the docs directory after creating the repo and skip the steps that don't apply to you.
See also GITHUB_PAGES.md, which has more advanced instructions for developers.
These are the main steps, with details below:
Tip
If you choose not to do some of the steps now, for example publishing the GitHub pages website immediately (see step 8), create an Issue in the repo for each step to be done later, as a reminder.
- Create your repo from the this template repo.
- (Optional) Create a project (i.e., a dashboard) to track your work. Click the Project tab in the repo GitHub page and then either click the + New project+ button or if you want your project to join an existing dashboard, click the Link a project button and find the correct project. By default, project #39, Misc. Alliance Tasks, will be used in the next step.
- Convert placeholder template variables in many files to the correct values, using the
finish-microsite.shscript. Runfinish-microsite.sh --helpfor details or see the expanded description below.- These local changes were pushed upstream by
finish-microsite.sh, unless you used the--no-pushargument. If so, push your local changes upstream when ready.
- These local changes were pushed upstream by
- Modify the "header buttons" in
docs/_includes/header_buttons_custom.htmlto be what you want to appear at the top of each page. See the OTDI site for an example customization. Or if you don't want any buttons, delete the contents of that file (but don't delete the file...).- Note that anchor tags with external links should include
target="_blank", while internal links, like the link in the file to Join This Project don't use external targets.
- Note that anchor tags with external links should include
- Add your initial custom content for the pages in the
docsdirectory. Delete the files you don't use, e.g.,second_page.markdownand thenestedfolder. (They are there to provide examples.) - Add your initial custom content to the
README.md. - If you plan to publish the website from the
latestbranch, merge changes to that branch frommain. - Edit the repo's Settings.
- On the repo's home page in GitHub, click the Settings "gear" on the upper right-hand side.
- Scroll down to Features and click Discussions to enable them (unless you don't want them; in this case, remove the URL on the
docs/contributing.markdownpage!).- Click the green Setup discussions button, then edit and submit the "welcome" message. (The default is usually fine.)
- Click the checkbox labeled Require contributors to sign off on web-based commits Loading. (Under the Commits part of the page, near the bottom.)
- On the left-hand side, click the link for Pages. Under Branch, select the
mainorlatestbranch depending on which one you want to use, then select the/docsdirectory. (NOTE: Make sure the repo is public or else the pages won't get published.) The public URL will be https://the-ai-alliance.github.io/REPO_NAME
- Add the website description and URL in the appropriate location on the Alliance GitHub organization README files and the Alliance GitHub website. (See Need Help? below...)
- Delete the files
README-instructions.md,finish-microsite.sh, and any of theLICENSE.*files that don't apply to your project. - Final steps: If you are using a separate publication branch, e.g.,
latest, don't forget to merge all changes frommainto the publication branch and push both branches upstream, e.g.,git push --all(when using the CLI in a terminal).
You should now have a published website!
Note
We are planning to automate as many of the manual steps as we can.
Let's look at these steps in more detail.
- Go to the
microsite-templaterepo. - Click the right hand-side green button Use this template and select Create a new repository.
- Select The-AI-Alliance as the owner account.
- Enter a unique name for the new repo. I'll use
ai-for-evil-projectas an example here. - Enter a description (recommended but optional).
- Select public or private. You will need the repo to be public to publish a website from it, but you may choose to keep it private initially.
- click Create repository.
See these GitHub instructions for more details.
This step is optional; do it if you want to specify a particular dashboard to manage your issues backlog. While in your GitHub repo, click the Projects tab and either create a new project using the +New project button or associate an existing project with your repo using the Link a project button to browse the list of current projects and pick one to use.
If you don't specify a project in the next step of this process, the default will be used, #39: Misc. Alliance Tasks.
If you don't want to use a dashboard at all, relying instead on the issues list in the repo, then search the *.markdown files and the .github/**/*/yaml files for references to a "dashboard" and delete them.
If you create a new project or decide to use a different one from the default, note the dashboard number in the URL; you'll need it for the next step.
At this time, the project number N is used in the following places:
1. The projects: [The-AI-Alliance/N] entries in .github/ISSUE_TEMPLATE/*.yaml files.
1. The line in docs/contributing.markdown with See also the [project board](https://github.com/orgs/The-AI-Alliance/projects/N/).
Note
This step is the only one where you need to work locally on your laptop, vs. working through the GitHub UI. It won't be feasible on Windows machines. If you have any problems doing this step, ask Dean Wampler for help.
Now you have to use the git command-line tool, which is built into MacOS, to clone your repo locally and run a script that replaces placeholder variables with the values that are correct for your repo.
Open the terminal application. It will show a command prompt at your home directory, e.g., /Users/deanwampler for Dean Wampler.
Type in the following command for your repo:
git clone https://github.com/The-AI-Alliance/REPO_NAME.git
cd REPO_NAMEHere cd is the change directory command that changes your current working directory to be the root directory of the repo you just cloned.
Now, if you are using this repo for a website, all the website content is under the docs directory. However, the script also edits the top-level README.md, Makefile, and possibly other files.
Your new repo will have placeholder values for the project name, associated focus area, etc. We'll fix those values using the "shell" script finish-microsite.sh, which replaces the placeholder variables with appropriate strings for your project.
To see the available required and optional arguments, run this command:
./finish-microsite.sh --helpIf you run the script without any arguments, it will prompt you for all the values. There are a lot of them, but only the first few values require your input; default values are shown for all the others, which are usually sufficient:
./finish-microsite.sh You can also specify the required arguments directly, which is faster if you know what to use. Currently, there is only one required argument, the human-readable title for the website. For example, for a repo named ai-for-evil-project, the required command would be the following:
./finish-microsite.sh --microsite-title "AI for Evil Project" Note
The title has to be in quotes if it has nested white space.
Additionally, the following information is important:
Note
- The script will try to use
zsh. If you don't havezsh, but you havebashversion 5 or later, then usebash ./finish-microsite.sh ...to run the script. - To see the current list of required and optional arguments, run the script with the
--helpflag. - By default, the website will be published from the
mainbranch. If you prefer to use a different branch, we have usedlatestas a convention for many of the microsites. In this case, add the flag--use-latest. If you prefer to use a different branch nameBRANCH, use--publish-branch BRANCH. - The script replaces the content of
README.mdwith the content formREADME-template.md(modified with variables replaced), and removesREADME-template.mdfrom the repo.
Warning
After the script makes changes, it pushes them from the local repo to the upstream repo in GitHub. If you don't want to do that, preferring to push changes upstream later, then add the option --no-push. Pushing upstream may fail depending on how your personal GitHub account is configured, etc. Talk to Dean Wampler if you have problems here.
Note
From this point forward, all the subsequent steps can be done on the GitHub UI for your repo.
There are purple "header buttons" that appear on all pages in the website. You can see examples in existing websites, e.g., OTDI. The buttons are defined as HTML anchor tags (<a href="...">...</a>) in the file docs/_includes/header_buttons_custom.html.
Note that any anchor tags with external links should include target="_blank", while internal links, like the default button link in the file for Join This Project, don't use external targets.
Edit this file to define buttons that work for you. If you don't want any buttons, delete the contents of the file, but don't delete the file.
There are various TODO and example "idioms" in the docs/**/*.markdown, README.md, and other files that you should replace with your real content as soon as possible, e.g.,
- Find and replace all occurrences of
TODOwith appropriate content. - Rename or delete the
second_page.markdown. Copy it to add more top-level pages, but change thenav_orderfield to control the order of the pages shown in the left-hand side navigation view. - Rename or delete the
nestedfolder and its contents, which is an example of how to create nested content.
Tip
Start with 10, 20, etc. for the nav_order of top-level pages, giving yourself room to insert new pages in between existing pages. For nested pages, e.g., under 20, use 210, 220, etc.
- See the
nesteddirectory content as an example of how to do nesting. Note that the metadata fields at the top also define theparentandhas_childrenfields. - Make any changes you want to make in the
docs/_config.ymlfile. (None are mandatory.)
For more tips and guidance on development tasks, see also the links for more information in the README.md in your new repo. Add a project-specific description at the beginning of that file.
The README.md contains useful boilerplate for contributors, but the preamble at the beginning should be customized with useful "welcome" information about the project.
By default, the website is published from the main branch, for convenience. However, if you chose to use the latest branch or another branch (see step 2. above), you'll need to merge the changes in main to that branch. We won't provide instructions here, as this is a standard developer practice. However, ask one of the developers on the team for help if needed.
To publish the website and setup some other repo features, click the Settings "gear" on the upper right-hand side of the repo's top-level page.
We require DCO ("Developer Certificate of Origin") checks for all commits. Setting this checkbox turns this on automatically for users making repo edits in the GitHub Web UI.
Scroll down to Features and click Discussions to enable them. Click the Set up discussions button and edit the first discussion topic to taste, then post it.
However, if you don't want to enable discussions, then remove the URL on the docs/contributing.markdown page.
On the left-hand side of the Settings, click the link for Pages. Under Branch, select your publication branch, either main, latest, or a custom branch you specified above. Then select the /docs directory and finally, click Save.
Your website should be published after a few minutes to `https://the-ai-alliance.github.io/REPO_NAME/``.
Tip
At the top of the repo page, click Actions to see the progress of building your website. This action will be executed every time you make a change to a file in your publication branch (i.e., main by default). If for some reason building the website fails, this page can provide useful debugging help.
Note
This step applies for code repos, not just documentation repos.
Add the website to the Alliance GitHub organization README and the Alliance GitHub Pages website.
When you are ready for broader exposure for your site, there are a few places where we have an index to all the “microsites” and some code-centric projects without microsites.
- First find the best place in the https://github.com/The-AI-Alliance/ (
README.mddirect link) or one of the other related Markdown files. - Make the same change in the corresponding
*.markdownpage in the GitHub organization microsite: https://the-ai-alliance.github.io/ (index.markdowndirect link or sibling pages.)
Note
You only need to edit the appropriate .github file (step #1), because we can automatically propagate the changes to the second file.
- Find the right section in the
README.mdor related page where your project belongs. - Find the correct table row in the section where it should be inserted.
- Copy the two rows (
<tr>...</tr>) either above or below this point and insert them. - Edit all the details in the rows accordingly for your project. Note that if you didn't create a project dashboard in the previous step, you will delete that item in one of the table cells (
<td>...</td>). You may decide to add or remove other links, too.
After editing the .github page, notify Dean Wampler (email, Slack), who will run a tool that will copy the changes to the https://the-ai-alliance.github.io/ site. (This process is described in the the-ai-alliance.github.io repo.)
10. Delete the files README-instructions.md, finish-microsite.sh, and any of the LICENSE.* files that don't apply to your project.
The first two files,README-instructions.md (this file!) and finish-microsite.sh, are no longer needed, so you can remove them from your repo. Select each one in the GitHub UI and click the ... menu on the upper right-hand side, then select Delete file.
Similarly, you may not need all three LICENSE.* files:
LICENSE.Apache-2.0: Recommended for code.LICENSE.CC-BY-4.0: Recommended for documentation.LICENSE.CDLA-2.0: Recommended for datasets.
If you are using a separate publication branch, e.g., latest, don't forget to merge all changes from main to the publication branch and push both branches upstream, e.g., git push --all (when using the CLI in a terminal).
You should now have a published website and you should know how to edit the content.
Reach out to Dean Wampler (email, Slack), Joe Olson (email, Slack), or Adam Pingel (email, Slack) if you need help.
