svn commit: r1808651 - /ofbiz/site/php2html.sh

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1808651 - /ofbiz/site/php2html.sh

Taher Alkhateeb
Author: taher
Date: Sun Sep 17 20:33:25 2017
New Revision: 1808651

URL: http://svn.apache.org/viewvc?rev=1808651&view=rev
Log:
Improved: applied a simpler implementation for php2html

Loop over all page templates and generate them instead of the copy-paste
pattern and hardcoding the name of each template into the script.

Modified:
    ofbiz/site/php2html.sh

Modified: ofbiz/site/php2html.sh
URL: http://svn.apache.org/viewvc/ofbiz/site/php2html.sh?rev=1808651&r1=1808650&r2=1808651&view=diff
==============================================================================
--- ofbiz/site/php2html.sh (original)
+++ ofbiz/site/php2html.sh Sun Sep 17 20:33:25 2017
@@ -19,18 +19,8 @@
 #####################################################################
 
 # This shell script creates the site HTML files from the PHP templates
-php template/html.tpl.php template/page/about-ofbiz.tpl.php > about-ofbiz.html
-php template/html.tpl.php template/page/business-users.tpl.php >business-users.html
-php template/html.tpl.php template/page/developers.tpl.php > developers.html
-php template/html.tpl.php template/page/download.tpl.php > download.html
-php template/html.tpl.php template/page/release-notes-16.11.03.tpl.php > release-notes-16.11.03.html
-php template/html.tpl.php template/page/release-notes-13.07.03.tpl.php > release-notes-13.07.03.html
-php template/html.tpl.php template/page/faqs.tpl.php > faqs.html
-php template/html.tpl.php template/page/getting-involved.tpl.php > getting-involved.html
-php template/html.tpl.php template/page/index.tpl.php > index.html
-php template/html.tpl.php template/page/mailing-lists.tpl.php > mailing-lists.html
-php template/html.tpl.php template/page/ofbiz-demos.tpl.php > ofbiz-demos.html
-php template/html.tpl.php template/page/our-users.tpl.php >our-users.html
-php template/html.tpl.php template/page/service-providers.tpl.php > service-providers.html
-php template/html.tpl.php template/page/source-repositories.tpl.php > source-repositories.html
-php template/html.tpl.php template/page/user-stories.tpl.php > user-stories.html
+SITE_DIR="$(cd -P "$(dirname "$0")" && pwd)"
+for template in $SITE_DIR/template/page/*.tpl.php; do
+    filename=$(basename $template)
+    php $SITE_DIR/template/html.tpl.php $template > $SITE_DIR/${filename%.tpl.php}.html
+done


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1808651 - /ofbiz/site/php2html.sh

Jacques Le Roux
Administrator
Thanks Taher,

Better indeed, so you think we will keep PHP for a moment right? (not a problem with me)

Jacques


Le 17/09/2017 à 22:33, [hidden email] a écrit :

> Author: taher
> Date: Sun Sep 17 20:33:25 2017
> New Revision: 1808651
>
> URL: http://svn.apache.org/viewvc?rev=1808651&view=rev
> Log:
> Improved: applied a simpler implementation for php2html
>
> Loop over all page templates and generate them instead of the copy-paste
> pattern and hardcoding the name of each template into the script.
>
> Modified:
>      ofbiz/site/php2html.sh
>
> Modified: ofbiz/site/php2html.sh
> URL: http://svn.apache.org/viewvc/ofbiz/site/php2html.sh?rev=1808651&r1=1808650&r2=1808651&view=diff
> ==============================================================================
> --- ofbiz/site/php2html.sh (original)
> +++ ofbiz/site/php2html.sh Sun Sep 17 20:33:25 2017
> @@ -19,18 +19,8 @@
>   #####################################################################
>  
>   # This shell script creates the site HTML files from the PHP templates
> -php template/html.tpl.php template/page/about-ofbiz.tpl.php > about-ofbiz.html
> -php template/html.tpl.php template/page/business-users.tpl.php >business-users.html
> -php template/html.tpl.php template/page/developers.tpl.php > developers.html
> -php template/html.tpl.php template/page/download.tpl.php > download.html
> -php template/html.tpl.php template/page/release-notes-16.11.03.tpl.php > release-notes-16.11.03.html
> -php template/html.tpl.php template/page/release-notes-13.07.03.tpl.php > release-notes-13.07.03.html
> -php template/html.tpl.php template/page/faqs.tpl.php > faqs.html
> -php template/html.tpl.php template/page/getting-involved.tpl.php > getting-involved.html
> -php template/html.tpl.php template/page/index.tpl.php > index.html
> -php template/html.tpl.php template/page/mailing-lists.tpl.php > mailing-lists.html
> -php template/html.tpl.php template/page/ofbiz-demos.tpl.php > ofbiz-demos.html
> -php template/html.tpl.php template/page/our-users.tpl.php >our-users.html
> -php template/html.tpl.php template/page/service-providers.tpl.php > service-providers.html
> -php template/html.tpl.php template/page/source-repositories.tpl.php > source-repositories.html
> -php template/html.tpl.php template/page/user-stories.tpl.php > user-stories.html
> +SITE_DIR="$(cd -P "$(dirname "$0")" && pwd)"
> +for template in $SITE_DIR/template/page/*.tpl.php; do
> +    filename=$(basename $template)
> +    php $SITE_DIR/template/html.tpl.php $template > $SITE_DIR/${filename%.tpl.php}.html
> +done
>
>
>