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

Adding a custom homepage? #1

Closed
CodeRunner00 opened this issue Apr 29, 2017 · 11 comments
Closed

Adding a custom homepage? #1

CodeRunner00 opened this issue Apr 29, 2017 · 11 comments

Comments

@CodeRunner00
Copy link

Hi, Carlos! Awesome portfolio/blog theme. I am wondering how you were able to add all of the information about your Javascript skills and projects to the home page using this theme? When I add an index.html file to the source folder of my blog nothing is displayed. Thank you, Eric

@carlos-algms
Copy link
Owner

Hi Eric, thanks for using my theme, I'm glad you liked it.

Try to add this as the first lines of you index.html :

---
layout: index
title:
comments: false
---

Take a look at my files structure:

image

@carlos-algms
Copy link
Owner

And please, let me know if it worked and share your site URL.

@CodeRunner00
Copy link
Author

Thanks for the detailed response.

I did add the layout, title, and comments properties before. I tried changing the layout property to index.ejs but that did not fix it. I also had the index.html file in the source directory under my blog's root directory.

I have some familiarity with ejs and found that when I added the html right onto index.ejs in the materialize theme's source directory it displayed on the screen. Do you have a controller that displays the content of the layout index on the page? Thank you, Eric

@carlos-algms
Copy link
Owner

@CodeRunner00, I double checked my configs and the only thing that makes sense is add this to your
_config.yml :

theme: materialize
exclude_generators:
- index

@carlos-algms
Copy link
Owner

Actually, what is happening for you ? Because there is no controllers at all. Everything is static and the files can be even .html or .md

As you can see here:
https://github.com/carlos-algms/carlos-algms.github.io/tree/source/source

Hexo will handle the .ejs files, those files exists on the theme folder because Hexe needs to process it, you should not change files under themes forlder.

The layout property should be index without extension.

@CodeRunner00
Copy link
Author

Thank you.

I resolved this issue with

npm remove hexo-generator-index

@carlos-algms
Copy link
Owner

Good to know!!!!
Please, Share your site I really want to see what you developed!!

@CodeRunner00
Copy link
Author

Sure thing! I will once I've got everything up and running.

@CodeRunner00
Copy link
Author

Here is my blog. Still have a bit to go but it's up and running!
https://coderunner00.github.io/

@carlos-algms
Copy link
Owner

Congrats.

O saw that your code blocks are not getting highlighted, try to write ` javascript
(spaces to avoid github process it)

@carlos-algms
Copy link
Owner

failed miserably, :)

use 3 backticks then write javascript, should work

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

No branches or pull requests

2 participants