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

Various website fixes #37

Merged
merged 7 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 35 additions & 2 deletions tools/generateweb.art
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ compressCSS: function [file][
]

getProperMarkdown: function [md][
; write "tmp.md" md
; ret: execute ~{ruby |relative "gfm.rb"| tmp.md}
; print ["Got:\n" ret]
ret: read.markdown md
ret: replace ret {/class="language-[^"]+"/} ""
return ret
Expand All @@ -43,6 +46,36 @@ getLink: function [loc, subv][
return rett
]

getPackageBox: function [entry][
render.template read "website/components/package-box.html"
]

getCleanTags: function [taglist][
filter taglist 'tag [
contains? ["arturo" "arturo-lang" "package"] tag
]
]

postprocessAlerts: function [src][
replace src [
{/<blockquote>\n<p>\[!TIP\]/}
{/<blockquote>\n<p>\[!NOTE\]/}
{/<blockquote>\n<p>\[!IMPORTANT\]/}
{/<blockquote>\n<p>\[!WARNING\]/}
{/<blockquote>\n<p>\[!CAUTION\]/}
][
"<blockquote class='alert alert-tip'>\n<p><b class='alert-message'><i class='far fa-lightbulb'></i>Tip</b><br>\n"
"<blockquote class='alert alert-note'>\n<p><b class='alert-message'><i class='fas fa-info-circle'></i>Note</b><br>\n"
"<blockquote class='alert alert-important'>\n<p><b class='alert-message'>Important</b><br>\n"
"<blockquote class='alert alert-warning'>\n<p><b class='alert-message'><i class='fas fa-exclamation-triangle'></i>Warning</b><br>\n"
"<blockquote class='alert alert-caution'>\n<p><b class='alert-message'><i class='far fa-times-circle'></i>Caution</b><br>\n"
]
]

postprocessHTML: function [htm][
return postprocessAlerts htm
]

createSpecFile: function [package, versionToProcess, targetFolder][
ret: #[
name: package\name,
Expand Down Expand Up @@ -106,7 +139,7 @@ loop entries 'entry [
currentVersion: first entry\version
currentVersionIsLatest: true
write ~{|tgtName|/index.html}
render.template read "website/package.html"
postprocessHTML render.template read "website/package.html"

createSpecFile entry currentVersion tgtName

Expand All @@ -118,7 +151,7 @@ loop entries 'entry [
currentVersion: vv
currentVersionIsLatest: false
write ~{|versionTgt|/index.html}
render.template read "website/package.html"
postprocessHTML render.template read "website/package.html"

createSpecFile entry vv versionTgt
]
Expand Down
2 changes: 1 addition & 1 deletion website/components/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
<div class="content has-text-centered">
<p class="block">
<strong>Arturo Programming Language</strong><br>Copyright &copy; 2019-2023 Yanis Zafirópulos<br><br>
<strong>Arturo Programming Language</strong><br>Copyright &copy; 2019-2024 Yanis Zafirópulos<br><br>
<small class="is-size-7-touch">Website built and generated using Arturo + Webize.<span class="is-hidden-touch"> Running on <a rel="noopener" href="https://m.do.co/c/d9efb97aa0f2" target="_blank">DigitalOcean</a>.</span></small><br>
<small class="is-size-7-touch">Source code <span class="is-hidden-touch">licensed </span>under <a href="https://opensource.org/licenses/mit-license.php">MIT</a>. Website <span class="is-hidden-touch">content licensed </span><span class="is-hidden-desktop">under </span><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY NC SA 4.0</a>.</small>
</p>
Expand Down
2 changes: 1 addition & 1 deletion website/components/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</figure>
<|| ] ||>
<h1 class="title has-text-black main-title">
<a href="<||= siteroot ||>/index.html">
<a href="<||= siteroot ||>/">
<b>Arturo</b>&nbsp;<span class="animate-character">Packages</span>
</a>
</h1>
Expand Down
11 changes: 4 additions & 7 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ <h2 class="title" style="margin-top: 2rem; font-size: 1.5rem; font-weight: 500;"
<div class="columns" style="margin-top:-2rem">
<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][||>
<div class="columns is-tablet">
<div class="column is-6">
<|| entry: entryLeft ||>
<||= read "website/components/package-box.html" ||>
<||= getPackageBox entryLeft ||>
</div>
<div class="column is-6">
<|| unless null? entryRight [||>
<|| entry: entryRight ||>
<||= read "website/components/package-box.html" ||>
<||= getPackageBox entryRight ||>
<|| ] ||>
</div>
</div>
Expand All @@ -33,8 +30,8 @@ <h2 class="title" style="margin-top: 2rem; font-size: 1.5rem; font-weight: 500;"
<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" target="_blank">How do I use a package?</a>&nbsp;·&nbsp;
<a class="simple-link" href="https://github.com/arturo-lang/pkgr.art" target="_blank">How do I create a new package?</a>&nbsp;·&nbsp;
<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>&nbsp;·&nbsp;
</p>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions website/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ <h2 class="is-size-2"><b><a href="<||= getLink entry\name ø ||>"><||= entry\nam
<div class="block package-description">
<h3 class="is-size-5"><||= entry\info\description ||></h3>
</div>
<|| unless empty? entry\info\tags [ ||>
<|| filteredTags: getCleanTags entry\info\tags ||>
<|| unless empty? filteredTags [ ||>
<div class="block package-tags">
<|| loop entry\info\tags 'tag [||>
<|| loop filteredTags 'tag [||>
<span class="tag is-info is-light is-medium package-tag"><||= tag ||></span>
<|| ] ||>
</div>
Expand Down
50 changes: 50 additions & 0 deletions website/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,56 @@ a.version-link {
box-shadow: none;
padding-top: 2rem;
padding-bottom: 2rem;

.readme {
blockquote {
&.alert {
padding-top: 0.5rem;
padding-bottom: 0.5rem;

background-color: inherit !important;
border-left-width: 5px;
border-left-style: solid;

.alert-message {
i {
margin-right: 0.5rem;
}
}

&.alert-tip {
border-left-color: #428546;
.alert-message {
color: #428546;
}
}
&.alert-note {
border-left-color: #296BD3;
.alert-message {
color: #296BD3;
}
}
&.alert-important {
border-left-color: #7A58D7;
.alert-message {
color: #7A58D7;
}
}
&.alert-warning {
border-left-color: #936821;
.alert-message {
color: #936821;
}
}
&.alert-caution {
border-left-color: #BF3536;
.alert-message {
color: #BF3536;
}
}
}
}
}
}
}
}
Expand Down
Loading