From bfbffa83e6b786128a45ad1af77a13dc8a964bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sun, 6 Aug 2023 18:41:18 +0200 Subject: [PATCH 01/16] Reworking templates for Template6 --- includes/{camelia => camelia.tt} | 0 includes/{footer => common-wrapper.tt} | 21 +++++++++++++ includes/header | 23 -------------- includes/menu-nav.tt | 30 +++++++++++++++++++ includes/more-header.tt | 3 ++ source/TEMP-example.html | 2 -- source/TEMP-example.tt | 2 ++ source/about/{index.html => index.tt} | 6 ++-- source/community/{index.html => index.tt} | 6 ++-- source/community/irc/{index.html => index.tt} | 8 ++--- .../rosettacode/{index.html => index.tt} | 8 ++--- source/compilers/{index.html => index.tt} | 6 ++-- source/compilers/{std-viv.html => std-viv.tt} | 6 ++-- source/downloads/{index.html => index.tt} | 6 ++-- source/fun/{index.html => index.tt} | 6 ++-- .../getting-started/{index.html => index.tt} | 8 ++--- .../{involved.html => involved.tt} | 8 ++--- source/{index.html => index.tt} | 12 +++----- source/resources/{index.html => index.tt} | 6 ++-- .../{99-bottles.html => 99-bottles.tt} | 0 .../{birth-date.html => birth-date.tt} | 0 .../{color-fade.html => color-fade.tt} | 0 ...{duplicate-word.html => duplicate-word.tt} | 0 source/snippets/{liftoff.html => liftoff.tt} | 0 source/specification/{index.html => index.tt} | 6 ++-- source/whatever/{index.html => index.tt} | 6 ++-- 26 files changed, 103 insertions(+), 76 deletions(-) rename includes/{camelia => camelia.tt} (100%) rename includes/{footer => common-wrapper.tt} (81%) delete mode 100644 includes/header create mode 100644 includes/menu-nav.tt create mode 100644 includes/more-header.tt delete mode 100644 source/TEMP-example.html create mode 100644 source/TEMP-example.tt rename source/about/{index.html => index.tt} (96%) rename source/community/{index.html => index.tt} (98%) rename source/community/irc/{index.html => index.tt} (98%) rename source/community/rosettacode/{index.html => index.tt} (96%) rename source/compilers/{index.html => index.tt} (97%) rename source/compilers/{std-viv.html => std-viv.tt} (93%) rename source/downloads/{index.html => index.tt} (96%) rename source/fun/{index.html => index.tt} (95%) rename source/getting-started/{index.html => index.tt} (94%) rename source/getting-started/{involved.html => involved.tt} (92%) rename source/{index.html => index.tt} (95%) rename source/resources/{index.html => index.tt} (98%) rename source/snippets/{99-bottles.html => 99-bottles.tt} (100%) rename source/snippets/{birth-date.html => birth-date.tt} (100%) rename source/snippets/{color-fade.html => color-fade.tt} (100%) rename source/snippets/{duplicate-word.html => duplicate-word.tt} (100%) rename source/snippets/{liftoff.html => liftoff.tt} (100%) rename source/specification/{index.html => index.tt} (96%) rename source/whatever/{index.html => index.tt} (96%) diff --git a/includes/camelia b/includes/camelia.tt similarity index 100% rename from includes/camelia rename to includes/camelia.tt diff --git a/includes/footer b/includes/common-wrapper.tt similarity index 81% rename from includes/footer rename to includes/common-wrapper.tt index 8214e888f..9bcdea97d 100644 --- a/includes/footer +++ b/includes/common-wrapper.tt @@ -1,3 +1,24 @@ + + + + + + + + + + [% GET title %] + [% IF extra_header_template %] [% INSERT extra_header_template %] [% END %] + + + + + + + +
+
+[% content %]
diff --git a/includes/header b/includes/header deleted file mode 100644 index 109fbeee0..000000000 --- a/includes/header +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - [% readvar title %] - [% ifvar more_header %] [% readvar more_header %] [%endifvar%] - - - - - - [% ifvar sitecss %] - - [% endifvar %] - - -
-
diff --git a/includes/menu-nav.tt b/includes/menu-nav.tt new file mode 100644 index 000000000..1feee58bd --- /dev/null +++ b/includes/menu-nav.tt @@ -0,0 +1,30 @@ + + + +[% comment vim: set tw=0 ft=html : %] diff --git a/includes/more-header.tt b/includes/more-header.tt new file mode 100644 index 000000000..20f4f2db6 --- /dev/null +++ b/includes/more-header.tt @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/source/TEMP-example.html b/source/TEMP-example.html deleted file mode 100644 index 9bebb5656..000000000 --- a/source/TEMP-example.html +++ /dev/null @@ -1,2 +0,0 @@ -[% setvar title Raku examples -- just a temporary hack %] - diff --git a/source/TEMP-example.tt b/source/TEMP-example.tt new file mode 100644 index 000000000..cdfbfae1a --- /dev/null +++ b/source/TEMP-example.tt @@ -0,0 +1,2 @@ +[% SET title = 'Raku examples -- just a temporary hack' %] + diff --git a/source/about/index.html b/source/about/index.tt similarity index 96% rename from source/about/index.html rename to source/about/index.tt index 2e1876593..c69924696 100644 --- a/source/about/index.html +++ b/source/about/index.tt @@ -1,9 +1,9 @@ -[% setvar title About raku.org %] +[% SET title = 'About raku.org' %] -[% menu nav about %] +[% PROCESS 'menu-nav' current = 'about' %]
- [% include camelia %] + [% INCLUDE 'camelia' %]

About raku.org

raku.org is, just like Raku, a volunteer driven project. Content on raku.org should be up-to-date rather than comprehensive. diff --git a/source/community/index.html b/source/community/index.tt similarity index 98% rename from source/community/index.html rename to source/community/index.tt index 89350c89f..b1203efbb 100644 --- a/source/community/index.html +++ b/source/community/index.tt @@ -1,9 +1,9 @@ -[% setvar title Raku Community %] +[% SET title = 'Raku Community' %] -[% menu nav community %] +[% PROCESS 'menu-nav' current = 'community' %]

-[% include camelia %] +[% INCLUDE 'camelia' %]

The Raku Community welcomes you

diff --git a/source/community/irc/index.html b/source/community/irc/index.tt similarity index 98% rename from source/community/irc/index.html rename to source/community/irc/index.tt index a2dff42eb..83657f79c 100644 --- a/source/community/irc/index.html +++ b/source/community/irc/index.tt @@ -1,10 +1,10 @@ -[% setvar title #raku IRC channel %] -[% menu nav community %] +[% SET title = '#raku IRC channel' %] +[% PROCESS 'menu-nav' current = 'community' %]

- [% include camelia %] + [% INCLUDE 'camelia' %] -

[% readvar title %]

+

[% GET title %]

Much real-time discussion happens on our IRC channel, #raku on irc.libera.chat. diff --git a/source/community/rosettacode/index.html b/source/community/rosettacode/index.tt similarity index 96% rename from source/community/rosettacode/index.html rename to source/community/rosettacode/index.tt index e7740e777..1491ee429 100644 --- a/source/community/rosettacode/index.html +++ b/source/community/rosettacode/index.tt @@ -1,11 +1,11 @@ -[% setvar title Raku on Rosetta Code %] +[% SET title = 'Raku on Rosetta Code' %] -[% menu nav community %] +[% PROCESS 'menu-nav' current = 'community' %]

- [% include camelia %] + [% INCLUDE 'camelia' %] -

[% readvar title %]

+

[% GET title %]

Rosetta Code is a community site that presents solutions to programming tasks in diff --git a/source/compilers/index.html b/source/compilers/index.tt similarity index 97% rename from source/compilers/index.html rename to source/compilers/index.tt index 5fe804573..f98c1d902 100644 --- a/source/compilers/index.html +++ b/source/compilers/index.tt @@ -1,9 +1,9 @@ -[% setvar title Raku Compilers %] +[% SET title = 'Raku Compilers' %] -[% menu nav compilers %] +[% PROCESS 'menu-nav' current = 'compilers' %]

- [% include camelia %] + [% INCLUDE 'camelia' %]

Raku Compilers

diff --git a/source/compilers/std-viv.html b/source/compilers/std-viv.tt similarity index 93% rename from source/compilers/std-viv.html rename to source/compilers/std-viv.tt index aa1253ead..a3f2e8b1f 100644 --- a/source/compilers/std-viv.html +++ b/source/compilers/std-viv.tt @@ -1,9 +1,9 @@ -[% setvar title STD and viv -- Raku standard grammar %] +[% SET title = 'STD and viv -- Raku standard grammar' %] -[% menu nav compilers %] +[% PROCESS 'menu-nav' current = 'compilers' %]
- [% include camelia %] + [% INCLUDE 'camelia' %]

STD and viv

diff --git a/source/downloads/index.html b/source/downloads/index.tt similarity index 96% rename from source/downloads/index.html rename to source/downloads/index.tt index a7f0d3b8f..34def8a6a 100644 --- a/source/downloads/index.html +++ b/source/downloads/index.tt @@ -1,9 +1,9 @@ -[% setvar title Raku Download %] +[% SET title = 'Raku Download' %] -[% menu nav download %] +[% PROCESS 'menu-nav' current = 'download' %]
- [% include camelia %] +[% INCLUDE 'camelia' %]

Download Raku

diff --git a/source/fun/index.html b/source/fun/index.tt similarity index 95% rename from source/fun/index.html rename to source/fun/index.tt index 487d0e5ff..1bbe99d3e 100644 --- a/source/fun/index.html +++ b/source/fun/index.tt @@ -1,9 +1,9 @@ -[% setvar title Raku is optimized for fun! %] +[% SET title = 'Raku is optimized for fun!' %] -[% menu nav fun %] +[% PROCESS 'menu-nav' current = 'fun' %]

- [% include camelia %] + [% INCLUDE 'camelia' %]

Raku® is optimized for fun!

diff --git a/source/getting-started/index.html b/source/getting-started/index.tt similarity index 94% rename from source/getting-started/index.html rename to source/getting-started/index.tt index 57faa3658..bad7242ea 100644 --- a/source/getting-started/index.html +++ b/source/getting-started/index.tt @@ -1,10 +1,10 @@ -[% setvar title Getting started with Raku %] +[% SET title = 'Getting started with Raku' %] -[% menu nav gettingstarted %] +[% PROCESS 'menu-nav' current = 'gettingstarted' %]
- [% include camelia %] -

[% readvar title %]

+ [% INCLUDE 'camelia' %] +

[% GET title %]

You are new to Raku? The other pages on this site offer too many options and confuse you? Then here is the right place to read on.

diff --git a/source/getting-started/involved.html b/source/getting-started/involved.tt similarity index 92% rename from source/getting-started/involved.html rename to source/getting-started/involved.tt index e3e00d99c..538d7f131 100644 --- a/source/getting-started/involved.html +++ b/source/getting-started/involved.tt @@ -1,10 +1,10 @@ -[% setvar title Get Involved - Help making Raku %] +[% SET title = 'Get Involved - Help making Raku' %] -[% menu nav gettingstarted %] +[% PROCESS 'menu-nav' current = 'gettingstarted' %]
- [% include camelia %] -

[% readvar title %]

+ [% INCLUDE 'camelia' %] +

[% GET title %]

You don't need to be a guru or a wizard to help Raku development. Just some free time, and the willingness to be part of a great diff --git a/source/index.html b/source/index.tt similarity index 95% rename from source/index.html rename to source/index.tt index 5ff265d8b..c217752d6 100644 --- a/source/index.html +++ b/source/index.tt @@ -1,19 +1,15 @@ -[% setvar title Raku Programming Language %] +[% SET title = 'Raku Programming Language' %] -[% menu nav home %] +[% PROCESS 'menu-nav' current = 'home' %] -[% setvar more_header - - - -%] +[% SET extra_header_template = 'more-header' %]

The Raku Programming Language

- »ö« - [% include camelia %] + [% INCLUDE 'camelia' %]

Raku Resources

diff --git a/source/snippets/99-bottles.html b/source/snippets/99-bottles.tt similarity index 100% rename from source/snippets/99-bottles.html rename to source/snippets/99-bottles.tt diff --git a/source/snippets/birth-date.html b/source/snippets/birth-date.tt similarity index 100% rename from source/snippets/birth-date.html rename to source/snippets/birth-date.tt diff --git a/source/snippets/color-fade.html b/source/snippets/color-fade.tt similarity index 100% rename from source/snippets/color-fade.html rename to source/snippets/color-fade.tt diff --git a/source/snippets/duplicate-word.html b/source/snippets/duplicate-word.tt similarity index 100% rename from source/snippets/duplicate-word.html rename to source/snippets/duplicate-word.tt diff --git a/source/snippets/liftoff.html b/source/snippets/liftoff.tt similarity index 100% rename from source/snippets/liftoff.html rename to source/snippets/liftoff.tt diff --git a/source/specification/index.html b/source/specification/index.tt similarity index 96% rename from source/specification/index.html rename to source/specification/index.tt index 83230a8dc..c4b214fb4 100644 --- a/source/specification/index.html +++ b/source/specification/index.tt @@ -1,9 +1,9 @@ -[% setvar title Raku Language Design %] +[% SET title = 'Raku Language Design' %] -[% menu nav specs %] +[% PROCESS 'menu-nav' current = 'specs' %]

- [% include camelia %] + [% INCLUDE 'camelia' %]

Raku Language Design

diff --git a/source/whatever/index.html b/source/whatever/index.tt similarity index 96% rename from source/whatever/index.html rename to source/whatever/index.tt index 868d06129..9c2822603 100644 --- a/source/whatever/index.html +++ b/source/whatever/index.tt @@ -1,9 +1,9 @@ -[% setvar title Raku - Whatever %] +[% SET title = 'Raku - Whatever' %] -[% menu nav whatever %] +[% PROCESS 'menu-nav' current = 'whatever' %]
- [% include camelia %] + [% INCLUDE 'camelia' %]

Raku - IDEs

From 0cc5b6455f8831e5d7baf7d93ae376c4e8abe7a1 Mon Sep 17 00:00:00 2001 From: 2colours <37218286+2colours@users.noreply.github.com> Date: Mon, 7 Aug 2023 03:35:10 +0200 Subject: [PATCH 02/16] Porting the fetch-recent-posts script to Raku --- fetch-recent-blog-posts.raku | 47 ++++++++++++++++++++++++++++++++++++ update.sh | 3 +-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 fetch-recent-blog-posts.raku diff --git a/fetch-recent-blog-posts.raku b/fetch-recent-blog-posts.raku new file mode 100644 index 000000000..2631857d5 --- /dev/null +++ b/fetch-recent-blog-posts.raku @@ -0,0 +1,47 @@ +#!/usr/bin/env raku + +use LibXML::Reader; +use HTTP::Tiny; +use JSON::Fast; + +my $tx = HTTP::Tiny.new.get("https://planet.raku.org/atom.xml"); + +unless $tx { + warn "ERROR $tx ($tx)"; + exit; +} + +my $xml-content = $tx.decode; + +my $globalReader = LibXML::Reader.new: string => $xml-content; + +my $found-posts = 0; +my @posts-data = gather while $globalReader.nextElement('entry') && $found-posts < 7 { + my $entryString = $globalReader.readOuterXml; + + my $entryReader = LibXML::Reader.new: string => $entryString; + # Look for text/html links and use the first without it if we don't find any + my $link-href; + while $entryReader.nextElement('link') { + + next if $entryReader.getAttribute('rel') andthen $_ eq 'replies'; + if $entryReader.getAttribute('type') andthen $_ eq 'text/html' { + $link-href = $entryReader.getAttribute('href'); + last; + } + $_ = $entryReader.getAttribute('href') without $link-href; + } + # Hackish fix to get rid of comment entries from medium.com. + # Only articles appear to have `category` elements, so if we detect + # an entry from medium.com, ensure it also has `category` element + next if $link-href.starts-with('https://medium\.com') && !LibXML::Reader.new(string => $entryString).nextElement('category'); + + my $title = LibXML::Reader.new(string => $entryString).&{ .nextElement('title') && .readInnerXml }; + + $found-posts++; + take { :$title, link => $link-href }; # TODO these used to be "XML escaped" but what does that mean and is that even needed? + +}; + +'online/recent-blog-posts.json'.IO.spurt: to-json @posts-data; +say 'Successfully wrote new blog posts'; diff --git a/update.sh b/update.sh index 1ed72fa12..d56d26944 100755 --- a/update.sh +++ b/update.sh @@ -3,13 +3,12 @@ # this script is used by www.p6c.org to update the # installation at www.perl6.org date -source ~/perl5/perlbrew/etc/bashrc set -e cd ~/perl6.org git fetch -q BEFORE=$(git rev-parse HEAD) git checkout -q -f origin/master -./fetch-recent-blog-posts.pl +./fetch-recent-blog-posts.raku if [ "$BEFORE" != "$(git rev-parse HEAD)" ] then if git diff --quiet $BEFORE HEAD update.sh From 0ed47475090cd2002f3e03200eef4df28bbedf9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sat, 12 Aug 2023 01:57:14 +0200 Subject: [PATCH 03/16] Apparent switch from mowyw in the generation process Disclaimer: completely untested prototype. --- mowyw.conf | 2 -- process-templates.raku | 37 +++++++++++++++++++++++++++++++++++++ update.sh | 4 ++-- 3 files changed, 39 insertions(+), 4 deletions(-) delete mode 100644 mowyw.conf create mode 100644 process-templates.raku diff --git a/mowyw.conf b/mowyw.conf deleted file mode 100644 index bf2a7138d..000000000 --- a/mowyw.conf +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE[20] = \.html$ -EXCLUDE[90] = archive/rfc/\d+\.html$ diff --git a/process-templates.raku b/process-templates.raku new file mode 100644 index 000000000..7ee45c2d9 --- /dev/null +++ b/process-templates.raku @@ -0,0 +1,37 @@ +#!/usr/bin/env raku +use v6.d; +use Path::Finder:ver<0.4.5>; +use Template6:ver<0.13.0>; + + +sub published-counterpart(IO::Path $source-path) { + 'online'.IO.add: $source-path.relative('source') +} + +sub is-freshly-modified($_, *%) { + .&published-counterpart.modified < .modified +} + +sub MAIN(Bool :$incremental) { + + my $wrapper-engine = Template6.new: wrappers => ['common-wrapper']; + $wrapper-engine.add-path: 'includes'; + + my $wrapped-templates = Path::Finder.skip-dir('snippets').file.ext('tt'); + $wrapped-templates.=and(&is-freshly-modified) if $incremental; + + for $wrapped-templates.in('source', :!loop-safe, :!sorted) { + .&published-counterpart.spurt: $wrapper-engine.process($_); + } + + my $raw-engine = Template6.new; + $wrapper-engine.add-path: 'includes'; + + my $raw-templates = Path::Finder.ext('tt'); + $raw-templates.=and(&is-freshly-modified) if $incremental; + + for $raw-templates.in('source/snippets', :!loop-safe, :!sorted) { + .&published-counterpart.spurt: $wrapper-engine.process($_); + } + +} \ No newline at end of file diff --git a/update.sh b/update.sh index d56d26944..11e3f87b4 100755 --- a/update.sh +++ b/update.sh @@ -15,8 +15,8 @@ then then cp update.sh ~/update.sh fi if git diff --quiet $BEFORE HEAD includes - then mowyw --make - else mowyw + then ./process-templates.raku --incremental + else ./process-templates.raku fi fi From a774ee76dbe77029bd2a3814283a632e6dc1264a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sat, 12 Aug 2023 01:59:16 +0200 Subject: [PATCH 04/16] Removing further mowyw-specific features from the templates --- includes/menu-nav.tt | 3 --- source/snippets/99-bottles.tt | 18 +++++++++--------- source/snippets/birth-date.tt | 22 +++++++++++----------- source/snippets/color-fade.tt | 16 ++++++++-------- source/snippets/duplicate-word.tt | 12 ++++++------ source/snippets/liftoff.tt | 12 ++++++------ 6 files changed, 40 insertions(+), 43 deletions(-) diff --git a/includes/menu-nav.tt b/includes/menu-nav.tt index 1feee58bd..365a65b96 100644 --- a/includes/menu-nav.tt +++ b/includes/menu-nav.tt @@ -25,6 +25,3 @@
- - -[% comment vim: set tw=0 ft=html : %] diff --git a/source/snippets/99-bottles.tt b/source/snippets/99-bottles.tt index 7c2689ee1..569895724 100644 --- a/source/snippets/99-bottles.tt +++ b/source/snippets/99-bottles.tt @@ -1,12 +1,12 @@ -
[% syntax perl6 %]
-my @beers = 'beers', 'beer', 'beers' xx 97;
+
+my @beers = 'beers', 'beer', 'beers' xx 97;
 
-for reverse(1..99) Z reverse(0..98) -> $n, $nn {
-    say "$n @beers[$n] on the wall!";
-    say "$n @beers[$n]!";
-    say "Take one down, pass it around,";
-    say "$nn @beers[$nn] on the wall!";
+for reverse(1..99) Z reverse(0..98) -> $n, $nn {
+    say "$n @beers[$n] on the wall!";
+    say "$n @beers[$n]!";
+    say "Take one down, pass it around,";
+    say "$nn @beers[$nn] on the wall!";
 }
-[% endsyntax %]
-[% option no-header %][% option no-footer %] +
+ diff --git a/source/snippets/birth-date.tt b/source/snippets/birth-date.tt index f738a42ca..12efc10d5 100644 --- a/source/snippets/birth-date.tt +++ b/source/snippets/birth-date.tt @@ -1,16 +1,16 @@ -
[% syntax perl6 %]
-my $birth-date-string = prompt "When were you born (yyyy-mm-dd)?";
-my $birth-date = Date.new($birth-date-string);
+
+my $birth-date-string = prompt "When were you born (yyyy-mm-dd)?";
+my $birth-date = Date.new($birth-date-string);
 
-my $today = Date.today;
-my $age = $today.year - $birth-date.year;
+my $today = Date.today;
+my $age = $today.year - $birth-date.year;
 
-# But your birthday this year may not have been yet
-if $today.day-of-year < $birth-date.day-of-year {
-    $age--;
+# But your birthday this year may not have been yet
+if $today.day-of-year < $birth-date.day-of-year {
+    $age--;
 }
 
-say "You are $age years old!";
-[% endsyntax %]
-[% option no-header %][% option no-footer %] +say "You are $age years old!"; +
+ diff --git a/source/snippets/color-fade.tt b/source/snippets/color-fade.tt index cf14f879a..3d47c4872 100644 --- a/source/snippets/color-fade.tt +++ b/source/snippets/color-fade.tt @@ -1,11 +1,11 @@ -
[% syntax perl6 %]
-my @scale = ("$_$_" for 0..9, );
-my @zeroes = '00' xx 16;
+
+my @scale = ("$_$_" for 0..9, <a b c d e f>);
+my @zeroes = '00' xx 16;
 
-# Fade from red to blue
-for @scale.reverse Z @zeroes Z @scale -> $r, $g, $b {
-    say "#$r$g$b";
+# Fade from red to blue
+for @scale.reverse Z @zeroes Z @scale -> $r, $g, $b {
+    say "#$r$g$b";
 }
-[% endsyntax %]
-[% option no-header %][% option no-footer %] +
+ diff --git a/source/snippets/duplicate-word.tt b/source/snippets/duplicate-word.tt index 3bbd7c9f2..c079fde51 100644 --- a/source/snippets/duplicate-word.tt +++ b/source/snippets/duplicate-word.tt @@ -1,9 +1,9 @@ -
[% syntax perl6 %]
-my $sentence = "I am going to go feed the the cat.";
+
+my $sentence = "I am going to go feed the the cat.";
 
-if $sentence ~~ / (\w+) \h+ $0 / {
-    say "Duplicate word '$0 $0' found at position $/.from().";
+if $sentence ~~ / (\w+) \h+ $0 / {
+    say "Duplicate word '$0 $0' found at position $/.from().";
 }
-[% endsyntax %]
-[% option no-header %][% option no-footer %] +
+ diff --git a/source/snippets/liftoff.tt b/source/snippets/liftoff.tt index 5fe1ce5c7..f7446c1ad 100644 --- a/source/snippets/liftoff.tt +++ b/source/snippets/liftoff.tt @@ -1,8 +1,8 @@ -
[% syntax perl6 %]
-for 10 ... 0 -> $count {
-    say "$count...";
-    LAST { say "Liftoff!" };
+
+for 10 ... 0 -> $count {
+    say "$count...";
+    LAST { say "Liftoff!" };
 }
-[% endsyntax %]
-[% option no-header %][% option no-footer %] +
+ From caec48ad07416c8b21cb3e45930acaafcf5d8039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Thu, 17 Aug 2023 03:02:43 +0200 Subject: [PATCH 05/16] online/ generation, template generation fixes - the variables need to be reset on each processing - the other files need to be copied - camelia needs to be inserted literally, rather than processed --- process-templates.raku | 28 ++++++++++++++++++++------- source/about/index.tt | 2 +- source/community/index.tt | 2 +- source/community/irc/index.tt | 2 +- source/community/rosettacode/index.tt | 2 +- source/compilers/index.tt | 2 +- source/compilers/std-viv.tt | 2 +- source/downloads/index.tt | 4 ++-- source/fun/index.tt | 2 +- source/getting-started/index.tt | 2 +- source/getting-started/involved.tt | 2 +- source/resources/index.tt | 2 +- source/specification/index.tt | 2 +- source/whatever/index.tt | 2 +- 14 files changed, 35 insertions(+), 21 deletions(-) diff --git a/process-templates.raku b/process-templates.raku index 7ee45c2d9..b1c6449ca 100644 --- a/process-templates.raku +++ b/process-templates.raku @@ -5,7 +5,8 @@ use Template6:ver<0.13.0>; sub published-counterpart(IO::Path $source-path) { - 'online'.IO.add: $source-path.relative('source') + my $same-under-online = 'online'.IO.add: $source-path.relative('source'); + $same-under-online.extension eq 'tt' ?? $same-under-online.extension('html') !! $same-under-online } sub is-freshly-modified($_, *%) { @@ -14,24 +15,37 @@ sub is-freshly-modified($_, *%) { sub MAIN(Bool :$incremental) { - my $wrapper-engine = Template6.new: wrappers => ['common-wrapper']; + my $non-templates = Path::Finder.file.ext(none('tt')); + $non-templates.=and(&is-freshly-modified) if $incremental; + + for $non-templates.in('source', :!loop-safe, :!sorted).race { + print "Copying '$_'..." if %*ENV; + .copy: .&published-counterpart; + say 'Done.' if %*ENV; + } + + my $wrapper-engine = Template6.new: wrappers => ['common-wrapper'], :reset; $wrapper-engine.add-path: 'includes'; my $wrapped-templates = Path::Finder.skip-dir('snippets').file.ext('tt'); $wrapped-templates.=and(&is-freshly-modified) if $incremental; - for $wrapped-templates.in('source', :!loop-safe, :!sorted) { + for $wrapped-templates.in('source', :!loop-safe, :!sorted).race { + print "Processing '$_'..." if %*ENV; .&published-counterpart.spurt: $wrapper-engine.process($_); + say 'Done.' if %*ENV; } - my $raw-engine = Template6.new; - $wrapper-engine.add-path: 'includes'; + my $raw-engine = Template6.new: :reset; + $raw-engine.add-path: 'includes'; my $raw-templates = Path::Finder.ext('tt'); $raw-templates.=and(&is-freshly-modified) if $incremental; - for $raw-templates.in('source/snippets', :!loop-safe, :!sorted) { - .&published-counterpart.spurt: $wrapper-engine.process($_); + for $raw-templates.in('source/snippets', :!loop-safe, :!sorted).race { + print "Processing '$_'..." if %*ENV; + .&published-counterpart.spurt: $raw-engine.process($_); + say 'Done.' if %*ENV; } } \ No newline at end of file diff --git a/source/about/index.tt b/source/about/index.tt index c69924696..0d3ed1959 100644 --- a/source/about/index.tt +++ b/source/about/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'about' %]
- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

About raku.org

raku.org is, just like Raku, a volunteer driven project. Content on raku.org should be up-to-date rather than comprehensive. diff --git a/source/community/index.tt b/source/community/index.tt index b1203efbb..a19eda2da 100644 --- a/source/community/index.tt +++ b/source/community/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'community' %]

-[% INCLUDE 'camelia' %] +[% INSERT 'camelia' %]

The Raku Community welcomes you

diff --git a/source/community/irc/index.tt b/source/community/irc/index.tt index 83657f79c..2f8d67f75 100644 --- a/source/community/irc/index.tt +++ b/source/community/irc/index.tt @@ -2,7 +2,7 @@ [% PROCESS 'menu-nav' current = 'community' %]

- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

[% GET title %]

diff --git a/source/community/rosettacode/index.tt b/source/community/rosettacode/index.tt index 1491ee429..4c5a23ab0 100644 --- a/source/community/rosettacode/index.tt +++ b/source/community/rosettacode/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'community' %]

- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

[% GET title %]

diff --git a/source/compilers/index.tt b/source/compilers/index.tt index f98c1d902..ee41e9287 100644 --- a/source/compilers/index.tt +++ b/source/compilers/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'compilers' %]

- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

Raku Compilers

diff --git a/source/compilers/std-viv.tt b/source/compilers/std-viv.tt index a3f2e8b1f..0b999fe62 100644 --- a/source/compilers/std-viv.tt +++ b/source/compilers/std-viv.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'compilers' %]
- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

STD and viv

diff --git a/source/downloads/index.tt b/source/downloads/index.tt index 34def8a6a..d83f8fcc9 100644 --- a/source/downloads/index.tt +++ b/source/downloads/index.tt @@ -1,9 +1,9 @@ [% SET title = 'Raku Download' %] -[% PROCESS 'menu-nav' current = 'download' %] +[% PROCESS 'menu-nav' current = 'downloads' %]
-[% INCLUDE 'camelia' %] +[% INSERT 'camelia' %]

Download Raku

diff --git a/source/fun/index.tt b/source/fun/index.tt index 1bbe99d3e..29bee9a6b 100644 --- a/source/fun/index.tt +++ b/source/fun/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'fun' %]

- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

Raku® is optimized for fun!

diff --git a/source/getting-started/index.tt b/source/getting-started/index.tt index bad7242ea..c9a4334ce 100644 --- a/source/getting-started/index.tt +++ b/source/getting-started/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'gettingstarted' %]
- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

[% GET title %]

You are new to Raku? The other pages on this site offer too many diff --git a/source/getting-started/involved.tt b/source/getting-started/involved.tt index 538d7f131..ec98752f5 100644 --- a/source/getting-started/involved.tt +++ b/source/getting-started/involved.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'gettingstarted' %]

- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

[% GET title %]

You don't need to be a guru or a wizard to help Raku development. diff --git a/source/resources/index.tt b/source/resources/index.tt index 9531bac6b..94879fc99 100644 --- a/source/resources/index.tt +++ b/source/resources/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'res' %]

- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

Raku Resources

diff --git a/source/specification/index.tt b/source/specification/index.tt index c4b214fb4..5cb82a545 100644 --- a/source/specification/index.tt +++ b/source/specification/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'specs' %]

- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

Raku Language Design

diff --git a/source/whatever/index.tt b/source/whatever/index.tt index 9c2822603..844db5344 100644 --- a/source/whatever/index.tt +++ b/source/whatever/index.tt @@ -3,7 +3,7 @@ [% PROCESS 'menu-nav' current = 'whatever' %]
- [% INCLUDE 'camelia' %] + [% INSERT 'camelia' %]

Raku - IDEs

From 72eda85f095d3410236b3f24dbea5ebaa661bc7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sat, 19 Aug 2023 14:02:50 +0200 Subject: [PATCH 06/16] No need for the Perl blog post fetcher anymore --- fetch-recent-blog-posts.pl | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 fetch-recent-blog-posts.pl diff --git a/fetch-recent-blog-posts.pl b/fetch-recent-blog-posts.pl deleted file mode 100755 index b59e37508..000000000 --- a/fetch-recent-blog-posts.pl +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env perl - -use Mojo::UserAgent; -use Mojo::JSON qw/encode_json/; -use Mojo::File qw/path/; -use Mojo::Util qw/xml_escape/; - -my $tx = Mojo::UserAgent->new->get("https://planet.raku.org/atom.xml"); - -if ( my $err = $tx->error ) { - warn $err->{code} ? "ERROR: $err->{code} response: $err->{message}" - : "Connection error: $err->{message}"; - exit; -} - -my $j = $tx->res->dom->find("entry")->grep(sub { - # Hackish fix to get rid of comment entries from medium.com. - # Only articles appear to have `category` elements, so if we detect - # an entry from medium.com, ensure it also has `category` element - $_->at('link')->{href} =~ m{^https://medium\.com} - ? $_->find('category')->each - : 1 - })->map(sub{ - # Look for text/html links and use the first without it if we don't find any - my $link = $_->at('link[type="text/html"]:not([rel="replies"])') - // $_->at('link:not([rel="replies"])'); - +{ - title => xml_escape($_->at("title")->all_text), - link => xml_escape($link->{href}), - } - })->to_array; - -path('online/recent-blog-posts.json')->spurt(encode_json([@$j[0..6]])); -print "Successfully wrote new blog posts\n"; - -exit; From cd13e62c38dbce2a8a86dbcecea4bb46524d3c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sat, 19 Aug 2023 14:30:27 +0200 Subject: [PATCH 07/16] Adding skeleton for distribution approach --- META6.json | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 META6.json diff --git a/META6.json b/META6.json new file mode 100644 index 000000000..c222db92d --- /dev/null +++ b/META6.json @@ -0,0 +1,29 @@ +{ + "auth": "zef:raku", + "authors": [ + "The Raku website authors" + ], + "build-depends": [ + ], + "depends": [ + "LibXML:ver<0.10.4>:auth:api<0.10.0>", + "HTTP::Tiny:ver<0.2.5>:auth", + "JSON::Fast:ver<0.19>:auth", + "Path::Finder:ver<0.4.6>:auth", + "Template6:ver<0.14.0>:auth" + ], + "description": "The distribution for the tooling of the raku.org site.", + "license": "Artistic-2.0", + "name": "raku-website", + "perl": "6.d", + "provides": { + }, + "resources": [ + ], + "source-url": "", + "tags": [ + ], + "test-depends": [ + ], + "version": "0.0.1" +} From eef37725b4ebb166a1582bdde2955f4fb5a5c806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sat, 19 Aug 2023 14:56:12 +0200 Subject: [PATCH 08/16] Change the name of the content publisher script --- process-templates.raku => publish-sources.raku | 0 update.sh | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename process-templates.raku => publish-sources.raku (100%) diff --git a/process-templates.raku b/publish-sources.raku similarity index 100% rename from process-templates.raku rename to publish-sources.raku diff --git a/update.sh b/update.sh index 11e3f87b4..e617ea113 100755 --- a/update.sh +++ b/update.sh @@ -15,8 +15,8 @@ then then cp update.sh ~/update.sh fi if git diff --quiet $BEFORE HEAD includes - then ./process-templates.raku --incremental - else ./process-templates.raku + then ./publish-sources.raku --incremental + else ./publish-sources.raku fi fi From 0cd7139bb2a213f9b61ab63eebb14c991429901e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sun, 27 Aug 2023 22:30:28 +0200 Subject: [PATCH 09/16] Update the README and improve reproducability overall. --- README.md | 23 +++++++++++------------ fetch-recent-blog-posts.raku | 6 +++--- publish-sources.raku | 4 ++-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index a003f49ff..c8230efbb 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ # raku.org This is the source code for . -It is rendered with [mowyw](https://perlgeek.de/en/software/mowyw) -every 15 minutes, so updates to the repository should also result in +It is rendered every 15 minutes, so updates to the repository should also result in an update of If not, talk to [moritz] on [#raku](https://kiwiirc.com/client/irc.libera.chat/#raku). -### Multilingual translation -[Chinese translation](https://github.com/ccworld1000/perl6.org). - ### Guidelines Here are some guidelines that you should respect when changing this site: @@ -56,20 +52,23 @@ Here are some guidelines that you should respect when changing this site: ### Build To run this site locally: - - Install the following modules: + - libxml2 is a native binary dependency; make sure to install it as your platform requires (except Windows where it's baked into the Raku dist) + + - for content generation, install this repository as a module: + `zef install .` + + - Install the following Perl modules for setting up the server: - `cpanm App::Mowyw Text::VimColor Plack IO::Socket::SSL HTML::Template::Compiled Mojolicious` + `cpanm Plack IO::Socket::SSL` - Run the following commands to populate the `./online` folder and launch a local web server for testing: - ``` - mowyw + ```sh + ./fetch-recent-blog-posts.raku + ./publish-sources.raku plackup ``` - Open http://localhost:5000/index.html in your browser -Tip: if you remove `source/archive` directory, `mowyw` generation will run a -lot faster. Useful for checking frequently-made changes. - ### LICENSE See [LICENSE](LICENSE) file for the details of the license of the code in this repository. diff --git a/fetch-recent-blog-posts.raku b/fetch-recent-blog-posts.raku index 2631857d5..fc4f3e831 100644 --- a/fetch-recent-blog-posts.raku +++ b/fetch-recent-blog-posts.raku @@ -1,8 +1,8 @@ #!/usr/bin/env raku -use LibXML::Reader; -use HTTP::Tiny; -use JSON::Fast; +use LibXML::Reader:ver<0.10.4>:auth:api<0.10.0>; +use HTTP::Tiny:ver<0.2.5>:auth; +use JSON::Fast:ver<0.19>:auth; my $tx = HTTP::Tiny.new.get("https://planet.raku.org/atom.xml"); diff --git a/publish-sources.raku b/publish-sources.raku index b1c6449ca..01ef2f8ec 100644 --- a/publish-sources.raku +++ b/publish-sources.raku @@ -1,7 +1,7 @@ #!/usr/bin/env raku use v6.d; -use Path::Finder:ver<0.4.5>; -use Template6:ver<0.13.0>; +use Path::Finder:ver<0.4.6>; +use Template6:ver<0.14.0>; sub published-counterpart(IO::Path $source-path) { From 54f54313512bb3292893cd5e2e76821dd2ccb3b1 Mon Sep 17 00:00:00 2001 From: 2colours <37218286+2colours@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:50:51 +0200 Subject: [PATCH 10/16] Request the latest blog posts from the live raku.org site --- source/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/js.js b/source/js.js index d40df77e3..b3d2a89ee 100644 --- a/source/js.js +++ b/source/js.js @@ -2,7 +2,7 @@ jQuery(function ($) { var el = $('#recent_blog_posts'); if ( ! el.length ) { return; } - $.ajax('recent-blog-posts.json') + $.ajax('https://raku.org/recent-blog-posts.json') .done(function(feed) { $(feed).each(function(){ el.append( From 8b0a4cd17ad6346b1bcb13142677c11dae47965b Mon Sep 17 00:00:00 2001 From: 2colours <2colours@github.com> Date: Tue, 21 Nov 2023 19:01:49 +0100 Subject: [PATCH 11/16] Take navbar modifications over --- includes/menu-nav | 39 --------------------------------------- includes/menu-nav.tt | 8 ++++---- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 includes/menu-nav diff --git a/includes/menu-nav b/includes/menu-nav deleted file mode 100644 index 7ca2c4fbf..000000000 --- a/includes/menu-nav +++ /dev/null @@ -1,39 +0,0 @@ -
- - -[% comment vim: set tw=0 ft=html : %] diff --git a/includes/menu-nav.tt b/includes/menu-nav.tt index 365a65b96..ca130be96 100644 --- a/includes/menu-nav.tt +++ b/includes/menu-nav.tt @@ -15,11 +15,11 @@ - - - + + + + -
From f45149c9328fc281b2da18ab722daa137370b3ed Mon Sep 17 00:00:00 2001 From: Coleman McFarland Date: Sun, 5 Nov 2023 09:55:17 -0500 Subject: [PATCH 12/16] Add Dockerfile to serve static files with Caddy We add a basic Caddyfile that compiles static assets to ./online and then serves these from the web root /usr/share/caddy inside the container. 404 handlers are TODO --- Caddyfile | 5 +++++ Dockerfile | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Caddyfile create mode 100644 Dockerfile diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 000000000..c1e2ec3a1 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,5 @@ +http://localhost:5500 { + root * /usr/share/caddy + file_server +} + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8a5f4a36b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM docker.io/perl:5.38.0 as builder + +WORKDIR /usr/src/app + +RUN cpan App::Mowyw +RUN cpan Plack +RUN cpan Mojo::UserAgent + +COPY . . +RUN perl fetch-recent-blog-posts.pl +RUN mowyw + +FROM docker.io/caddy:latest +# Processed static files are written to ./online +COPY --from=builder /usr/src/app/online /usr/share/caddy +COPY Caddyfile /etc/caddy/Caddyfile + From 6b807049a1d743a356e63d44af5220e0698fd1bf Mon Sep 17 00:00:00 2001 From: 2colours <2colours@github.com> Date: Tue, 21 Nov 2023 22:26:47 +0100 Subject: [PATCH 13/16] Setting up the first sharable version --- Dockerfile | 10 +++------- META6.json | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a5f4a36b..6a89363cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,10 @@ -FROM docker.io/perl:5.38.0 as builder +FROM docker.io/rakudo-star:latest as builder WORKDIR /usr/src/app -RUN cpan App::Mowyw -RUN cpan Plack -RUN cpan Mojo::UserAgent - COPY . . -RUN perl fetch-recent-blog-posts.pl -RUN mowyw +RUN zef install --deps-only . +RUN ./publish-sources.raku FROM docker.io/caddy:latest # Processed static files are written to ./online diff --git a/META6.json b/META6.json index c222db92d..3e0d56458 100644 --- a/META6.json +++ b/META6.json @@ -6,7 +6,6 @@ "build-depends": [ ], "depends": [ - "LibXML:ver<0.10.4>:auth:api<0.10.0>", "HTTP::Tiny:ver<0.2.5>:auth", "JSON::Fast:ver<0.19>:auth", "Path::Finder:ver<0.4.6>:auth", From 654f9c69db6f6471b828d3ddaa2f47d3f87cf246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Polg=C3=A1r?= <37218286+2colours@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:02:27 +0100 Subject: [PATCH 14/16] Ensure the existence of parent folder for file operations --- publish-sources.raku | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/publish-sources.raku b/publish-sources.raku index 01ef2f8ec..51fd791ea 100644 --- a/publish-sources.raku +++ b/publish-sources.raku @@ -4,7 +4,8 @@ use Path::Finder:ver<0.4.6>; use Template6:ver<0.14.0>; -sub published-counterpart(IO::Path $source-path) { +sub published-counterpart(IO::Path $source-path, Bool :$safe-path) { + mkdir $source-path.parent if $safe-path; my $same-under-online = 'online'.IO.add: $source-path.relative('source'); $same-under-online.extension eq 'tt' ?? $same-under-online.extension('html') !! $same-under-online } @@ -20,7 +21,7 @@ sub MAIN(Bool :$incremental) { for $non-templates.in('source', :!loop-safe, :!sorted).race { print "Copying '$_'..." if %*ENV; - .copy: .&published-counterpart; + .copy: .&published-counterpart(:safe-path); say 'Done.' if %*ENV; } @@ -32,7 +33,7 @@ sub MAIN(Bool :$incremental) { for $wrapped-templates.in('source', :!loop-safe, :!sorted).race { print "Processing '$_'..." if %*ENV; - .&published-counterpart.spurt: $wrapper-engine.process($_); + .&published-counterpart(:safe-path).spurt: $wrapper-engine.process($_); say 'Done.' if %*ENV; } @@ -44,8 +45,8 @@ sub MAIN(Bool :$incremental) { for $raw-templates.in('source/snippets', :!loop-safe, :!sorted).race { print "Processing '$_'..." if %*ENV; - .&published-counterpart.spurt: $raw-engine.process($_); + .&published-counterpart(:safe-path).spurt: $raw-engine.process($_); say 'Done.' if %*ENV; } -} \ No newline at end of file +} From 99e458aaba3675db1a83d85181f4957cf0485dbd Mon Sep 17 00:00:00 2001 From: 2colours <2colours@github.com> Date: Wed, 22 Nov 2023 19:25:58 +0100 Subject: [PATCH 15/16] The target directory should be created, not the source directory --- publish-sources.raku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish-sources.raku b/publish-sources.raku index 51fd791ea..88dcbfed1 100644 --- a/publish-sources.raku +++ b/publish-sources.raku @@ -5,8 +5,8 @@ use Template6:ver<0.14.0>; sub published-counterpart(IO::Path $source-path, Bool :$safe-path) { - mkdir $source-path.parent if $safe-path; my $same-under-online = 'online'.IO.add: $source-path.relative('source'); + mkdir $same-under-online.parent if $safe-path; $same-under-online.extension eq 'tt' ?? $same-under-online.extension('html') !! $same-under-online } From fba14a0d3246b2de518f6c6b477a1a131116b020 Mon Sep 17 00:00:00 2001 From: 2colours <2colours@github.com> Date: Sun, 26 Nov 2023 16:11:03 +0100 Subject: [PATCH 16/16] Open raku files rather than invoke them --- Dockerfile | 2 +- README.md | 4 ++-- update.sh | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a89363cc..560f9dbf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /usr/src/app COPY . . RUN zef install --deps-only . -RUN ./publish-sources.raku +RUN raku publish-sources.raku FROM docker.io/caddy:latest # Processed static files are written to ./online diff --git a/README.md b/README.md index c8230efbb..e327c517f 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,8 @@ To run this site locally: - Run the following commands to populate the `./online` folder and launch a local web server for testing: ```sh - ./fetch-recent-blog-posts.raku - ./publish-sources.raku + raku fetch-recent-blog-posts.raku + raku publish-sources.raku plackup ``` - Open http://localhost:5000/index.html in your browser diff --git a/update.sh b/update.sh index e617ea113..d3263e711 100755 --- a/update.sh +++ b/update.sh @@ -8,15 +8,15 @@ cd ~/perl6.org git fetch -q BEFORE=$(git rev-parse HEAD) git checkout -q -f origin/master -./fetch-recent-blog-posts.raku +raku fetch-recent-blog-posts.raku if [ "$BEFORE" != "$(git rev-parse HEAD)" ] then if git diff --quiet $BEFORE HEAD update.sh then cp update.sh ~/update.sh fi if git diff --quiet $BEFORE HEAD includes - then ./publish-sources.raku --incremental - else ./publish-sources.raku + then raku publish-sources.raku --incremental + else raku publish-sources.raku fi fi