### Markdown Ordered List Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Demonstrates how to create an ordered list in Markdown. The numbering can be explicit or automatic by using '1.' for each item. ```markdown 1. Lorem ipsum dolor sit amet 2. Consectetur adipiscing elit 3. Integer molestie lorem at massa 4. Facilisis in pretium nisl aliquet 5. Nulla volutpat aliquam velit 6. Faucibus porta lacus fringilla vel 7. Aenean sit amet erat nunc 8. Eget porttitor lorem ``` ```markdown 1. Lorem ipsum dolor sit amet 1. Consectetur adipiscing elit 1. Integer molestie lorem at massa 1. Facilisis in pretium nisl aliquet 1. Nulla volutpat aliquam velit 1. Faucibus porta lacus fringilla vel 1. Aenean sit amet erat nunc 1. Eget porttitor lorem ``` -------------------------------- ### Markdown Table Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Provides an example of creating a table in Markdown using pipes (|) as column separators and dashes (-) for the header row separator. ```markdown | Option | Description | | ------ | ----------- | | data | path to data files to supply the data that will be passed into templates. | | engine | engine to be used for processing templates. Handlebars is the default. | | ext | extension to be used for dest files. | ``` -------------------------------- ### Install jq to /usr/local/bin (with sudo) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/Installjq.md These commands copy the downloaded jq executable to the /usr/local/bin directory, making it accessible system-wide, and then set the appropriate permissions for execution. This requires sudo privileges. ```bash sudo cp jq-linux64 /usr/local/bin/jq sudo chmod 755 /usr/local/bin/jq ``` -------------------------------- ### Install jq to ~/bin (without sudo) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/Installjq.md These commands copy the downloaded jq executable to a 'bin' directory within the user's home directory and set the appropriate permissions. This method is suitable for users without sudo access. ```bash cp jq-linux64 ~/bin/jq chmod 755 ~/bin/jq ``` -------------------------------- ### Execute Application Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/FailureSimulations/c Runs the application with provided arguments. The execution command differs between Linux/MacOS and Windows. ```bash ./AppResiliency args ``` ```cmd AppResiliency.exe args ``` -------------------------------- ### Verify jq Installation Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/Installjq.md This command checks if jq is installed and displays its version. If jq is not found, it indicates that the tool needs to be installed. ```bash jq --version ``` -------------------------------- ### Markdown Inline Code Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Shows how to format inline code snippets using single backticks (`). This is useful for short code fragments within a sentence. ```markdown In this example, `
` should be wrapped as **code**. ``` -------------------------------- ### Download Package using AWS CLI Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/FailureSimulations/c Downloads the application package from an S3 bucket to the local machine. Requires the AWS CLI to be installed and configured. ```bash aws s3 cp s3://bucket/csharpresiliency.zip ~/temp.zip ``` -------------------------------- ### Unzip Application Package Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/FailureSimulations/c Extracts the contents of the downloaded zip file. This command is common across Linux and MacOS. ```bash unzip ~/temp.zip ``` -------------------------------- ### Create New Hugo Project Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/basics/installation/_index.en.md Command to create a new Hugo website project. This is the initial step in setting up a new Hugo site. ```bash hugo new site ``` -------------------------------- ### Markdown Block Code Fences Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Demonstrates using triple backticks (```) to create a block code element. This is useful for multi-line code snippets. ```text Sample text here... ``` -------------------------------- ### Serve Hugo Website Locally Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/basics/installation/_index.en.md Command to launch a local development server for a Hugo website. This command allows for live preview and automatic refreshing as content changes. ```bash hugo serve ``` -------------------------------- ### Change Directory to Platform Specific Folder Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/FailureSimulations/c Navigates to the appropriate directory based on the operating system and architecture. This is a prerequisite for executing the application. ```bash cd ~/linux-x64 ``` ```bash cd ~/linux-arm64 ``` ```bash cd ~/osx-x64 ``` ```cmd cd ~/win10-x64 ``` -------------------------------- ### Make Executable on Linux/MacOS Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/FailureSimulations/c Grants execute permissions to the application file on Linux and MacOS systems. This is necessary before running the application. ```bash chmod +x AppResiliency ``` -------------------------------- ### Markdown Indented Code Block Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Illustrates creating an indented code block by indenting lines with at least four spaces. This preserves whitespace and formatting. ```text // Some comments line 1 of code line 2 of code line 3 of code ``` -------------------------------- ### Tabs Shortcode Usage Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/tab.html Demonstrates the basic structure and usage of the 'tabs' shortcode, including how to define multiple 'tab' shortcodes within it. This is the primary way to present multi-language code examples. ```Go Template {{< tabs name="Test" >}} {{< tab name="Tab1" >}} This is tab1 {{< /tab >}} {{< tab name="Tab2" >}} This is tab2 {{< /tab >}} {{< /tabs >}} ``` -------------------------------- ### Install jq using yum (Amazon Linux/RHEL) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/Installjq.md This command installs the jq package using the yum package manager, commonly found on Amazon Linux and Red Hat Enterprise Linux systems. ```bash sudo yum install jq ``` -------------------------------- ### Download jq executable (Linux) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/Installjq.md This command downloads the jq executable for 64-bit Linux systems from the official GitHub releases. The output shows the download progress and confirmation. ```bash wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 ``` -------------------------------- ### Install Hugo Learn Theme Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/README.md Instructions to clone the Hugo Learn Theme into the themes directory of a Hugo site using Git. Requires a Hugo version of at least 0.25. ```shell cd themes/ git clone https://github.com/matcornic/hugo-theme-learn.git ``` -------------------------------- ### Markdown Unordered List Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.en.md Demonstrates the creation of unordered lists in markdown using asterisks (`*`), hyphens (`-`), or plus signs (`+`) as bullet points. This is a fundamental way to present lists of items. ```markdown + Lorem ipsum dolor sit amet + Consectetur adipiscing elit + Integer molestie lorem at massa + Facilisis in pretium nisl aliquet + Nulla volutpat aliquam velit - Phasellus iaculis neque - Purus sodales ultricies - Vestibulum laoreet porttitor sem - Ac tristique libero volutpat at + Faucibus porta lacus fringilla vel + Aenean sit amet erat nunc + Eget porttitor lorem ``` -------------------------------- ### Configure AWS CLI Credentials Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/content/common/documentation/AWS_Credentials.md This snippet shows the interactive command `aws configure` used to set up AWS credentials and default region/output format for the AWS Command Line Interface. It prompts the user for their Access Key ID, Secret Access Key, default region, and default output format. This method is suitable when the AWS CLI is installed. ```bash $ aws configure AWS Access Key ID [*************xxxx]: AWS Secret Access Key [**************xxxx]: Default region name: [us-east-2]: us-east-2 Default output format [None]: json ``` -------------------------------- ### Markdown Headings to HTML Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Demonstrates how to create headings from h1 to h6 in Markdown and their equivalent HTML `

` to `

` tags. This is fundamental for structuring content. ```markdown # h1 Heading ## h2 Heading ### h3 Heading #### h4 Heading ##### h5 Heading ###### h6 Heading ``` ```html

h1 Heading

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading
``` -------------------------------- ### HTML Unordered List Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.en.md Presents the HTML equivalent of an unordered list, using `
    ` for the list container and `
  • ` for each list item. This shows the structure generated by markdown list syntax. ```html
    • Lorem ipsum dolor sit amet
    • Consectetur adipiscing elit
    • Integer molestie lorem at massa
    • Facilisis in pretium nisl aliquet
    • Nulla volutpat aliquam velit
      • Phasellus iaculis neque
      • Purus sodales ultricies
      • Vestibulum laoreet porttitor sem
      • Ac tristique libero volutpat at
    • Faucibus porta lacus fringilla vel
    • Aenean sit amet erat nunc
    • Eget porttitor lorem
    ``` -------------------------------- ### HTML Blockquote Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.en.md Shows the equivalent HTML structure for a blockquote, using the `
    ` tag. This is the underlying markup rendered by markdown blockquotes. ```html

    Fusion Drive combines a hard drive with a flash storage (solid-state drive) and presents it as a single logical volume with the space of both drives combined.

    ``` -------------------------------- ### Build Hugo Website for Deployment Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/basics/installation/_index.en.md Command to build the static files for a Hugo website. This generates a 'public' folder containing all assets ready for deployment on any web server. ```bash hugo ``` -------------------------------- ### Display current execution path Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/Installjq.md This command displays the current value of the PATH environment variable, which lists the directories where the system looks for executable files. ```bash echo $PATH ``` -------------------------------- ### Markdown Syntax Highlighting (JavaScript) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.en.md Explains and demonstrates GitHub Flavored Markdown (GFM) for syntax highlighting within code blocks. This example specifically shows JavaScript syntax highlighting. ```javascript grunt.initConfig({ assemble: { options: { assets: 'docs/assets', data: 'src/data/*.{json,yml}', helpers: 'src/custom-helpers.js', partials: ['src/partials/**/*.{hbs,md}'] }, pages: { options: { layout: 'default.hbs' }, files: { './': ['src/templates/pages/index.hbs'] } } } }; ``` -------------------------------- ### Display a Tip Disclaimer using Notice Shortcode Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/shortcodes/notice.en.md This code example illustrates the usage of the notice shortcode to create a 'tip' disclaimer. It's useful for providing helpful suggestions or best practices. ```Go Template {{%/* notice tip */%}} A tip disclaimer {{%/* /notice */%}} ``` -------------------------------- ### Markdown Blockquote Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.en.md Demonstrates how to use markdown's blockquote syntax (`>`) to quote content from another source. This is useful for highlighting external information or references within your document. ```markdown > **Fusion Drive** combines a hard drive with a flash storage (solid-state drive) and presents it as a single logical volume with the space of both drives combined. ``` -------------------------------- ### Configure Hugo Theme and Search Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/basics/installation/_index.en.md TOML configuration for a Hugo website. Sets the default theme to 'hugo-theme-learn' and enables search functionality by defining output formats for the home page. ```toml # Change the default theme to be use when building the site with Hugo theme = "hugo-theme-learn" # For search functionality [outputs] home = [ "HTML", "RSS", "JSON"] ``` -------------------------------- ### Create New Hugo Content Page Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/basics/installation/_index.en.md Commands to create new content pages within a Hugo project. The first creates a standard content page, and the second creates a content page that acts as an index for a section. ```bash hugo new basics/first-content.md hugo new basics/second-content/_index.md ``` -------------------------------- ### Attachments Shortcode with Colored Styles Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/shortcodes/attachments.en.md The Attachments shortcode supports different visual styles for the displayed list. This example shows how to apply 'orange', 'grey', 'blue', and 'green' styles using the 'style' parameter. ```Go Template {{%/*attachments style="orange" /*/%}} ``` ```Go Template {{%/*attachments style="grey" /*/%}} ``` ```Go Template {{%/*attachments style="blue" /*/%}} ``` ```Go Template {{%/*attachments style="green" /*/%}} ``` -------------------------------- ### Markdown Basic Image Insertion Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Demonstrates the basic syntax for embedding an image in Markdown. It uses an exclamation mark followed by alt text in square brackets and the image URL in parentheses. Renders the image directly. ```markdown ![Minion](https://octodex.github.com/images/minion.png) ``` ```markdown ![Alt text](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat") ``` ```html Alt text ``` -------------------------------- ### Markdown Image Resizing with URL Parameters Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Explains how to resize images in Markdown by appending `width` and/or `height` parameters with CSS values to the image URL. This allows for controlling the display size of the image directly within the Markdown. ```markdown ![Minion](https://octodex.github.com/images/minion.png?width=20pc) ``` ```markdown ![Minion](https://octodex.github.com/images/minion.png?height=50px) ``` ```markdown ![Minion](https://octodex.github.com/images/minion.png?height=50px&width=300px) ``` -------------------------------- ### Build and Deploy Blue Car Application using Bash Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/content/Well-Architected-Partners/100_Labs/100_Automating_Serverless_Best_Practices_with_Dashbird/1_deploy_blue_car_application.md This script navigates to the application directory and executes the build script to deploy the Blue Car application. The deployment process may take a significant amount of time to complete. ```bash cd aws-well-architected-labs/static/wapartners/100_Automating_Serverless_Best_Practices_with_Dashbird/Code/oncall-health-sample-app bash build_script.sh ``` -------------------------------- ### Install/Upgrade AWS CLI v2 (Linux) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/InstallAWSCLIv2.md Installs or upgrades the AWS CLI v2 on Linux systems. It downloads the installer, unzips it, and then runs the installation script with the update flag. This requires `curl` and `unzip` to be installed. ```bash curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install --update ``` -------------------------------- ### Verify AWS CLI Version (Linux) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/common/InstallAWSCLIv2.md Checks the currently installed version of the AWS CLI. This command is useful to determine if an upgrade is necessary. ```bash aws --version ``` -------------------------------- ### Nested Markdown Blockquote Example Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.en.md Illustrates how to create nested blockquotes in markdown by indenting subsequent quote lines. This allows for hierarchical quoting structures. ```markdown > Donec massa lacus, ultricies a ullamcorper in, fermentum sed augue. Nunc augue augue, aliquam non hendrerit ac, commodo vel nisi. > > > Sed adipiscing elit vitae augue consectetur a gravida nunc vehicula. Donec auctor odio non est accumsan facilisis. Aliquam id turpis in dolor tincidunt mollis ac eu diam. > > Mauris sit amet ligula egestas, feugiat metus tincidunt, luctus libero. Donec congue finibus tempor. Vestibulum aliquet sollicitudin erat, ut aliquet purus posuere luctus. ``` -------------------------------- ### Include File with Line Number Highlighting Options Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/readfile.html This shortcode demonstrates including a file with advanced syntax highlighting options, such as specifying line numbers to be highlighted and the starting line number. The 'highlightopts' parameter controls these settings. ```gohtml {{< readfile file="example.py" code="true" lang="python" highlightopts="linenos=table,hl_lines=8 15-17,linenostart=199" >}} ``` -------------------------------- ### Markdown Comments to HTML Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Illustrates how to create HTML comments in Markdown. These comments are not rendered in the final output, serving as notes within the source code. ```html ``` -------------------------------- ### Tag and Push Repository for Release Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/README.md Commands to tag a new release and push the tag to the origin repository. This is a step in the release process for the Hugo Learn Theme. ```shell git tag git push origin ``` -------------------------------- ### Manually Create AWS Credentials File Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/content/common/documentation/AWS_Credentials.md This snippet details the manual creation of the `credentials` file within the `~/.aws` directory. It specifies the format for storing AWS access key ID and secret access key under the `[default]` profile. This method is an alternative when the AWS CLI is not available or preferred. ```bash mkdir ~/.aws cd ~/.aws # Use a text editor (vim, emacs, notepad) to create a text file (no extension) named "credentials". # In this file you should have the following text: [default] aws_access_key_id = aws_secret_access_key = ``` -------------------------------- ### Generate Release with Gren Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/README.md Command to generate a new release on platforms like GitHub using the 'gren' tool, specifying the tag for the release. ```shell gren release -t ``` -------------------------------- ### Display Button Text (Go Template) Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/email_button.html Renders button text, prioritizing a 'button_text' parameter. If not provided, it falls back to the 'button_text_backup' scratch variable. ```go-template {{ if .Get "button_text" }}{{.Get "button_text" }}{{else}}{{$.Scratch.Get "button_text_backup" }}{{ end }} ``` -------------------------------- ### Markdown Body Copy to HTML Paragraphs Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Explains how plain text in Markdown is converted into HTML paragraphs (`

    `). This is the standard way to format blocks of text. ```markdown Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad. ``` ```html

    Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.

    ``` -------------------------------- ### Include Basic Markdown Image Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.en.md Markdown images are similar to links but start with an exclamation point. They require an alt text and the image URL. This is used to embed images directly into documentation. ```markdown ![Minion](https://octodex.github.com/images/minion.png) ``` -------------------------------- ### Include Go Code File with Syntax Highlighting Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/readfile.html This shortcode includes a Go language file from the same directory as the parent file and applies syntax highlighting. The 'code="true"' flag enables highlighting, and 'lang="go"' specifies the language. ```gohtml {{< readfile file="code-written-in.go" code="true" lang="go" >}} ``` -------------------------------- ### Activate Search with Hugo Outputs Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/basics/configuration/_index.en.md This snippet demonstrates how to activate the search functionality in Hugo-theme-learn by configuring the `outputs` section in `config.toml`. This enables the generation of an `index.json` file, which is used by the lunr.js search engine. ```toml [outputs] home = [ "HTML", "RSS", "JSON"] ``` -------------------------------- ### Include File from Site BaseURL Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/layouts/shortcodes/readfile.html This shortcode shows how to include a file using a path relative to the site's baseURL. It requires a leading forward slash in the 'file' parameter and is useful for files not directly related to the current content's directory structure. ```gohtml {{% readfile file="/docs/one-or-more-sub-directories/example-source-file.md" %}} ``` -------------------------------- ### Markdown Horizontal Rules to HTML Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/themes/learn/exampleSite/content/cont/markdown.fr.md Shows the different ways to create horizontal rules (`
    `) in Markdown using underscores, dashes, or asterisks. These create thematic breaks in content. ```markdown ___ --- *** ``` -------------------------------- ### Manually Create AWS Config File Source: https://github.com/awslabs/aws-well-architected-labs/blob/main/content/common/documentation/AWS_Credentials.md This snippet illustrates the manual creation of the `config` file within the `~/.aws` directory. It defines the default region and output format for AWS CLI operations. This file complements the `credentials` file for manual AWS configuration. ```bash # Use a text editor (vim, emacs, notepad) to create a text file (no extension) named "config". # In this file you should have the following text: [default] region = us-east-2 output = json ```