-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update directory names * Rename tests * Exclude specs from coverage * remove DS_Store files * Improve documentation, add debug script * Filter assets from codecov * update readme * Update tests * Fix scale
- Loading branch information
1 parent
6d28bdc
commit 19b40b5
Showing
9 changed files
with
168 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ Gem::Specification.new do |spec| | |
spec.email = ["[email protected]"] | ||
|
||
spec.summary = %q{Apple Maps plugin for Jekyll} | ||
spec.description = %q{Longer description of your plugin} | ||
spec.description = %q{Provides tags for the Jekyll blogging engine to generate Apple Maps content for your site.} | ||
spec.homepage = "https://github.com/zekesnider/jekyll-apple-maps" | ||
spec.license = "Apache-2.0" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'jekyll' | ||
require 'liquid' | ||
require 'optparse' | ||
require_relative '../lib/jekyll/apple_maps/snapshot_block' | ||
|
||
# Parse command line options | ||
options = {} | ||
OptionParser.new do |opts| | ||
opts.banner = "Usage: #{$PROGRAM_NAME} [options]" | ||
|
||
opts.on("-s", "--source DIR", "Specify the source DIR") do |dir| | ||
options[:source] = dir | ||
end | ||
|
||
opts.on("-r", "--referer URL", "Specify the referer URL") do |url| | ||
options[:referer] = url | ||
end | ||
|
||
opts.on("-h", "--help", "Prints this help") do | ||
puts opts | ||
exit | ||
end | ||
end.parse! | ||
|
||
# Check for required options | ||
if options[:source].nil? || options[:referer].nil? | ||
puts "Error: Both source directory (-s) and referer URL (-r) are required." | ||
puts "Use -h or --help for usage information." | ||
exit 1 | ||
end | ||
|
||
# Mock site and context | ||
class MockSite < Jekyll::Site | ||
attr_reader :source, :config | ||
|
||
def initialize(source, referer) | ||
@config = Jekyll.configuration({'source' => source}) | ||
@config['apple_maps'] = { 'referer' => referer } if referer | ||
super(@config) | ||
@static_files = [] | ||
@source = source | ||
end | ||
end | ||
|
||
site = MockSite.new(options[:source], options[:referer]) | ||
context = Liquid::Context.new({}, {}, { site: site }, { strict_variables: true, strict_filters: true }) | ||
|
||
# Register the custom tag | ||
Liquid::Template.register_tag('apple_maps_snapshot_block', Jekyll::AppleMaps::SnapshotBlock) | ||
|
||
puts "Enter your Apple Maps Snapshot template (press Ctrl+D when finished):" | ||
template = STDIN.read | ||
|
||
begin | ||
# Parse the entire template | ||
template = Liquid::Template.parse(template) | ||
|
||
# Render the template | ||
result = template.render(context) | ||
|
||
puts "\nRendered output:" | ||
puts result | ||
rescue => e | ||
puts "\nError occurred:" | ||
puts e.message | ||
puts e.backtrace.join("\n") | ||
end | ||
|
||
puts "\nSite source directory: #{site.source}" | ||
puts "Apple Maps referer: #{site.config.dig('apple_maps', 'referer') || ''}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters