Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs or dumb user: Can't successfully make template changes #387

Open
cadeon opened this issue Aug 29, 2023 · 2 comments
Open

docs or dumb user: Can't successfully make template changes #387

cadeon opened this issue Aug 29, 2023 · 2 comments
Assignees
Labels
documentation Update Raneto Documentation

Comments

@cadeon
Copy link

cadeon commented Aug 29, 2023

I haven't been able to figure out where to put my modified layout.html such that it will be picked up and used.

https://docs.raneto.com/templates/customizing-the-template indicates that the updated html files should go in "themes/default" but I'm not sure exactly where due to the relative path. Putting "themes" at the same level as "content", "images", and "public" feels correct but doesn't seem to work. Putting "themes" inside "public" doesn't seem to work either.

@cadeon
Copy link
Author

cadeon commented Aug 29, 2023

I ended up setting -
theme_dir = '/config/themes'
theme_name = 'default'

and moving 'public' into '/config/themes/default/public' and my templates into '/config/themes/default/templates'

That works, but it feels like it's nowhere near the "intended" setup for theme template files.

@ryanlelek ryanlelek added the documentation Update Raneto Documentation label Feb 21, 2024
@ryanlelek ryanlelek self-assigned this Feb 21, 2024
@ryanlelek
Copy link
Owner

Definitely a documentation problem, not you.

We're currently splitting the theme out from the core to help make this easier.
The ideal flow we're working toward is:

  • Fork this module: https://github.com/raneto/theme-default
  • Publish your package with changes, whether public on GitHub or using a private NPM registry
  • install the module with npm install mytheme or similar
  • update the config file with your theme module name

The details are still being worked out on exactly how to do all that, but the theme package linked above is currently used in the latest release

If you're looking for "quick and easy" changes, such as 1-2 files, you should be able to put them in:
node_modules/@raneto/theme-default/dist/
That directory is the installed module, and dist has the generated files

There are 3 different areas:

  • content, your markdown files
  • theme, the templates, styles, js, and supporting files
  • public, mostly for your content

Hope this helps clarify

Config snippet with relevant sections

// Which Theme to Use?
//
// Local Directory Example (for development or custom themes)
// var theme_dir = path.join(__dirname, 'themes');
// var theme_name = 'my-theme-directory';
//
// Themes from NPM
// use "dist" as the theme name for modules (for now)
var theme_dir = path.join(
  __dirname,
  '..',
  'node_modules',
  '@raneto/theme-default'
);
var theme_name = 'dist';

...

  // Specify the path of your content folder where all your '.md' files are located
  // Fix: Cannot be an absolute path
  content_dir: path.join(__dirname, '..', 'content', 'pages'),

  // Where is the public directory or document root?
  public_dir: path.join(theme_dir, theme_name, 'public'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Update Raneto Documentation
Projects
None yet
Development

No branches or pull requests

2 participants