Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More website enhancements #63

Merged
merged 25 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d6cae60
fix search box listing for mobile + also show package descriptions
drkameleon Apr 18, 2024
acbe080
make the homepage show "Recently updated" packages & limit their numb…
drkameleon Apr 18, 2024
f74d4c3
add a "Show all" button
drkameleon Apr 18, 2024
63f093e
renamed `search` component to `hero`
drkameleon Apr 19, 2024
6a7a08a
minor style change
drkameleon Apr 19, 2024
d9d6373
add basic placeholder code for "Search" page
drkameleon Apr 19, 2024
9f8c556
add draft search page + make link "work"
drkameleon Apr 19, 2024
1003a09
we should set `isHome` to *false* for Search page
drkameleon Apr 19, 2024
23f4e68
minor adjustments to package boxes
drkameleon Apr 19, 2024
72deacb
make sure package boxes resize nicely for all screens
drkameleon Apr 19, 2024
3c06028
more adjustments to package boxes
drkameleon Apr 19, 2024
8e6fd8f
added `isSearch` differentiate so that we can have 2 types of package…
drkameleon Apr 19, 2024
f34c3b8
added styles for minimalist search boxes (draft!)
drkameleon Apr 19, 2024
655cafd
output the list of packages in one flat column
drkameleon Apr 19, 2024
2af4e75
revert
drkameleon Apr 19, 2024
20a5dd1
properly style & arrange package boxes in search listings
drkameleon Apr 19, 2024
81d7c6a
make sure the package "stars" are shown correctly (even if they are n…
drkameleon Apr 19, 2024
e7c2c5a
update logo url
drkameleon Apr 19, 2024
cebdea2
fix `viewport` meta + change stylesheet url
drkameleon Apr 19, 2024
08e8efe
update main script url
drkameleon Apr 19, 2024
bfc0d25
no need to catch failures...
drkameleon Apr 19, 2024
4140f27
show number of packages correctly
drkameleon Apr 19, 2024
d9bc264
fix all paths (and re-organize `public/` directory
drkameleon Apr 19, 2024
5948dd8
re-style version size/files
drkameleon Apr 19, 2024
61a42e5
searchables are actually embedded, so... no need to copy anything
drkameleon Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions tools/generateweb.art
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ getLink: function [loc, subv][
unless null? subv ->
rett: rett ++ "/" ++ to :string subv
][
rett: siteroot ++ "/" ++ loc
rett: siteroot ++ "/_packages/" ++ loc
unless null? subv ->
rett: rett ++ "/" ++ to :string subv
rett: rett ++ "/index.html"
Expand Down Expand Up @@ -158,7 +158,12 @@ createSpecFile: function [package, versionToProcess, targetFolder][

searchable: new []

write.directory "public/thumbs" ø
; create thumbs folder if necessary

thumbsFolder: "public/thumbs"
unless directory? thumbsFolder [
write.directory "public/thumbs" ø
]

loop packages [k,v][
print ~"- Processing main package: |k|"
Expand Down Expand Up @@ -192,9 +197,14 @@ processPackagePage: function [entry][

searchable: write.compact.json ø searchable

pkgFolder: "public/_packages"
unless directory? pkgFolder [
write.directory pkgFolder ø
]

loop entries 'entry [
print ~"- Creating subpages: |entry\name|"
tgtName: ~{public/|entry\name|}
tgtName: ~{|pkgFolder|/|entry\name|}
unless directory? tgtName [
write.directory tgtName ø
]
Expand All @@ -207,7 +217,7 @@ loop entries 'entry [
createSpecFile entry currentVersion tgtName

loop entry\version 'vv [
versionTgt: ~{public/|entry\name|/|vv\version|}
versionTgt: ~{|tgtName|/|vv\version|}
unless directory? versionTgt [
write.directory versionTgt ø
]
Expand All @@ -233,32 +243,48 @@ if odd? size entries ->

; render homepage
isHome: true
isSearch: false
packageTitle: ""
write "public/index.html"
render.template read "website/index.html"

; and compress it
compressHTML "public/index.html"

; render search page
isHome: false
isSearch: true
write.directory "public/search" ø
write "public/search/index.html"
render.template read "website/search.html"

; and compress it too
compressHTML "public/search/index.html"

; create assets folder if necessary
assetsFolder: "public/assets"
unless directory? assetsFolder [
write.directory assetsFolder ø
]

; compile scss
execute "sass website/style.scss public/style.css"
execute ~"sass website/style.scss |assetsFolder|/style.css"

; and compress it too
compressCSS "public/style.css"
compressCSS ~"|assetsFolder|/style.css"

; copy resources
loop list "website/images" 'file [
copy file replace file "website/" "public/"
if contains? [".jpg", ".png"] extract.extension file [
copy file assetsFolder ++ "/" ++ extract.basename file
]
]

; copy main javascript
copy "website/script.js" "public/script.js"
copy "website/script.js" ~"|assetsFolder|/script.js"

; copy server scripts
copy "website/download.php" "public/download.php"
copy "website/getdownloads.php" "public/getdownloads.php"

; copy searchable items
copy "website/searchable.json" "public/searchable.json"

print color #green "Done!"
9 changes: 5 additions & 4 deletions website/components/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/protip.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/bundle/javascript-time-ago.js"></script> -->
<script src="<||= siteroot ||>/script.js"></script>
<script src="<||= siteroot ||>/assets/script.js"></script>
<script>
$(document).ready(function(){
$(".star-count").each(function (idx){
Expand Down Expand Up @@ -51,11 +51,12 @@
$('#search-bar').autocomplete({
formatResult: function (suggestion, currentValue){
return `
<div class="columns" style="border-bottom:1px solid #DDD;">
<div class="column is-8">
<div class="columns is-mobile suggestion-wrapper">
<div class="column is-9-tablet is-12-mobile">
<b>${suggestion.value}</b>
<p><small>${suggestion.description}</small></p>
</div>
<div class="column is-4">
<div class="column is-3-tablet is-hidden-mobile">
<div class="is-pulled-right has-text-grey">
${suggestion.version}
</div>
Expand Down
9 changes: 7 additions & 2 deletions website/components/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<title><||= capitalize packageTitle ||>Arturo Packager</title>
<meta name="description" content="<||= (packageTitle = "") ? -> "Package manager for the Arturo programming language" -> ~"Get |capitalize packageTitle|Package for the Arturo programming language" ||>">

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<|| (packageTitle = "")?[ ||>
<meta property="og:url" content="https://pkgr.art" />
<|| ][ ||>
<meta property="og:url" content="https://pkgr.art" />
<|| ] ||>
<meta property="og:title" content="<||= capitalize packageTitle ||>Arturo Packager">
<meta property="og:description" content="<||= (packageTitle = "") ? -> "Package manager for the Arturo programming language" -> ~"Get |capitalize packageTitle|Package for the Arturo programming language" ||>">

Expand Down Expand Up @@ -63,6 +68,6 @@
crossorigin="anonymous"></script>

<!-- Our main style -->
<link rel="stylesheet" type="text/css" href="<||= siteroot ||>/style.css">
<link rel="stylesheet" type="text/css" href="<||= siteroot ||>/assets/style.css">
</head>
<body>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="column is-4 is-offset-4 main-header">
<|| if isHome [||>
<figure class="logo">
<img src="<||= siteroot ||>/images/logo.png" alt="Arturo package manager">
<img src="<||= siteroot ||>/assets/logo.png" alt="Arturo package manager">
</figure>
<|| ] ||>
<h1 class="title has-text-black main-title">
Expand Down
69 changes: 31 additions & 38 deletions website/components/package-box.html
Original file line number Diff line number Diff line change
@@ -1,61 +1,54 @@
<div class="box package-box">
<div class="box package-box<|| if isSearch [||> is-plain<||]||>">
<div class="package-header">
<div class="columns is-mobile">
<div class="column is-6">
<div class="title-wrapper">
<h3 class="is-size-5">
<a href="<||= getLink entry\name ø ||>" class="repo-name">
<b><||= entry\name ||></b>
</a>&nbsp;
</h3>
<a href="<||= entry\info\url ||>">
<span class="icon repo-icon">
<i class="fa fa-github"></i>
</span>
</a>
</div>
</div>
<div class="column is-6">
<div class="is-size-6 is-pulled-right stats-wrapper">
<div class="download-info">
<span class="icon download-icon">
<i class="fas fa-download"></i>
</span>&nbsp;
<span id="<||= entry\name ||>-downloads" lass="download-count">-</span>
</div>&nbsp;&nbsp;
<div class="star-info">
<span class="icon star-icon">
<i class="fa fa-star"></i>
</span>&nbsp;
<span class="star-count" data-package="<||= replace entry\info\url "https://github.com/" "" ||>"></span>
</div>
</div>
<div class="title-wrapper">
<h3 class="is-size-5">
<a href="<||= getLink entry\name ø ||>" class="repo-name">
<b><||= entry\name ||></b>
</a>&nbsp;
</h3>
<a href="<||= entry\info\url ||>">
<span class="icon repo-icon">
<i class="fa fa-github"></i>
</span>
</a>
</div>
<div class="is-size-6 is-pulled-right stats-wrapper<|| unless isSearch [||> is-hidden-tablet-only<|| ] ||>">
<div class="download-info">
<span class="icon download-icon">
<i class="fas fa-download"></i>
</span>&nbsp;
<span id="<||= entry\name ||>-downloads" lass="download-count">-</span>
</div>&nbsp;&nbsp;
<div class="star-info">
<span class="icon star-icon">
<i class="fa fa-star"></i>
</span>&nbsp;
<span class="star-count" data-package="<||= replace entry\info\url "https://github.com/" "" ||>"><||= entry\info\stats\stars ||></span>
</div>
</div>
</div>
<div class="package-body">
<p><||= entry\info\description ||></p>
</div>
<div class="package-footer">
<hr>
<div class="columns is-mobile">
<div class="column is-6 repo-user">
<!-- <div class="columns is-mobile">
<div class="column is-6 is-12-tablet is-6-desktop repo-user"> -->
<div class="is-pulled-left">
<span class="icon repo-user-icon">
<i class="fa fa-user"></i>
</span>&nbsp;
<a href="<||= entry\info\author\url ||>" class="repo-user-name"><||= entry\info\author\name ||></a>
</div>
</div>
<div class="column is-6 repo-license">
<!--</div>
<div class="column is-6 is-hidden-tablet-only repo-license">-->
<div class="is-pulled-right">
<span class="icon repo-license-icon">
<i class="fa fa-balance-scale"></i>
</span>&nbsp;
<a href="<||= entry\info\license\url ||>" class="repo-license-name"><||= entry\info\license\name ||></a>
</div>
</div>
</div>
<!--</div>
</div>-->
</div>
</div>

Expand Down
7 changes: 4 additions & 3 deletions website/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<||= read "website/components/header.html" ||>

<||= read "website/components/search.html" ||>
<||= read "website/components/hero.html" ||>
<section class="main-section">
<div class="container package-listing">
<div class="columns">
<div class="column is-12 has-text-centered">
<h2 class="title package-listing-header">Latest additions</h2>
<h2 class="title package-listing-header">Recently updated</h2>
</div>
</div>
<div class="columns" style="margin-top:0.5rem">
<div class="column is-8-tablet is-offset-2-tablet is-10-mobile is-offset-1-mobile">
<!-- <p class="subtitle has-text-black">Latest packages</p> -->
<|| loop entries [entryLeft, entryRight][||>
<|| loop first.n: 6 entries [entryLeft, entryRight][||>
<div class="columns is-tablet">
<div class="column is-6">
<||= getPackageBox entryLeft ||>
Expand All @@ -29,6 +29,7 @@ <h2 class="title package-listing-header">Latest additions</h2>
<div class="container has-text-centered">
<div class="columns">
<div class="column is-12" style="padding:4rem; font-size: 1.2rem">
<a href="<||= siteroot ||>/search" class="button is-medium show-all-button">Show all packages</a>
<p class="has-text-grey">
<a class="simple-link" href="https://github.com/arturo-lang/pkgr.art?tab=readme-ov-file#using-packages" target="_blank">How do I use a package?</a>&nbsp;·&nbsp;
<a class="simple-link" href="https://github.com/arturo-lang/pkgr.art?tab=readme-ov-file#creating-packages" target="_blank">How do I create a new package?</a>
Expand Down
6 changes: 3 additions & 3 deletions website/package.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<||= read "website/components/header.html" ||>

<||= read "website/components/search.html" ||>
<||= read "website/components/hero.html" ||>
<section class="main-section">
<div class="container">
<div class="columns is-mobile">
Expand Down Expand Up @@ -74,7 +74,7 @@ <h3 class="is-size-5"><||= entry\info\description ||></h3>
<span class="has-text-grey"><||= ver\date\day ||>&nbsp;<||= ver\date\Month ||>&nbsp;<||= ver\date\year ||></span>
</td>
<td>
<span class="has-text-grey repo-size-field"><||= ver\details\size ||></span><small>&nbsp;(<span class="has-text-grey"><||= ver\details\files ||> files</span>)</small>
<span class="has-text-grey repo-size-field"><||= ver\details\size ||></span><small>&nbsp;/&nbsp;<span class="has-text-grey"><||= ver\details\files ||> files</span></small>
</td>
</tr>
<|| ][ ||>
Expand All @@ -86,7 +86,7 @@ <h3 class="is-size-5"><||= entry\info\description ||></h3>
<span class="has-text-grey"><||= ver\date\day ||>&nbsp;<||= ver\date\Month ||>&nbsp;<||= ver\date\year ||></span>
</td>
<td>
<span class="has-text-grey repo-size-field"><||= ver\details\size ||></span><small>&nbsp;(<span class="has-text-grey"><||= ver\details\files ||> files</span>)</small>
<span class="has-text-grey repo-size-field"><||= ver\details\size ||></span><small>&nbsp;/&nbsp;<span class="has-text-grey"><||= ver\details\files ||> files</span></small>
</td>
</tr>
<|| ] ||>
Expand Down
35 changes: 35 additions & 0 deletions website/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<||= read "website/components/header.html" ||>

<||= read "website/components/hero.html" ||>
<section class="main-section">
<div class="container package-listing">
<div class="columns">
<div class="column is-12 has-text-centered">
<h2 class="title package-listing-header"><||= enumerate entries => [not? null? &]||> packages found</h2>
</div>
</div>
<div class="columns" style="margin-top:0.5rem">
<div class="column is-8-tablet is-offset-2-tablet is-10-mobile is-offset-1-mobile">
<!-- <p class="subtitle has-text-black">Latest packages</p> -->
<|| loop entries [entryLeft, entryRight][||>
<||= getPackageBox entryLeft ||>
<|| unless null? entryRight [||>
<||= getPackageBox entryRight ||>
<|| ] ||>
<|| ] ||>
</div>
</div>
</div>
<div class="container has-text-centered">
<div class="columns">
<div class="column is-12" style="padding:4rem; font-size: 1.2rem">
<p class="has-text-grey">
<a class="simple-link" href="https://github.com/arturo-lang/pkgr.art?tab=readme-ov-file#using-packages" target="_blank">How do I use a package?</a>&nbsp;·&nbsp;
<a class="simple-link" href="https://github.com/arturo-lang/pkgr.art?tab=readme-ov-file#creating-packages" target="_blank">How do I create a new package?</a>
</p>
</div>
</div>
</div>
</section>

<||= read "website/components/footer.html" ||>
18 changes: 0 additions & 18 deletions website/searchable.json

This file was deleted.

Loading
Loading