Giblog is free to customize your site with Perl

Giblog is written in Perl, a programming language that excels at text processing, and you can freely customize your site with Perl.

How to customize your site using Perl

To build a site with Giblog, run the following command.

giblog build

You can customize this process using Perl.

To customize the process, edit the following Perl module file.

Module file for building

lib / Giblog / Command / build.pm

This file describes the process of building the Giblog site.

package Giblog::Command::build;

use base'Giblog::Command';

use strict;
use warnings;

use File::Basename'basename';

sub run {
  my ($self, @args) = @_;
  
  # API
  my $api = $self->api;
  
  # Read config
  my $config = $api->read_config;
  
  #Copy static files to public
  $api->copy_static_files_to_public;

  #Get files in templates directory
  my $files = $api->get_templates_files;
  
  for my $file (@$files) {
    
    my $data = {file => $file};
    
    #Get content from file in templates directory
    $api->get_content($data);

    #Parse Giblog syntax
    $api->parse_giblog_syntax($data);

    #Parse title
    $api->parse_title_from_first_h_tag($data);

    #Edit title
    my $site_title = $config->{site_title};
    if ($data->{file} eq'index.html') {
      $data->{title} = $site_title;
    }
    else {
      $data->{title} = "$data->{title}-$site_title";
    }

    #Add page link
    $api->add_page_link_to_first_h_tag($data, {root =>'index.html'});

    #Parse description
    $api->parse_description_from_first_p_tag($data);

    #Read common templates
    $api->read_common_templates($data);
    
    #Add meta title
    $api->add_meta_title($data);

    #Add meta description
    $api->add_meta_description($data);

    #Build entry html
    $api->build_entry($data);
    
    #Build whole html
    $api->build_html($data);
    
    #Write to public file
    $api->write_to_public_file($data);
  }

  #Create list page
  $self->create_list;
}
1;

Users write programming directly to add / edit functions

Note that it's a Perl program that does all the site building work for you. This means that you can add features or modify features into any building process.

Replacing the format of blog articles with markdown or POD notation, changing the delimiter between titles and subtitles, adding a Twitter card And so on, you can describe everything you need.

In contrast to WordPress, which provides plugins for adding features, Giblog focuses on allowing users to write programming directly to add and edit features.

All the APIs used in Giblog are explained in Giblog::API. The Giblog construction process is a simple program, so if you can understand the API, you can understand the contents of the process.

Why you can customize your site freely

Why is Giblog free to customize your site?

Perl is a dynamically executed type of programming language. Being dynamically executed means that some processing can be replaced at runtime.

In Giblog, run the build command when doing a rebuild.

giblog build

Normally, the behavior of the program is fixed, and it works with the function when it was installed.

Perl can replace some of the processing due to the dynamic characteristics of the programming language, so you can customize the build command.