From 08e50aa39bbc5108404e865091e46b4fd2c1f479 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 5 Mar 2018 10:09:18 +1300 Subject: [PATCH 1/3] docs: port changes in .css to .scss source --- .../themes/mitmproxydocs/static/css/style.css | 24 ++++++++----------- docs/style/style.scss | 2 +- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/src/themes/mitmproxydocs/static/css/style.css b/docs/src/themes/mitmproxydocs/static/css/style.css index 6029ddb66..868c7d0a7 100644 --- a/docs/src/themes/mitmproxydocs/static/css/style.css +++ b/docs/src/themes/mitmproxydocs/static/css/style.css @@ -6731,20 +6731,16 @@ label.panel-block { text-align: right; } .sidebar { - background-color: #F1F1F1; -} - -.sidebar .version { - padding: 1em; } - -.sidebar .brand { - background-color: #303030; - color: #c0c0c0; - padding: 1em; - top: 0; } - -.sidebar .menu { - padding: 1em; } + background-color: #F1F1F1; } + .sidebar .version { + padding: 1em; } + .sidebar .brand { + background-color: #303030; + color: #c0c0c0; + padding: 1em; + top: 0; } + .sidebar .menu { + padding: 1em; } .mainbody { padding: 3em; } diff --git a/docs/style/style.scss b/docs/style/style.scss index 2c66a4c94..29fb96d22 100644 --- a/docs/style/style.scss +++ b/docs/style/style.scss @@ -11,7 +11,6 @@ $family-sans-serif: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Ox @import "../node_modules/bulma/sass/layout/_all"; .sidebody { - height: 100vh; overflow-x: hidden; overflow-y: scroll; } @@ -30,6 +29,7 @@ $family-sans-serif: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Ox .sidebar { + background-color: #F1F1F1; .version { padding: 1em; } From a68c7ffb27278c4e2aea4d2d8a87ee15a86bcd88 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 5 Mar 2018 10:51:46 +1300 Subject: [PATCH 2/3] docs: add build and upload scripts The upload scripts might be unified down the track, or might not. CloudFront is not set up for the docs bucket yet, so CDN invalidation is commented out. This will be added later. --- docs/build | 3 +++ docs/upload-archive | 17 +++++++++++++++++ docs/upload-master | 8 ++++++++ docs/upload-stable | 8 ++++++++ 4 files changed, 36 insertions(+) create mode 100755 docs/build create mode 100755 docs/upload-archive create mode 100755 docs/upload-master create mode 100755 docs/upload-stable diff --git a/docs/build b/docs/build new file mode 100755 index 000000000..1ca3fdb85 --- /dev/null +++ b/docs/build @@ -0,0 +1,3 @@ +#!/bin/sh + +cd src; hugo \ No newline at end of file diff --git a/docs/upload-archive b/docs/upload-archive new file mode 100755 index 000000000..5622a2aea --- /dev/null +++ b/docs/upload-archive @@ -0,0 +1,17 @@ +#!/bin/sh + +if [[ $# -eq 0 ]] ; then + echo "Please supply a version, e.g. 'v3'" + exit 1 +fi + +# This script uploads docs to a specified archive version. + +SPATH="/archive/$1" + +aws configure set preview.cloudfront true +aws --profile mitmproxy \ + s3 sync --acl public-read ./public s3://docs.mitmproxy.org$SPATH +# aws --profile mitmproxy \ +# cloudfront create-invalidation --distribution-id E3UCZ4MLN4TO7U \ +# --paths "$SPATH" diff --git a/docs/upload-master b/docs/upload-master new file mode 100755 index 000000000..c8fcda807 --- /dev/null +++ b/docs/upload-master @@ -0,0 +1,8 @@ +#!/bin/sh + +aws configure set preview.cloudfront true +aws --profile mitmproxy \ + s3 sync --acl public-read ./public s3://docs.mitmproxy.org/master +# aws --profile mitmproxy \ +# cloudfront create-invalidation --distribution-id E3UCZ4MLN4TO7U \ +# --paths "/master" diff --git a/docs/upload-stable b/docs/upload-stable new file mode 100755 index 000000000..7c658113f --- /dev/null +++ b/docs/upload-stable @@ -0,0 +1,8 @@ +#!/bin/sh + +aws configure set preview.cloudfront true +aws --profile mitmproxy \ + s3 sync --acl public-read ./public s3://docs.mitmproxy.org/stable +# aws --profile mitmproxy \ +# cloudfront create-invalidation --distribution-id E3UCZ4MLN4TO7U \ +# --paths "/master" From ee6937f948f96d74d413a24f89c2317ab582d0c8 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 5 Mar 2018 10:57:50 +1300 Subject: [PATCH 3/3] docs: add robots.txt and error.html - robots.txt prevents crawling of everything but /stable - error.html has a simple meta refresh to the latest stable docs. This will also help crawlers find the right path. --- docs/bucketassets/error.html | 9 +++++++++ docs/bucketassets/robots.txt | 3 +++ docs/setup | 7 +++++++ docs/style/style.scss | 1 - 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 docs/bucketassets/error.html create mode 100644 docs/bucketassets/robots.txt create mode 100755 docs/setup diff --git a/docs/bucketassets/error.html b/docs/bucketassets/error.html new file mode 100644 index 000000000..a855e72ba --- /dev/null +++ b/docs/bucketassets/error.html @@ -0,0 +1,9 @@ +Not found + + + + + + Not found - redirecting you to latest stable docs. + + diff --git a/docs/bucketassets/robots.txt b/docs/bucketassets/robots.txt new file mode 100644 index 000000000..da4c47d6d --- /dev/null +++ b/docs/bucketassets/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Disallow: /archive/ +Disallow: /master/ \ No newline at end of file diff --git a/docs/setup b/docs/setup new file mode 100755 index 000000000..8a9c31fdf --- /dev/null +++ b/docs/setup @@ -0,0 +1,7 @@ +#!/bin/sh + +aws configure set preview.cloudfront true +aws --profile mitmproxy \ + s3 cp --acl public-read ./bucketassets/error.html s3://docs.mitmproxy.org/error.html +aws --profile mitmproxy \ + s3 cp --acl public-read ./bucketassets/robots.txt s3://docs.mitmproxy.org/robots.txt diff --git a/docs/style/style.scss b/docs/style/style.scss index 29fb96d22..bc146fd51 100644 --- a/docs/style/style.scss +++ b/docs/style/style.scss @@ -27,7 +27,6 @@ $family-sans-serif: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Ox margin-bottom: 1em; } - .sidebar { background-color: #F1F1F1; .version {