Raneto
Raneto copied to clipboard
docs or dumb user: Can't successfully make template changes
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.
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.
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'),