adding yeoman to github pages blog - jekyll

I had a blog running at morenoh149.github.io I attempted to add yeoman to my workflow using jekyllrb generator. I followed the instructions by creating a new yeoman project, and copying over all the generated files and structure to my blog. But now github pages isn't picking up the blog. https://github.com/morenoh149/morenoh149.github.io
Anyone know how github pages works? the docs are sparse.
I changed the source in my yml file to app/ as well. So now when I run jekyll locally it works. But when I push to github pages it's not.
_config.yml
# Jekyll configuration precedence:
# 1. Gruntfile task
# 2. config.build.yml
# 3. config.yml
name: morenoh149.blog.yeoman
url: morenoh149.github.io
description: Harry Moreno has a blog
author:
name: Harry Moreno
email: morenoh149#gmail.com
# Grunt handles images and assets.
exclude: ['img', 'css', 'js', 'fonts',
'**.png', '**.jpg', '**.jpeg', '**.gif', '**.webp', '**.svg', '**.ico']
include: ['.htaccess']
source: app
# _config.build.yml sets future and show_drafts to false on `grunt build`
future: true
show_drafts: true
# Markdown library
markdown: redcarpet
# extensions: ['fenced_code_blocks', 'smart']
pygments: true

It looks like GitHub Pages is serving files from your site (for instance, http://morenoh149.github.io/app/ is an html file with a single paragraph element) but it's not serving them properly with all the Jekyll magic.
It turns out that GitHub Pages will override the source setting in the config file. This means that while you've specified source: app, it's looking at your top-level directory for content.
The solution is to move the contents of your app directory into your top-level directory.

Related

GitHub Actions > Build Jekyll

I'm using this Action:
https://github.com/actions/jekyll-build-pages/blob/main/action.yml
which works fine for the top level README.md file with
inputs:
source:
description: 'Directory where the source files reside.'
required: false
default: ./
However, if I change default: ./ to where I've got the actual Markdown files I'd like building (i.e. default: ./test/md/) I get a 404 at the GitHub Page URL it returns.
Note, I can see the files being processed into html.
Any suggestions?

How do I redirect an old Netlify + Jekyll site address, to the new address?

I created a Jekyll site, hosted at Netlify, at old.address.com. Now I want to redirect to new.address.com. But the Netlify docs doesn't seem to work or I don't understand the docs. This is what I did:
I added, to _config.yml: (because Netlify says Jekyll excludes '_...' files)
include:
- _redirects
And I added a _redirects file. I just copy-pasted Netlify's generated instructions into that file, this is the content:
# Redirect domain aliases to primary domain
https://jekyll-comments.demo.ed.community/* https://jekyll-demo.talkyard.io/:splat 301!
http://jekyll-comments.demo.ed.community/* https://jekyll-demo.talkyard.io/:splat 301!
https://jekyll.demo.talkyard.io/* https://jekyll-demo.talkyard.io/:splat 301!
http://jekyll.demo.talkyard.io/* https://jekyll-demo.talkyard.io/:splat 301!
And this has no effect. What's the problem / what am I doing wrong?
This is how the directory looks like:
$ ls -1
404.html
about.md
_config.yml
Gemfile
_includes
index.md
_layouts
_posts
_redirects <—— added as per Netlify's instructions
_sass
_site
$ ls -1 _posts/
2018-01-01-like-about-jekyll.markdown
2018-01-02-installation-instructions.markdown
2018-01-02-kind-creatures.markdown
The config file is just the default one:
title: ...
email: ...
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: ...
github_username: ...
# Build settings
markdown: kramdown
theme: minima
plugins:
- jekyll-feed
talkyard_comments_server_url: ...
include:
- _redirects
Please note that although there are fairly many details above, it's all just various default stuff. So it's not specific to my problem. It should apply to all new Jekyll sites.
Disclaimer: I work for Netlify
We have a specific section on this in our documentation: https://www.netlify.com/docs/redirects/#handling-hostnames-and-protocols-differently
...and your snippet should work since it follows those conventions.
The only prerequisites to make that work are:
1) that you have your site configured in our UI to answer to ALL of those names - so:
jekyll-comments.demo.ed.community
jekyll-demo.talkyard.io
jekyll.demo.talkyard.io
2) and that all names are set up the same in DNS (CNAME to yournetlifysitename.netlify.com)
The only way to add "extra" names to your Netlify configuration is as domain aliases, which are configured in the Domain settings panel right next to your "main" custom domain.
Since your _redirects looks correct to me, if you have the prerequisites configured as suggested, the most likely failure mode is that you don't end up with your redirects actually applied for some reason (usually - they didn't get deployed because they didn't exist in a file called _redirects, in your publish folder, after the build), but your include in the jekyll config should allow that file to persist in that location. That jekyll config is the "right" way to do it but for other site generators, we sometimes advise people to copy the redirects into place after build: jekyll build && cp netlify_redirects.txt _site/_redirects
You can download whatever files are in your deploy to examine their "final state" via this tiny icon from any successful deploy logs page:
From a quick look at your site configuration, they appear to be deployed and working:
$ curl -v https://jekyll-comments.demo.ed.community/ -o /dev/null
* Connected to jekyll-comments.demo.ed.community (35.199.180.1) port 443 (#0)
[...]
< HTTP/1.1 301 Moved Permanently
[...]
< Location: https://jekyll-demo.talkyard.io/
So I guess the next question is...how are you testing?

Missing fonts folder on jekyll deploying to netlify

When deploying jekyll project to netlify I am missing my fonts folder.
It works perfectly find when in development mode but when I tell it to run in production it seems to skip over adding my fonts folder to the _site/assets directory.
I believe it has to be something in the config but I am fairly new to jekyll and YAML. And in the code its seems to be saying to add all the assets underneath it to the build process.
Below is my _config.yml file.
copy:
# Paths to static assets that aren't (S)CSS or JavaScript
# because these are completely handled by the sass and javascript tasks
assets:
# all files below the assets dir
- "assets/**/*"
# exclusions:
- "!assets/{js,scss,css}/**/*" # js, scss and css files
- "!assets/css{,/**}" # css dir
- "!assets/js{,/**}" # js dir
- "!assets/scss{,/**}" # scss dir
- "!assets/vendor{,/**}" # vendor di
dist: "_site/assets/"
notification: "Running Copy"
Note: I work for Netlify
While I'm not sure of the fail mode here, I can tell you a couple things that would help you debug:
the easiest way to debug a build is described in this article: https://www.netlify.com/blog/2016/10/18/how-our-build-bots-build-sites/ . This lets you duplicate our build environment in a way that you can access during/after the build so you can see what is happening or has happened in more depth than our build logs
If you write into support we can set a verbose flag on your builds that does the equivalent of 'set -x' on the building shell script to show you what's being run in production, though filtering this output is quite a task for a human, it may be more useful than nothing!

Run jekyll build Command with Different url Flag

My current _config.yml file looks like this:
#Site settings
...
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://10.0.1.9:3000" # the base hostname & protocol for your site
...
# Build settings
markdown: kramdown
safe: true
lsi: false
highlighter: true
keep_files: [public]
exclude: [src, lib, node_modules, bower.json, Gemfile, gulpfile.js, package.json, README.md]
I've got my url currently set to my local server, where I serve my Jekyll site for local development.
When building for production however, I have to keep manually changing this url to the url of my remote server before running jekyll build. Is there a way I can pass my remote url alongside the jekyll build command to build a site with the correct remote paths?
Something like so:
jekyll build --url mysite.com
Any help is appreciated with this. Thanks in advance!
Put your production url in _config.yml eg: url: toto.com.
Create a _config_dev.yml that will be used to override values in development.
In you case
url: "http://10.0.1.9:3000"
Development build is launched with :
jekyll build --config _config.yml,_config_dev.yml
Values in the last config file in the command will override those in first file.
and production build with jekyll build.
See Jekyll documentation http://jekyllrb.com/docs/configuration/#build-command-options configuration paragraphe.

Adding Jekyll to an existing website

I have a simple website and tried to add a Jekyll blog in it in a new folder blog thus I have run jekyll new blog in the folder /path. However when I'm running the command jekyll build in /path I have these errors:
$ jekyll build
Configuration file: none
Source: /path
Destination: /path/_site
Generating...
Build Warning: Layout 'post' requested in blog/_posts/2015-06-14-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in blog/index.html does not exist.
Conversion error: Jekyll::Converters::Scss encountered an error converting 'blog/css/main.scss'.
Conversion error: File to import not found or unreadable: /blog/_sass/base.scss. Load paths: on line 47
I solved the first problem (Configuration file: none) by moving _config.ymlin the parent folder, however I still have problems when requesting layout using
---
layout: default
---
The imports in main.scssare also not working (last error).
If I'm doing the same command jekyll build in /path/blogafter moving again _config.yml, I have no errors. Does someone know how to be able to do a jekyll buildin the parent folder with the configuration I have? Do I have to entirely change the architecture of my website to include a Jekyll blog in it?
You config.yml is in /path with
source: /_jekyll
destination: /blog
baseurl: /blog
Your jekyll sources are in /path/_jekyll.
And you generated files will be in /path/blog.
Ready to deploy !