Skip to content

How to render single post with theme ? #5418

Discussion options

You must be logged in to vote
'use strict';

const fs = require('fs-extra');
const Hexo = require('hexo');
const path = require('path');

const rootDir = path.join(__dirname, 'test-site');
fs.ensureDirSync(path.join(rootDir, 'tmp'));

const hexo = new Hexo(rootDir, { silent: false, debug: true, safe: true });

const main = async () => {
  await hexo.init();
  await hexo.load();

  // Debugging: log resolved plugin path
  const pluginPath = path.join(__dirname, '../dist/index.cjs');
  console.log('Resolved plugin path:', pluginPath);

  try {
    const resolvedPluginPath = require.resolve(pluginPath);
    console.log('Resolved full plugin path:', resolvedPluginPath);

    if (!resolvedPluginPath) {
      throw new Error(

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dimaslanjaka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant