yous / whiteglass

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

Seeing localhost:4000 in some link tags in header #37

Closed armsp closed 4 years ago

armsp commented 4 years ago

In my website's header I see localhost:4000 mentioned in a few places -

<link rel="canonical" href="http://localhost:4000/testing-whiteglass/">
<link rel="alternate" type="application/rss+xml" title="COVID-19 Stories" href="http://localhost:4000/testing-whiteglass/feed.xml">
<meta property="og:url" content="http://localhost:4000/testing-whiteglass/">

Any idea what causes this and how to fix it?

yous commented 4 years ago

If your _config.yml has correct url, try building _site using jekyll build instead of jekyll serve.

armsp commented 4 years ago

Found the issue, I was using jekyll serve to push site to production. After using jekyll build it works fine.

I was wondering if there is a way to declare development or production so that this issue doesn't come.

armsp commented 4 years ago

Aah, you just replied a few seconds ago

armsp commented 4 years ago

@yous I will close it for now, but if you personally use any environment variables for whiteglass in your own blog for development and production, have you documented it somewhere?

yous commented 4 years ago

You can push your website's source instead of build results, and then use Travis CI or GitHub Actions to deploy the actual site. See deploy section of .travis.yml. Important part of script section is doing jekyll clean && jekyll build. I think you can also achieve doing this by using GitHub Actions.

armsp commented 4 years ago

@yous I see. I really wanted to use GitHub Actions for it. I have used it in a couple of my repositories and have had great experience with them. Let me figure out how to use GitHub actions for this, maybe this weekend. If you have a GitHub Actions workflow file, please do share, even an incomplete file would help a lot !

yous commented 4 years ago

@armsp, please check out https://github.com/yous/whiteglass-template. I've just made working site using GitHub Actions. Just copy .github/workflows/main.yml, and then set secret JEKYLL_PAT to your repository.

armsp commented 4 years ago

@yous this is great. Tested it and it works well. I now have to figure out how to edit the action or find a new action that actually publishes it on the master branch itself or docs folder in master branch.