diff --git a/.github/build-package-pages.sh b/.github/build-package-pages.sh index 8be2bd4..5774526 100755 --- a/.github/build-package-pages.sh +++ b/.github/build-package-pages.sh @@ -1,12 +1,21 @@ #!/bin/bash # cmd: $ ./build-package-pages.sh srcJson targetPath -# sample: $ .github/build-package-pages.sh src/data/packages.json src/content/packages' +# sample: $ .github/build-package-pages.sh src/data/packages.json src/content/' for row in $(jq -r '.[] | @base64' < "$1"); do _jq() { echo "${row}" | base64 --decode | jq -r "${1}" } - touch "$2"/"$(_jq '.slug')".md + full_name=$(_jq '.full_name' | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') + + if [[ "$full_name" == *\/* ]] || [[ "$full_name" == *\\* ]] + then + mkdir -p "$2/+$full_name" + # remove last folder + rm -rf "$2/+$full_name" + fi + + touch "$2"/"+$full_name".md content="--- type: page title: \"$(_jq '.name')\" @@ -14,5 +23,5 @@ maintainer: \"$(_jq '.maintainer')\" Description: \"$(_jq '.desc' | tr '\"' "'")\" layout: \"package-detail\" ---" - echo "$content" > "$2"/"$(_jq '.slug')".md + echo "$content" > "$2"/"+$full_name".md done \ No newline at end of file diff --git a/.github/prepare-thumb-images.sh b/.github/sync-thumb-images.sh similarity index 75% rename from .github/prepare-thumb-images.sh rename to .github/sync-thumb-images.sh index 1a8d9c8..ddfb726 100755 --- a/.github/prepare-thumb-images.sh +++ b/.github/sync-thumb-images.sh @@ -1,9 +1,12 @@ #!/bin/bash +# update packages.json data with relative thumb image url path +# rebuild pages +# download images from www.tea.xyz/Images/packages to + # cmd: $ ./prepare-thumb-images.sh srcJson targetPath # sample: $ .github/prepare-thumb-images.sh src/data/packages.json src/static/Images/packages/ # create packages folder: where airtable images will be DLd -mkdir -p ./packages_thumbs_images packages="cat $1" temp_packages="./src/data/temp.json" cp $1 $temp_packages @@ -11,16 +14,15 @@ for row in $($packages | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} } - dl_url=$(_jq '.thumb_image_url') - if [[ $dl_url == *"https://dl.airtable.com/.attachments"* ]]; then + if [[ $dl_url == *"tea.xyz"* ]]; then filename=$(basename -- "$dl_url") extension="${filename##*.}" filename="${filename%.*}" slug=$(_jq '.slug') - outputPath=$2/$(_jq '.slug').$extension - new_thumb_image_url="https://tea.xyz/Images/packages/$slug.$extension" - curl $dl_url -o ./packages_thumbs_images/$slug.$extension + + new_thumb_image_url="/Images/packages/$filename.$extension" + updated_packages=$(jq '(.[] | select(.slug == "'$slug'") | .thumb_image_url) |= "'$new_thumb_image_url'"' ./src/data/temp.json) echo $updated_packages > $temp_packages echo "update $slug" diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9f74149..91f1075 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -37,22 +37,7 @@ jobs: uses: getneil/jq-action@v1 id: version with: - cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages' - - - name: Download package thumbnails from Airtable - uses: getneil/jq-action@v1 - with: - cmd: '.github/prepare-thumb-images.sh src/data/packages.json' - - - name: Upload package thumbnails to AWS S3 - uses: jakejarvis/s3-sync-action@master - env: - AWS_S3_BUCKET: www.tea.xyz - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: 'us-east-1' - SOURCE_DIR: 'packages_thumbs_images' - DEST_DIR: 'Images/packages' + cmd: '.github/build-package-pages.sh src/data/packages.json src/content' - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }} - uses: teaxyz/setup@v0 @@ -76,8 +61,6 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - run: cp -R packages_thumbs_images public/Images/packages - # cache-control of 10 mins because we *need* to be able to update # this and have people see the results can be fixed well with a static site builder - run: | @@ -85,9 +68,11 @@ jobs: --metadata-directive REPLACE \ --cache-control max-age=600 \ --exclude '.git/*' --exclude '.github/*' \ + --exclude 'Images/packages/*' \ --exclude 'pour.sh' \ --exclude 'tea.white-paper*.pdf' \ --exclude '*.md' \ + --exclude 'tea-*+*' \ --delete #TODO create a github-action that can be used to parse the diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 1da2b30..7b7cd66 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -45,22 +45,7 @@ jobs: - name: Create Package Detail Pages from packages.json uses: getneil/jq-action@v1 with: - cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages' - - - name: Download package thumbnails from Airtable - uses: getneil/jq-action@v1 - with: - cmd: '.github/prepare-thumb-images.sh src/data/packages.json' - - - name: Upload package thumbnails to AWS S3 - uses: jakejarvis/s3-sync-action@master - env: - AWS_S3_BUCKET: www.tea.xyz - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: 'us-east-1' - SOURCE_DIR: 'packages_thumbs_images' - DEST_DIR: 'Images/packages' + cmd: '.github/build-package-pages.sh src/data/packages.json src/content' - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }} @@ -76,6 +61,18 @@ jobs: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + # update packages json data and rebuild again + - name: make images relative path to preview site + uses: getneil/jq-action@v1 + with: + cmd: '.github/sync-thumb-images.sh src/data/packages.json' + + # intentional to rebuild packages again with relative image data + # the first one to test it against prod resources via lychee + - uses: teaxyz/setup@v0 + with: + target: build + - uses: actions/setup-node@v3 with: node-version: 14 @@ -93,7 +90,21 @@ jobs: id: cdk_deploy run: yarn deploy working-directory: .cdk - + + - name: get cdk bucket + id: DEPLOY_BUCKET + run: | + BUCKET=$(aws s3 ls | grep $(echo teaxyz-pr-$GITHUB_REF_SLUG_URL | sed "s/-merge//") | grep -o '[^ ]*$') + echo "bucket=$BUCKET" >> $GITHUB_OUTPUT + + - name: cp package images from prod to preview bucket + run: | + aws s3 cp s3://www.tea.xyz/Images/packages \ + s3://$NEW_BUCKET/Images/packages \ + --recursive + env: + NEW_BUCKET: ${{ steps.DEPLOY_BUCKET.outputs.bucket }} + - name: Seal Deployment uses: bobheadxi/deployments@v1 if: always() diff --git a/.gitignore b/.gitignore index a142cf4..79a2bcb 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,6 @@ cdk.out # initially committed _sample.md only the rest will be ignored src/content/packages/* -src/static/Images/packages/* \ No newline at end of file +src/static/Images/packages/* + +src/content/+* \ No newline at end of file diff --git a/README.md b/README.md index 322d71e..0d85b23 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,11 @@ The detail pages of each package are not committed to the repository for the simple reason of that would be too much repeating data. Execute the following command just once per version of `/src/data/packages.json`. This will create the package detail pages in -`/src/content/packages/[package_slug].md`. +`/src/content/+[package.full_name].md`. +Which resembles the installation tag in tea cli ```sh -.github/build-package-pages.sh src/data/packages.json src/content/packages +.github/build-package-pages.sh src/data/packages.json src/content ``` diff --git a/lychee.toml b/lychee.toml index ff00e62..9bcd048 100644 --- a/lychee.toml +++ b/lychee.toml @@ -5,6 +5,8 @@ base = "./public" exclude-mail = true include = ["./public/**/*.md", "./public/**/*.html"] exclude = [ + "https://github.com/", + "https://twitter.com/", "https://fonts.gstatic.com/", "https://fonts.googleapis.com/", "https://www.clarity.ms/tag/", @@ -23,5 +25,7 @@ exclude = [ "file:///home/runner/work/www/www/public/www.klaviyo.com/media/js/public/klaviyo_subscribe.js", "https://openssl.org/", "https://twitter.com/teaxyz_", + "file:///home/runner/work/www/www/public/+github.com/rhash/RHash", + "file:///home/runner/work/www/www/public/+github.com/rhash/RHash", "https://app.tea.xyz/api/signups", ] diff --git a/src/content/+.md b/src/content/+.md new file mode 100644 index 0000000..4403dec --- /dev/null +++ b/src/content/+.md @@ -0,0 +1,5 @@ +--- +type: page +title: "packages" +layout: "packages" +--- diff --git a/src/content/_index.md b/src/content/_index.md index 230fe35..b33d069 100644 --- a/src/content/_index.md +++ b/src/content/_index.md @@ -1,6 +1,6 @@ --- title: "Home" -Description: "Equitable Open-Source for web3" +Description: "tea.xyz is a feature-rich, delightful unified package manager that will revolutionize open-source development" layout: "index" menu: main weight: 1 diff --git a/src/content/packages/_sample.md b/src/content/packages/_sample.md deleted file mode 100644 index 4695330..0000000 --- a/src/content/packages/_sample.md +++ /dev/null @@ -1,15 +0,0 @@ - ---- -type: page -title: "mpdecimal" -Description: "mpdecimal" -layout: "package-detail" ---- - diff --git a/src/layouts/index.html b/src/layouts/index.html index f6601d4..c83c64c 100644 --- a/src/layouts/index.html +++ b/src/layouts/index.html @@ -8,14 +8,15 @@
-

Keep what
is yours.

+

TEA CLI
is HERE.

-

The open-source revolution is here. We’re calling on all devs to build with our powerful, new unified package manager.

+

Visit GitHub to check out our README, and ⭐ the repository. You can install tea by running the one‐liner in your terminal.

+ {{- partial "purple-btn-large.html" -}} grid
@@ -94,7 +95,12 @@ @@ -222,7 +183,7 @@

NUMBER OF REPOS

-

Number of repos above 0 stars and forks, owned by tea authenticated developers.

+

Number of rated repos owned by tea‐authenticated developers.

@@ -236,9 +197,9 @@
grid
-

OS CONTRIBUTIONS

+

TEA MAINTAINERS

-

Number of maintainers for those 2042 packages.

+

Number of tea-maintainers for those 2042 packages.

diff --git a/src/layouts/page/package-detail.html b/src/layouts/page/package-detail.html index 7e7d485..d8ad331 100644 --- a/src/layouts/page/package-detail.html +++ b/src/layouts/page/package-detail.html @@ -13,9 +13,16 @@

{{- .Title -}}

{{ range where $.Site.Data.packages "name" .Title }} -

{{- .desc -}}

+

{{- .desc -}}

+ {{ if not (eq .package_yml_url "#")}} + + + + {{end}} {{ if not (eq .homepage "") }} - {{- partial "detail-btn-large.html" .homepage -}} + + + {{end}} {{ end }}
@@ -29,18 +36,15 @@
- Copy the tea one-liner below into your terminal to install {{- .Title -}}. tea will interpret the documentation and take care of any dependencies. + Copy the tea one-liner below into your terminal to install  {{- .Title -}}. tea will interpret the documentation and take care of any dependencies.
{{ range where $.Site.Data.packages "name" .Title }} - {{- partial "clipboard-copy.html" -}} + {{- partial "clipboard-copy-package-detail.html" . -}} - {{ end }} @@ -53,6 +57,20 @@ background-color: gray; } + a:hover{ + text-decoration: none; + } + + #purple-bg-btn{ + background-color: #8000FF; + border: 2px solid #8000FF; + } + + #standard-detail-btn:hover{ + background-color: #212020 !important; + box-shadow: inset 0vw 0vw 0vw 0.335vw #1a1a1a !important; + } + {{ end }} diff --git a/src/layouts/page/packages.html b/src/layouts/page/packages.html new file mode 100644 index 0000000..83a0da0 --- /dev/null +++ b/src/layouts/page/packages.html @@ -0,0 +1,33 @@ +{{ define "main" }} + + + + + + + + + {{- partial "package-grid.html" . -}} + + + + + + {{- partial "swiper.html" . -}} + + + + + + +{{ end }} diff --git a/src/layouts/page/tea-qr.html b/src/layouts/page/tea-qr.html index d16d0e4..99a89e7 100644 --- a/src/layouts/page/tea-qr.html +++ b/src/layouts/page/tea-qr.html @@ -2,6 +2,7 @@ +
diff --git a/src/layouts/page/white-paper.html b/src/layouts/page/white-paper.html index 213b5c0..2093c39 100644 --- a/src/layouts/page/white-paper.html +++ b/src/layouts/page/white-paper.html @@ -19,8 +19,8 @@

@@ -70,7 +70,7 @@ ['Deutsch', '_de'], ['Русский', '_ru'], ['українська', '_uk'], - ['官话', '_zh'] + ['简体中文', '_zh'] ]; let adobeDcView; @@ -97,23 +97,21 @@ } const adobeDCView = getAdobeDcView(); - adobeDCView.previewFile({ - content:{ - location: { - url: getWhitePaperUrl(), - } - }, - metaData:{ - fileName: "tea.white-paper.pdf" - } - }, { embedMode: "IN_LINE" }); + const hash = window.location.hash.replace(/^#/, '_') + const suffix = versions.find(v => v[1] === hash) || '' + viewWhitepaper(suffix) } catch (error) { console.error('test:', error); } }); - function viewWhitepaper(suffix) { + if (suffix.length) { + window.location.hash = '#' + suffix.substr(1) + } else{ + // https://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-url-with-javascript-without-page-r/5298684#5298684 + history.pushState("", document.title, window.location.pathname + window.location.search) + } const adobeDCView = getAdobeDcView(); const url = getWhitePaperUrl(suffix); adobeDCView.previewFile({ diff --git a/src/layouts/partials/clipboard-copy-package-detail.html b/src/layouts/partials/clipboard-copy-package-detail.html new file mode 100644 index 0000000..6066c67 --- /dev/null +++ b/src/layouts/partials/clipboard-copy-package-detail.html @@ -0,0 +1,197 @@ +
+
+ + + + + +
+
+ + + + diff --git a/src/layouts/partials/clipboard-copy.html b/src/layouts/partials/clipboard-copy.html index ec4f5d9..b127746 100644 --- a/src/layouts/partials/clipboard-copy.html +++ b/src/layouts/partials/clipboard-copy.html @@ -181,14 +181,14 @@ function changeCopied() { // Get the text field var copyText = document.getElementById("shortcodeCopy"); + var copiedValue = "sh <(curl https://tea.xyz)"; // Select the text field copyText.select(); copyText.setSelectionRange(0, 99999); // For mobile devices // Copy the text inside the text field - navigator.clipboard.writeText(copyText.value); - + navigator.clipboard.writeText(copiedValue); document.getElementById("liveToastBtn").innerHTML = "copied!"; diff --git a/src/layouts/partials/detail-btn-large.html b/src/layouts/partials/detail-btn-large.html index 51a429e..e23db5e 100644 --- a/src/layouts/partials/detail-btn-large.html +++ b/src/layouts/partials/detail-btn-large.html @@ -1,3 +1,3 @@ - - \ No newline at end of file + + diff --git a/src/layouts/partials/footer.html b/src/layouts/partials/footer.html index 867d93a..2a7eb36 100644 --- a/src/layouts/partials/footer.html +++ b/src/layouts/partials/footer.html @@ -13,7 +13,7 @@
- @@ -146,19 +145,6 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+ rdt('track', 'ViewContent'); - - + \ No newline at end of file diff --git a/src/static/banner.png b/src/static/banner.png index a5e4a2c..8899b9a 100644 Binary files a/src/static/banner.png and b/src/static/banner.png differ diff --git a/src/static/css/homepage.css b/src/static/css/homepage.css index f5b625f..3050b76 100644 --- a/src/static/css/homepage.css +++ b/src/static/css/homepage.css @@ -247,7 +247,7 @@ mark{ align-items: center; height: 15vw; margin-top: 0.4vw; - margin-bottom: 1vw; + margin-bottom: 0px; } .package_before{ @@ -303,7 +303,7 @@ mark{ align-items: center; height: 15vw; margin-top: 1.1vw; - margin-bottom: 1vw; + margin-bottom: 0px; } .package_before{ @@ -358,8 +358,8 @@ mark{ justify-content: center; align-items: center; height: 20.2vw; - margin-top: 1.3vw; - margin-bottom: 2.5vw; + margin-top: .5vw; + margin-bottom: 0; } .metric-block{