Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit CSS and HTML in frameworks such as Hexo using Node.js

I am new to Node.js and decided to try to make a blog website using Hexo. The problem I am having is trying to edit the main style sheet and index files to include a new web font (or any editing in general).

The way I figured it would work is I would make the change and the server would pick it, such as with the /themes folder as stated in the docs. Though this is not the case and it doesn't seem like you can edit the CSS directly.

How do I edit the main CSS and index in such frameworks as these?

like image 765
Milo Avatar asked May 06 '26 20:05

Milo


2 Answers

Hexo.io used Stylus, you can look at the documentation.

I tried to make changes to the default theme and worked.

by examples in the path: themes \ landscape \ source \ css - style.styl

like image 124
Cristyan Avatar answered May 09 '26 10:05

Cristyan


In Hexo, the theme is responsible for rendering and styling the content in HTML. The theme can decide what preprocessor (for CSS and HTML templating) to use.

landscape is using Stylus for CSS and EJS (note it is 1.0) for templating.
You have to npm install hexo-renderer-ejs hexo-renderer-stylus for it to work.

There are other renderers but they are less popular.

like image 40
leesei Avatar answered May 09 '26 08:05

leesei