yous / whiteglass

Minimal, responsive Jekyll theme for hackers
https://yous.github.io/whiteglass/
MIT License
732 stars 200 forks source link

How to add images for blog #27

Closed papadave66 closed 5 years ago

papadave66 commented 5 years ago

I can write the blog in master branch and build by travis automaticlly . But I may need to add pictures for my blog text. I found that the gh_pages branch directory is very different with master .So how should I create the image directory and include them into the text. Thanks

yous commented 5 years ago

You can just make a directory in master branch, and link that image using markdown. For example, see my blog post.

![image alt](/images/image.png "image title")
papadave66 commented 5 years ago

Thanks . It really helps me a lot!

armsp commented 4 years ago

@yous which css file should we modify to control the height and width of the images?

yous commented 4 years ago

@armsp If you're using kramdown for markdown renderer (which is default), you can add custom attributes like following:

![image alt](/path/to/image.png "image title"){: width="200" height="200"}

Otherwise, I think you should use plain HTML:

<img alt="image alt" src="/path/to/image.png" title="image title" width="200" heigh="200" />

For more markdown options, see https://jekyllrb.com/docs/configuration/markdown/.

yous commented 4 years ago

For CSS file, you can create your own assets/main.scss. See Customization section of README.md.