-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: build 11ty site for tutorial and statement of work #19
Open
bennypowers
wants to merge
16
commits into
redhat-beyond:main
Choose a base branch
from
bennypowers:docs/11ty
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8423df4
chore: initial 11ty setup
bennypowers dc87f60
mentors: statements of work
bennypowers 66cbc0c
tutorial: intro
bennypowers e89c5a9
tutorial: part 1 git and github
bennypowers 3c6b5a8
tutorial: part 2 vagrant and virtualbox
bennypowers f28ba72
tutorial: part 3 django environment
bennypowers dcba3b2
tutorial: part 4 ci
bennypowers 0651b7c
tutorial: part 5 adding features
bennypowers 799aa85
docs: copy button for code blocks
bennypowers 538b4b9
docs: improve nav styles
bennypowers fedad2b
style: html indenting
bennypowers 48bb948
docs: remove typo from README.md
bennypowers 9f3935c
docs: update README.md
bennypowers a2af91f
refactor: move footer shortcode to plugin
bennypowers 5da74b7
refactor: rename alert shortcode
bennypowers 35c9ccc
fix: don't load upstream 11ty plugins twice
bennypowers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const YAML = require('yaml') | ||
const RHDSPlugin = require('./_plugins/rhds.cjs'); | ||
|
||
module.exports = function(eleventyConfig) { | ||
eleventyConfig.addDataExtension('yaml', x => YAML.parse(x)); | ||
eleventyConfig.addPassthroughCopy('assets'); | ||
eleventyConfig.addPassthroughCopy('tutorial/**/*.{png,jpg,jpeg,svg}'); | ||
eleventyConfig.addPlugin(RHDSPlugin); | ||
|
||
return { | ||
templateFormats: [ | ||
'md', | ||
'njk', | ||
'html', | ||
], | ||
markdownTemplateEngine: 'njk', | ||
htmlTemplateEngine: 'njk', | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "@patternfly/elements", | ||
"parserOptions": { | ||
"sourceType": "script" | ||
}, | ||
"env": { | ||
"node": true, | ||
"commonjs": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
name: Deploy GH Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy-pages: | ||
runs-on: ubuntu-latest | ||
name: Build site and deploy to GHPages | ||
env: | ||
ELEVENTY_PATH_PREFIX: '/${{ github.event.repository.name }}/' | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: npm | ||
|
||
- name: Install project modules | ||
run: npm ci | ||
|
||
- name: Build site 1st attempt | ||
continue-on-error: true | ||
id: firstBuild | ||
env: | ||
SITE_GITHUB_TOKEN: "${{ secrets.SITE_GITHUB_TOKEN }}" | ||
run: npm run build | ||
|
||
- name: Build site 2nd attempt | ||
if: steps.firstBuild.outcome == 'failure' | ||
env: | ||
SITE_GITHUB_TOKEN: "${{ secrets.SITE_GITHUB_TOKEN }}" | ||
run: npm run build | ||
|
||
- name: Configure git | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
|
||
- name: Checkout pages branch | ||
run: | | ||
git checkout gh-pages | ||
git pull origin gh-pages | ||
|
||
- name: Copy new files | ||
run: cp -rf _site/* . | ||
|
||
- name: Count changed | ||
id: git_status | ||
run: | | ||
changedCount=$(git status --porcelain=v1 --short --untracked-files=all | wc -l) | ||
echo "::set-output name=changedCount::$changedCount" | ||
|
||
- name: Push generated site | ||
if: steps.git_status.outputs.changedCount > 0 | ||
run: | | ||
git add . | ||
git commit -m "docs: deployed to gh-pages for ${{ github.ref }}" | ||
git push origin gh-pages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
--- | ||
name: PR site preview | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
paths-ignore: | ||
- '.github/**' | ||
|
||
concurrency: | ||
group: preview-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
build-site-preview: | ||
runs-on: ubuntu-latest | ||
name: Build site preview | ||
if: contains(fromJson('["opened", "reopened", "synchronize"]'), github.event.action) | ||
env: | ||
ELEVENTY_PATH_PREFIX: '/${{ github.event.repository.name }}/pr-previews/pr-${{ github.event.number }}/' | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: npm | ||
|
||
- name: Install project modules | ||
run: npm ci | ||
|
||
- name: Build site 1st attempt | ||
continue-on-error: true | ||
id: firstBuild | ||
env: | ||
SITE_GITHUB_TOKEN: "${{ secrets.SITE_GITHUB_TOKEN }}" | ||
run: npm run build | ||
|
||
- name: Build site 2nd attempt | ||
if: steps.firstBuild.outcome == 'failure' | ||
env: | ||
SITE_GITHUB_TOKEN: "${{ secrets.SITE_GITHUB_TOKEN }}" | ||
run: npm run build | ||
|
||
- name: Configure git | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
|
||
- name: Checkout pages branch | ||
run: git checkout gh-pages | ||
|
||
- name: Create preview target | ||
run: | | ||
mkdir -p pr-previews/pr-${{ github.event.number }} | ||
cp -rf _site/* pr-previews/pr-${{ github.event.number }} | ||
|
||
- name: Remove robots.txt from preview | ||
run: rm pr-previews/pr-${{ github.event.number }}/robots.txt | ||
|
||
- name: Count changed | ||
id: git_status | ||
run: | | ||
changedCount=$(git status pr-previews/pr-${{ github.event.number }} --porcelain=v1 --short --untracked-files=all | wc -l) | ||
echo "::set-output name=changedCount::$changedCount" | ||
|
||
- name: Push preview target | ||
if: steps.git_status.outputs.changedCount > 0 | ||
run: | | ||
git add pr-previews/pr-${{ github.event.number }} | ||
git commit -m "docs: deployed preview for pr #${{ github.event.number }}" | ||
git push origin gh-pages | ||
|
||
- name: Create a preview link | ||
if: steps.git_status.outputs.changedCount > 0 | ||
id: pr_preview | ||
run: | | ||
repoName="${{ github.event.repository.name }}" | ||
cnameFile="CNAME" | ||
if [ -f "$cnameFile" ]; then | ||
cname=$(<$cnameFile) | ||
echo "::set-output name=link::https://$cname/$repoName/pr-previews/pr-${{ github.event.number }}/" | ||
else | ||
owner="${{ github.event.repository.owner.login }}" | ||
echo "::set-output name=link::https://$owner.github.io/$repoName/pr-previews/pr-${{ github.event.number }}/" | ||
fi | ||
|
||
- name: Comment with the preview link | ||
if: steps.git_status.outputs.changedCount > 0 | ||
uses: marocchino/[email protected] | ||
with: | ||
header: site-preview | ||
message: | | ||
:rocket: Deployed site preview ${{ steps.pr_preview.outputs.link }} | ||
|
||
* will be up and ready in a couple of minutes. | ||
|
||
remove-site-preview: | ||
runs-on: ubuntu-latest | ||
name: Remove site preview | ||
if: ${{ github.event.action == 'closed' }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure git | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
|
||
- name: Checkout pages branch | ||
run: git checkout gh-pages | ||
|
||
- name: Remove preview target | ||
continue-on-error: true | ||
run: | | ||
rm -r pr-previews/pr-${{ github.event.number }} | ||
git add pr-previews/pr-${{ github.event.number }} | ||
git commit -m "docs: removed preview for pr #${{ github.event.number }}" | ||
git push origin gh-pages | ||
|
||
- name: Remove the preview link comment | ||
uses: marocchino/[email protected] | ||
with: | ||
header: site-preview | ||
delete: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
assets/@rhds | ||
_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Red Hat Beyond | ||
Red Hat's mentoring program for Computer Science students. | ||
This repository contains various pieces of documentation including | ||
instructions for mentors and parts of the course content. | ||
|
||
The documents in this repository are written in [GitHub-Flavored Markdown][gfm] | ||
with some additional shortcodes which apply [Red Hat's Design and Branding Guidelines][ux]. | ||
|
||
## Contributing | ||
|
||
Contributions to the documentation are welcome. Please draft a focused, limited pull request | ||
with your changes. Deploy previews are generated for each PR, so after pushing your changes, a link | ||
to the preview will appear in the PR thread after a few minutes. | ||
|
||
Red Hat Beyond uses [eleventy][11ty] to generate web pages from our markdown sources. | ||
|
||
### Running Locally | ||
|
||
If you would like to preview your changes on your local development machine while working on them, | ||
You may run the [eleventy dev server][dev]. Changes to content will cause the localhost preview to | ||
automatically refresh. | ||
|
||
#### Prerequisites | ||
|
||
In order to run the dev server, you must have [Node.js][node] v16 or greater installed. | ||
We recommend using [nvm][nvm] to manage node versions on your development machine. | ||
|
||
Once node is installed, run the following command to download development dependencies to the | ||
project's `node_modules` folder. | ||
|
||
```shell | ||
npm ci | ||
``` | ||
Once that command has completed, you may start the dev server with the following command: | ||
|
||
```shell | ||
npm start | ||
``` | ||
|
||
This will launch the dev server at http://localhost:8080 (assuming port 8080 is available). | ||
Open that link in your web browser to view the preview. | ||
|
||
[gfm]: https://github.github.com/gfm/ | ||
[ux]: https://ux.redhat.com/ | ||
[11ty]: https://11ty.dev/ | ||
[dev]: https://www.11ty.dev/docs/watch-serve/ | ||
[node]: https://nodejs.org/ | ||
[nvm]: https://github.com/nvm-sh/nvm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
socialLinks: | ||
- icon: linkedin | ||
href: https://www.linkedin.com/company/red-hat | ||
content: LinkedIn | ||
- icon: youtube | ||
href: https://www.youtube.com/user/RedHatVideos | ||
content: Youtube | ||
- icon: facebook | ||
href: https://www.facebook.com/redhatinc | ||
content: Facebook | ||
- icon: twitter | ||
href: https://twitter.com/RedHat | ||
content: Twitter | ||
- icon: github | ||
href: https://github.com/redhat-israel | ||
content: GitHub | ||
|
||
links: | ||
- heading: המוצרים שלנו | ||
links: | ||
- href: https://www.redhat.com/en/technologies/management/ansible | ||
content: Red Hat Ansible Automation Platform | ||
- href: https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux | ||
content: Red Hat Enterprise Linux | ||
- href: https://www.redhat.com/en/technologies/cloud-computing/openshift | ||
content: Red Hat OpenShift | ||
- href: https://www.redhat.com/en/technologies/cloud-computing/openshift-data-foundation | ||
content: Red Hat OpenShift Data Foundation | ||
- href: https://www.redhat.com/en/technologies/linux-platforms/openstack-platform | ||
content: Red Hat OpenStack Platform | ||
- href: https://www.redhat.com/en/technologies/all-products | ||
content: See all products | ||
|
||
- heading: צרו קשר | ||
links: | ||
- href: https://www.redhat.com/en/contact | ||
content: כתבו לנו | ||
- href: https://www.redhat.com/en/about/feedback | ||
content: שלחו לנו פידבק | ||
- href: https://www.redhat.com/en/about/social | ||
content: עקבו אחרינו ברשתות החברתיות | ||
|
||
|
||
secondary: | ||
- heading: רד האט | ||
content: | | ||
רד האט היא החברה המובילה בעולם לפתרונות תוכנה מבוססי קוד פתוח לארגוני Enterprise. | ||
רד האט מבוססת על כוחה של קהילת הקוד הפתוח בפיתוח ואספקת טכנולוגיות Linux, Cloud, Container, ו-Kubernetes. | ||
אנחנו מסייעים ללקוחות לשלב בין יישומי IT חדשים וקיימים, לפתח יישומים רב-ענניים | ||
(multi-cloud), לבצע סטנדרטיזציה של מערכת ההפעלה, יחד עם אוטומציה, אבטחה וניהול של סביבות מורכבות. | ||
|
||
globalLinks: | ||
- href: "https://www.redhat.com/en/about/privacy-policy" | ||
content: הצהרת פרטיות | ||
- href: "https://www.redhat.com/en/about/terms-use" | ||
content: תנאי שימוש | ||
- href: "https://www.redhat.com/en/about/digital-accessibility" | ||
content: נגישות דיגיטלית | ||
# needs client-side js | ||
# - href: "#" | ||
# content: הגדרות עוגיות |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this for beyond?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can either:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we leave this for a subsequent PR?