Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/jekyll-github-metadata/site_github_munger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ def drop

# Set `site.url` and `site.baseurl` if unset.
def add_url_and_baseurl_fallbacks!
site.config["url"] ||= Value.new("url", proc { |_c, r| r.url_without_path })
Jekyll::GitHubMetadata.log :debug, "Adding URL and base URL fallbacks..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This describes the whole function, so some whitespace is useful, so indicate it applies to the section and not just the line or two directly after it.

Suggested change
Jekyll::GitHubMetadata.log :debug, "Adding URL and base URL fallbacks..."
Jekyll::GitHubMetadata.log :debug, "Adding URL and base URL fallbacks..."

site.config["url"] ||= Value.new("url", proc { |_c, r| r.url_without_path })
Jekyll::GitHubMetadata.log :debug, "URL is set to #{site.config["url"]}"
return unless should_set_baseurl?

site.config["baseurl"] = Value.new("baseurl", proc { |_c, r| r.baseurl })
Jekyll::GitHubMetadata.log :debug, "baseurl is set to #{site.config["baseurl"]}"
Copy link
Contributor

@MichaelCurrin MichaelCurrin May 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use base URL here for consistency with the above.


Or use url and baseurl (lowercase, no spaces) throughout. With backticks or single quotes would be nice.

e.g.

"Adding `url` and `baseurl` fallbacks..."

and

"`baseurl` is set to #{site.config["baseurl"]}"

end

def add_title_and_description_fallbacks!
Expand Down