Static Site Publishing

This is a statically generated site using mkdocs served from an AWS S3 bucket. I will be using it to keep useful tech notes, documentation and references for quick and easy access.

It is currently set to use the mkdocs-material theme.

Mkdocs is useful as it enables documentation to be quickly and easily created using markdown and the static site is then created and synched to the S3 bucket.

Azure DevOps Pipeline to Auto Publish

There is an Azure DevOps Pipeline configured that will automatically trigger when a new commit is made to the _philricetechnotes github repo. This builds the mkdocs site from the markdown files and puts it into the 'sites' directory, then uses AWS Cli to copy the site files to the S3 bucket

``` linenums="1" steps: - task: PowerShell@2 displayName: 'install and build mkdocs' inputs: targetType: 'inline' script: | cd ./'Phil Rice Tech Notes' pip install mkdocs pip install mkdocs-material mkdocs build ls ./site - task: S3Upload@1 displayName: 'Copy site files to S3' inputs: awsCredentials: 'AWS Service Connection' regionName: 'eu-west-2' bucketName: 'philricetechnotes' sourceFolder: 'Phil Rice Tech Notes/site' globExpressions: '**'


### Manual Update & Sync of the Site
Command to build site and then AWS CLI sync command used from within my site directory 

!!! info 

    Shouldnt ever need to use this as the pipeline will handle publishing,
    but including for reference

mkdocs build aws s3 cp site/ s3://philricetechnotes --recursive ```

For full documentation and more info visit mkdocs.org.

Commands

  • mkdocs new [dir-name] - Create a new project.
  • mkdocs serve - Start the live-reloading docs server.
  • mkdocs build - Build the documentation site.
  • mkdocs -h - Print help message and exit.