diff --git a/.github/build-package-pages.sh b/.github/build-package-pages.sh new file mode 100755 index 0000000..92911c3 --- /dev/null +++ b/.github/build-package-pages.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# cmd: $ ./build-package-pages.sh srcJson targetPath +# sample: $ .github/build-package-pages.sh src/data/packages.json src/content/packages' + +for row in $(cat $1 | jq -r '.[] | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + touch $2/$(_jq '.name').md + content="--- +type: page +title: \"$(_jq '.name')\" +Description: \"$(_jq '.desc')\" +layout: \"package-detail\" +---" + echo "$content" > $2/$(_jq '.name').md +done \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 182421d..c71d9c8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -25,6 +25,15 @@ jobs: - uses: actions/checkout@v3 + # TODO: + # add action here to download updates packages.json into src/data/packages.json + + - name: Create Package Detail Pages from packages.json + uses: getneil/jq-action@v1 + id: version + with: + cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages' + - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }} - uses: teaxyz/setup@v0 with: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 0ea83ab..470b87f 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -33,7 +33,17 @@ jobs: echo "relativeurls = true" >>config.toml working-directory: src + # TODO: + # add action here to download updates packages.json into src/data/packages.json + + - name: Create Package Detail Pages from packages.json + uses: getneil/jq-action@v1 + id: version + with: + cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages' + - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }} + - uses: teaxyz/setup@v0 with: target: build diff --git a/.gitignore b/.gitignore index ca61bf9..4002794 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,8 @@ hugo.linux node_modules .envrc cdk.out + +.ideas + +# initially committed _sample.md only the rest will be ignored +src/content/packages/* diff --git a/README.md b/README.md index 05ea175..b7aa64d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ The tea logo and wordmark are registered trademarks of tea.inc. * Repeated components are in [`./src/layouts/partials/`]. ## Getting Started +Just once assuming there are no updates in `/src/data/packages.json`. This will create the package detail pages. +```sh +.github/build-package-pages.sh src/data/packages.json src/content/packages +``` + hugo can render your edits while you work: @@ -31,7 +36,6 @@ Install hugo yourself or use tea: `sh <(curl tea.xyz) hugo`. |------------|---------| | gohugo.io | >=0.99 | - # Build Builds a static, deployable version of the website. diff --git a/src/content/package-detail.md b/src/content/package-detail.md deleted file mode 100644 index 66a0482..0000000 --- a/src/content/package-detail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Package Details" -Description: "package.details" -layout: "package-detail" ---- diff --git a/src/content/packages/_sample.md b/src/content/packages/_sample.md new file mode 100644 index 0000000..4695330 --- /dev/null +++ b/src/content/packages/_sample.md @@ -0,0 +1,15 @@ + +--- +type: page +title: "mpdecimal" +Description: "mpdecimal" +layout: "package-detail" +--- + diff --git a/src/data/packages.json b/src/data/packages.json new file mode 100644 index 0000000..46cadfe --- /dev/null +++ b/src/data/packages.json @@ -0,0 +1,122 @@ +[ + { + "name": "mpdecimal", + "full_name": "mpdecimal", + "desc": "Library for decimal floating point arithmetic", + "homepage": "https://www.bytereef.org/mpdecimal/", + "version": "2.5.1", + "installs": 3986221, + "maintainer": "", + "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + }, + { + "name": "svg2png", + "full_name": "svg2png", + "desc": "SVG to PNG converter", + "homepage": "https://cairographics.org/", + "version": "0.1.3", + "installs": 1233, + "maintainer": "pascal", + "thumb_image_url": "/Images/package-thumb-nolabel4.jpg" + }, + { + "name": "cmake", + "full_name": "cmake", + "desc": "Cross-platform make", + "homepage": "https://www.cmake.org/", + "version": "3.24.2", + "installs": 1729267, + "maintainer": "pascal", + "thumb_image_url": "/Images/package-thumb-nolabel3.jpg" + }, + { + "name": "h2c", + "full_name": "h2c", + "desc": "Headers 2 curl", + "homepage": "https://curl.se/h2c/", + "version": "1.0", + "installs": 96, + "maintainer": "h2o", + "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + }, + { + "name": "libmagic", + "full_name": "libmagic", + "desc": "Implementation of the file(1) command", + "homepage": "https://www.darwinsys.com/file/", + "version": "5.43", + "installs": 162436, + "maintainer": "", + "thumb_image_url": "/Images/package-thumb-nolabel3.jpg" + }, + { + "name": "deno", + "full_name": "deno", + "desc": "Secure runtime for JavaScript and TypeScript", + "homepage": "https://deno.land/", + "version": "1.26.1", + "installs": 204033, + "maintainer": "Ryan Dahl", + "thumb_image_url": "/Images/package-thumb-nolabel2.jpg" + }, + { + "name": "fontconfig", + "full_name": "fontconfig", + "desc": "XML-based font configuration API for X Windows", + "homepage": "https://wiki.freedesktop.org/www/Software/fontconfig/", + "version": "2.14.0", + "installs": 2485083, + "maintainer": "Max Miedinger", + "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + }, + { + "name": "pkg-config", + "full_name": "pkg-config", + "desc": "Manage compile and link flags for libraries", + "homepage": "https://freedesktop.org/wiki/Software/pkg-config/", + "version": "0.29.2", + "installs": 2634164, + "maintainer": "pascal", + "thumb_image_url": "/Images/package-thumb-nolabel4.jpg" + }, + { + "name": "shared-mime-info", + "full_name": "shared-mime-info", + "desc": "Database of common MIME types", + "homepage": "https://wiki.freedesktop.org/www/Software/shared-mime-info", + "version": "2.2", + "installs": 642619, + "maintainer": "Mr.Mime", + "thumb_image_url": "/Images/package-thumb-nolabel3.jpg" + }, + { + "name": "ttfautohint", + "full_name": "ttfautohint", + "desc": "Auto-hinter for TrueType fonts", + "homepage": "https://www.freetype.org/ttfautohint/", + "version": "1.8.4", + "installs": 4696, + "maintainer": "pascal", + "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + }, + { + "name": "numactl", + "full_name": "numactl", + "desc": "NUMA support for Linux", + "homepage": "https://github.com/numactl/numactl", + "version": "2.0.16", + "installs": 1120, + "maintainer": "FSS", + "thumb_image_url": "/Images/package-thumb-nolabel2.jpg" + }, + { + "name": "flex", + "full_name": "flex", + "desc": "Fast Lexical Analyzer, generates Scanners (tokenizers)", + "homepage": "https://github.com/westes/flex", + "version": "2.6.4", + "installs": 35001, + "maintainer": "", + "thumb_image_url": "/Images/package-thumb-nolabel4.jpg" + } +] \ No newline at end of file diff --git a/src/layouts/index.html b/src/layouts/index.html index 2c35ba6..0bc4f38 100644 --- a/src/layouts/index.html +++ b/src/layouts/index.html @@ -164,7 +164,7 @@ align-items: center; } - .swiper-slide img { + .swiper-slide figure > img { display: block; width: 100%; height: 100%; @@ -208,7 +208,7 @@
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- {{- partial "detail-btn-large.html" -}} - +{{- .desc -}}
+ {{ if not (eq .homepage "") }} + {{- partial "detail-btn-large.html" .homepage -}} + {{end}} + {{ end }}