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

Jekyll with Tags, Archive and Comments in GitHub Pages #15

Open
zpbappi opened this issue Feb 15, 2016 · 17 comments
Open

Jekyll with Tags, Archive and Comments in GitHub Pages #15

zpbappi opened this issue Feb 15, 2016 · 17 comments

Comments

@zpbappi
Copy link
Owner

zpbappi commented Feb 15, 2016

Auto-generated issue to track comments for the post Jekyll with Tags, Archive and Comments in GitHub Pages in my blog.

@matinbavardi
Copy link

Hello dear,

You can run this above NodeJS script using from your local machine to generate all the tag files you will need.

I would like to host a blog on Firebase hosting. How can i run generate.js locally before $ Firebase deploy?

Thanks

@zpbappi
Copy link
Owner Author

zpbappi commented Mar 8, 2017

@Balloot it has nothing to do with where you are hosting. the script simply generates the html files for each tag you have in your tags.yml file. since you mention generate.js, i am assuming you are using the script from here. if that is the case, then in the directory that contains package.json (_scripts directory in my case), simply run:

npm install
node

then, in the node console, type:

var g = require('./generator.js');
g();

this will generate the tags and archive files. if you don't want to generate the archive files, just comment out the function for archive files and remove any reference to it.

@matinbavardi
Copy link

Great!. I really appreciate your help.

@matinbavardi
Copy link

I am so sorry. I can't understand this error:

> var g = require('./generate.js');
Error: Cannot find module 'js-yaml'

@matinbavardi
Copy link

I already fix the problem. The last error is:

Error: Cannot find module 'q-io/fs'

@zpbappi
Copy link
Owner Author

zpbappi commented Mar 8, 2017

@Balloot if you run npm install inside the _scripts directory, it should download all the dependencies specified in package.json file. are you getting any error when you run npm install?

@matinbavardi
Copy link

Thanks again.

I am running npm install inside the _scripts , in node:

var g = require('./generate.js');
undefined
g()
{ state: 'pending' }
Tag and Archive files creation completed successfully.

But noting happiness. No Tag and Archive file!

@zpbappi
Copy link
Owner Author

zpbappi commented Mar 13, 2017

@Balloot when you see the following message

Tag and Archive files creation completed successfully.

that indicates that all the promises were resolved. which means, your tag files were created. i am not sure why nothing happens in your case. can you point me to your repository with updated code so that i can take a look?

@hyyan
Copy link

hyyan commented Jun 28, 2017

@zpbappi Great post. I am still struggling with allowing Travis to push changes back to github. I can not get my head around the .git/credential file , any idea ?

@zpbappi
Copy link
Owner Author

zpbappi commented Jun 28, 2017

@hyyan perhaps, this reference on git credential helper will help you understand.

@hyyan
Copy link

hyyan commented Jun 29, 2017

@zpbappi nice read, thank you , as I understand I do not really need to do anything, to make travis push changes back to the repo

From Git Documentation :

You probably don’t want to invoke this command directly; it is meant to be used as a credential helper by other parts of git

But Travis keeping throwing an error about the credentials . here is a part of the build log :

$ node ./_scripts/main.js
Tag files creation completed successfully.
Adding all files...
Committing changes...
Pushing changes...
{ [Error: Command failed: remote: Invalid username or password.
fatal: Authentication failed foar 'repo/url/here'
] killed: false, code: 128, signal: null }

Any idea will be appreciated 😄

@zpbappi
Copy link
Owner Author

zpbappi commented Jun 30, 2017

@hyyan I have looked at the changes in your repo. It looks good to me. The only possible reason I can think of is that- you are not supplying the GH_TOKEN as an environment variable from TravisCI. To do that, you will need to generate a personal access token from GitHub. Go to settings and you will find it on the left menu (the last item on the list). Generate a personal access token and pass the token as GH_TOKEN from hyyan.github.com repository settings in TravisCI. Make sure you mark it as "secured" by turning off the "Display value in build log" toggle. That should work. Let me know if that was the problem.

@hyyan
Copy link

hyyan commented Jul 1, 2017

@zpbappi Thanks a million, you are right, I have missed the GH_Token, thank you for help, and keep it up, you write great articles.

@dingran
Copy link

dingran commented Nov 25, 2017

Great post!

BTW, I got the following warning when running your repo with Jekyll serve, do you also see it?

Liquid Warning: Liquid syntax error (line 2): Expected end_of_string but found number in "{{site.tags | sort 0 }}" in tags/index.html
Liquid Warning: Liquid syntax error (line 4): Expected dotdot but found pipe in "{{(tag_item | first) }}" in tags/index.html

@zpbappi
Copy link
Owner Author

zpbappi commented Jul 23, 2018

@dingran Sorry for the late reply. It seems to me that you are using an updated version of Jekyll. I will try updating the site with a Jekyll version that is compatible with GitHub Pages. Will let you know how it goes. Meanwhile, let me know if you have found any solution to your problem as well.

@rkbright
Copy link

@zpbappi - awesome post, I was able to add the first two features to my site (richardbright.me) without issue. However, I didn't see the comments section render on the posts. Any idea? Everything seemed to update just fine and I'm able to update my repo from the terminal. I just can't see the comment section at the end of the post. I combed through the _layout and _includes files to see if any updates were added but didn't notice any. Thanks for your help!

@rkbright
Copy link

funny enough, I found the issue, I needed to update the _layout/post.html file with the following.

{% include comments.html %}

Great post!

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

5 participants