To use need to download executable file pghtml to directory from PATH environment variable.
The program is free, source code is open, allow to make own builds and include them in third-party projects with a link to this product.

As possible, free support and consultations are provided, more details on page Contacts

Download for Linux
pghtml

Download for Windows
pghtml.zip


For advanced users, there is complete tar-archive with source code, executables, and example.

Download tar-archive
pghtml_all.tar


Command line

For batch use, installation is carried out in command line:
1. Utility wget download the executable file to directory /usr/bin
wget --directory-prefix=/usr/bin https://pghtml.org/files/download/pghtml

2. Command chmod set right permissions to execute
chmod a+x /usr/bin/pghtml


Installation example
[root@pgsuite ~]# wget --directory-prefix=/usr/bin https://pghtml.org/files/download/pghtml
--2024-07-06 10:00:42--  https://pghtml.org/files/download/pghtml
Resolving pghtml.org (pghtml.org)... 194.67.205.60
Connecting to pghtml.org (pghtml.org)|194.67.205.60|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 83800 (82K) [application/octet-stream]
Saving to: ‘/usr/bin/pghtml’

100%[========================================================================>] 83,800      --.-K/s   in 0.001s

2024-07-06 10:00:42 (71.9 MB/s) - ‘/usr/bin/pghtml’ saved [83800/83800]

[root@pgsuite ~]# chmod a+x /usr/bin/pghtml


Create service

To create service in linux operating system, can use script service-create.sh:
1. Download it and run it with pghtml parameters
curl -s https://pghtml.org/files/download/service-create.sh | bash -s - -d [database] -hd [site-dir]

2. Start service, check its status
systemctl start pghtml
systemctl status pghtml
pghtml status

Example
[root@pgsuite ~]# curl -s https://pghtml.org/files/download/service-create.sh | bash -s - -d pgsuite -hd /tmp/example
pghtml service has been successfully created, use "systemctl start pghtml" to start

[root@pgsuite ~]# systemctl start pghtml

[root@pgsuite ~]# systemctl status pghtml
● pghtml.service - PGHtml (HTML template engine using PostgreSQL)
   Loaded: loaded (/etc/systemd/system/pghtml.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2024-07-06 12:12:10 MSK; 4s ago
 Main PID: 2620 (pghtml)
   CGroup: /system.slice/pghtml.service
           └─2620 /usr/bin/pghtml execute -d pgsuite -hd /tmp/example

Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.608 INFO  FILE_MAKER    processing example-full.pghtml template
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.645 INFO  FILE_MAKER    file example-full.html updated
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.645 INFO  FILE_MAKER    processing example-simple.pghtml template
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.648 INFO  FILE_MAKER    file example-simple.html does not update required
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.648 INFO  FILE_MAKER    processing example-template.pghtml template
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.648 INFO  FILE_MAKER    file example-template.html does not update required
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.648 INFO  FILE_MAKER    processing ru/example-simple-ru.pghtml template
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.651 INFO  FILE_MAKER    file ru/example-simple-ru.html does not update required
Jul 06 12:12:10 pgsuite.org pghtml[2620]: 2024-07-06 12:12:10.651 INFO  FILE_MAKER    directory synced successfully

[root@pgsuite ~]# pghtml status
PGHtml is HTML template engine using PostgreSQL
version 24.2.7, linux 64 bits

Parameters
  HTTP
    directory:         /tmp/example
    sync interval:     600s
    port:              5480
  database
    host:              127.0.0.1
    port:              5432
    database:          pgsuite
    host for service:  127.0.0.1
    user for service:  postgres
  administration
    port:              15480

Status info
  uptime:    0 00:01:12
  threads:   3


GitHub

The source code is upload in GitHub repository


License

PGHtml is released under the MIT License (open and free software license).

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.