Skip to content

Node script for compiling HTML files using custom <file> tag for Google Blogger template development..

Notifications You must be signed in to change notification settings

tmpmachine/blogger-template-build-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f4501c0 · Jan 14, 2025

History

3 Commits
Jan 10, 2025
Jan 10, 2025
Jan 10, 2025
Jan 10, 2025
Jan 14, 2025
Jan 10, 2025
Jan 10, 2025
Jan 10, 2025

Repository files navigation

blogger-template-build-script

Node script for compiling Blogger template HTML files.

How To

  1. Put your Blogger template code in src/index.html. Do not rename or move this file.
  2. To include another HTML file, use <file src=""> tag. The following are valid:
<file src="widgets/example.html"></file>
<file src="widgets/example.html"/>
  1. To compile the HTML files, run:
node build
  1. See dist/output.html.
  2. You may adjust the following configuration in build.js:
const indexFilePath = `./src/index.html`;
const outputFileDir = './dist';
const outputFileName = 'output.html';

Comment A <file> Tag

Do comment one tag at a time.

Valid:

<!-- <file src="widgets/header.html"></file> -->
<!-- 
<file src="widgets/footer.html"></file> 
-->

Invalid, only the first one is ignored:

<!-- 
    <file src="widgets/header.html"></file>
    <file src="widgets/footer.html"></file> 
-->

Tips

For faster development, the following task script will run node build and open the output file in the new tab. You can use the default VS Code keyboard shortcut to run the build script (Ctrl + Shift + B).

/.vscode/tasks.json

{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "build",
        "type": "shell",
        "command": "node",
        "args": [
          "build"
        ],
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "problemMatcher": [],
        "detail": "Generated task to run node build"
      },
    ]
  }
  

About

Node script for compiling HTML files using custom <file> tag for Google Blogger template development..

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published