- 
                Notifications
    You must be signed in to change notification settings 
- Fork 12
docs: build 11ty site for tutorial and statement of work #19
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
base: main
Are you sure you want to change the base?
Changes from 8 commits
8423df4
              dc87f60
              66cbc0c
              e89c5a9
              3c6b5a8
              f28ba72
              dcba3b2
              0651b7c
              799aa85
              538b4b9
              fedad2b
              48bb948
              9f3935c
              a2af91f
              5da74b7
              35c9ccc
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| const YAML = require('yaml') | ||
| const EleventyNavigationPagination = require("@11ty/eleventy-navigation"); | ||
| const EleventySyntaxHighlightPlugin = require("@11ty/eleventy-plugin-syntaxhighlight"); | ||
| const RHDSPlugin = require('./_plugins/rhds.cjs'); | ||
| const { EleventyRenderPlugin } = require('@11ty/eleventy') | ||
|  | ||
| module.exports = function(eleventyConfig) { | ||
| eleventyConfig.addDataExtension('yaml', x => YAML.parse(x)); | ||
| eleventyConfig.addPassthroughCopy('assets'); | ||
| eleventyConfig.addPassthroughCopy('tutorial/**/*.{png,jpg,jpeg,svg}'); | ||
|  | ||
| eleventyConfig.addPlugin(EleventySyntaxHighlightPlugin); | ||
| eleventyConfig.addPlugin(EleventyNavigationPagination); | ||
| eleventyConfig.addPlugin(EleventyRenderPlugin); | ||
| eleventyConfig.addPlugin(RHDSPlugin); | ||
|  | ||
| return { | ||
| templateFormats: [ | ||
| 'md', | ||
| 'njk', | ||
| 'html', | ||
| ], | ||
| markdownTemplateEngine: 'njk', | ||
| htmlTemplateEngine: 'njk', | ||
| } | ||
| } | 
| 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 | ||
| } | ||
| } | 
| 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 | ||
|  | 
| 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 | ||
|  | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node_modules | ||
| assets/@rhds | ||
| _site | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ## Running Locally | ||
| ### Prerequisites | ||
| Node > v16 (it's recommended to use nvm) | ||
|  | ||
| ```bash | ||
| npm ci | ||
| npm run start | ||
| `````` | ||
| 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 | ||
| 
      Comment on lines
    
      +18
     to 
      +32
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. can we leave this for a subsequent PR? | ||
|  | ||
| - 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: הגדרות עוגיות | ||
Uh oh!
There was an error while loading. Please reload this page.