laozhu / hugo-nuo

🎨 A responsive light & clean hugo theme for blogger.
https://laozhu.me
MIT License
427 stars 150 forks source link

Changing directories, and avatars #66

Closed amca01 closed 6 years ago

amca01 commented 6 years ago

I like the look of this theme very much: simple, elegant, well designed. However, I am very new to Hugo, and I'm still struggling with a few things. Here are two of them:

  1. How can I change the theme so that *.md files are read from a different directory to content/post? For example, my files live in content/blog-posts: how can I change the theme so that they are read from here?

  2. I want to use my own image as an avatar, so I've put amca01.jpg in to the public/img directory, , and linked to it in my config.toml file with the parameter line avatar = "/img/amca01.jpg". But when I run Hugo and the Hugo server, it claims that this file doesn't exist. I've checked the file name, directory, permissions (I'm using Linux); it's there all right, but somehow not being read by the theme. So how can I make my image "visible" to the theme?

I think that's it for the moment - thanks very much!

laozhu commented 6 years ago

Question 1: You can create any directories and sub directories under content folder. With the hugo-nuo theme, you should change hugo-nuo/layouts/post to hugo-nuo/layouts/blog-posts to read content under your contetn/blog-posts folder. Maybe there are other places you should change but I didn't test it.

Question 2: You can use the theme build system and put your assets in src/assets folder, webpack will copy them to static/img folder automatically. With the build system, you can craft the theme to your own. BTW, I didn't put the avatar variable in config.toml now.

aaronkjones commented 5 years ago

FWIW I only had to add this to config.toml above the [params] section.

[permalinks]
    post = "/blog/:slug"

I did not have to rename folders.