-
Notifications
You must be signed in to change notification settings - Fork 311
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
[WIP] Federalist prep #1430
[WIP] Federalist prep #1430
Changes from 33 commits
c8d023c
d3919aa
e939cfe
d927c6d
c0df275
f48e329
1c5cd41
f25af88
7751abe
05b0922
afad3a3
47a1423
516e054
3069151
ed2c7ec
2d63c55
7d39e91
cba26ac
93a8da3
110704b
8b85bb5
f2e7fe6
1244dd7
f539f9a
bf6a6bd
ebb05cf
3410a44
daeea5f
5030b68
9d876c3
363f70b
62bc1da
0277aad
a40c5ea
2af9b81
ecd112a
1d06c71
e6891ad
4b4ee81
0364781
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ class AuthorTag < Liquid::Tag | |
def initialize(tag_name, author, tokens) | ||
super | ||
@author = author.strip | ||
@baseurl = Jekyll.sites[0].config['baseurl'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
end | ||
|
||
def render(context) | ||
|
@@ -14,7 +15,6 @@ def render(context) | |
|
||
if teammate | ||
"<span class=\"author #{teammate['name']}\">" + | ||
# "<img src=\"/assets/images/team/#{teammate['name']}.jpg\" />" + | ||
"#{teammate['full_name']}" + | ||
"</span>" | ||
else | ||
|
@@ -39,7 +39,7 @@ def render(context) | |
full_name = context.environments[0]['page']['full_name'] | ||
first_name = context.environments[0]['page']['first_name'] | ||
posts = context.environments[0]['site']['posts'] | ||
site_url = context.environments[0]['site']['url'] | ||
site_url = context.environments[0]['site']['baseurl'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
for p in posts | ||
if p.data['authors'] and p.data['authors'].include? author | ||
authored.push(p) | ||
|
@@ -61,10 +61,11 @@ def with_pic(input) | |
name = input[0] | ||
info = input[1] | ||
image = File.join 'assets', 'images', 'team', "#{name}.jpg" | ||
baseurl = Jekyll.sites[0].config['baseurl'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Useless assignment to variable - |
||
if File.exist?(File.join(Jekyll.sites[0].config['source'], image)) | ||
"<img class='img-circle team-img bio-clip' src='/#{image}' alt='18F team member #{info['full_name']}'>" | ||
"<img class='img-circle team-img bio-clip' src='#{@baseurl}/#{image}' alt='18F team member #{info['full_name']}'>" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [122/80] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [122/80] |
||
else | ||
"<img class='img-circle team-img bio-clip' src='/assets/images/18f.png' alt='18F logo'>" | ||
"<img class='img-circle team-img bio-clip' src='#{@baseurl}/assets/images/18f.png' alt='18F logo'>" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [107/80] |
||
end | ||
end | ||
# lookup filter | ||
|
@@ -97,8 +98,9 @@ def lookup(input, args) | |
def team_link(input) | ||
team = Jekyll.sites[0].collections['team'].docs | ||
index = team.find_index {|x| x.data['name'] == input} | ||
baseurl = Jekyll.sites[0].config['baseurl'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Useless assignment to variable - |
||
unless index.nil? | ||
url = "/team/#{team[index].data['name']}" | ||
url = "#{@baseurl}/team/#{team[index].data['name']}" | ||
full_name = team[index].data['full_name'] | ||
string = "<a href=#{url}>#{full_name}</a>" | ||
else | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ class RelGenerator < Liquid::Tag | |
def initialize(related_posts, text, tokens) | ||
super | ||
@params = text.split(' ') | ||
@baseurl = Jekyll.sites[0].config['baseurl'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
end | ||
|
||
# Gets all posts from the site by tag and adds those that match the tags on | ||
|
@@ -38,7 +39,7 @@ def list_posts(other_posts) | |
internal = @params[1] || "li" | ||
if other_posts | ||
related_posts = "<#{external}>" | ||
other_posts.flatten.map { |post| related_posts << "<#{internal}><a href='#{post.url}' class='related_posts'>“#{post.data['title']}”</a></#{internal}>" } | ||
other_posts.flatten.map { |post| related_posts << "<#{internal}><a href='#{@baseurl}/#{post.url}' class='related_posts'>“#{post.data['title']}”</a></#{internal}>" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [184/80] |
||
related_posts << "</#{external}" | ||
else | ||
related_posts = "<p>No related posts</p>" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,13 @@ module Jekyll | |
module TeamFilter | ||
def team_photo(name) | ||
person = finder(name) | ||
baseurl = Jekyll.sites[0].config['baseurl'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
image = File.join('assets', 'images', 'team', "#{name}.jpg") | ||
|
||
if person && File.exist?(File.join(Jekyll.sites[0].config['source'], image)) | ||
"<img class='img-circle team-img bio-clip' src='/#{image}' alt='18F team member #{person.data['full_name']}'>" | ||
"<img class='img-circle team-img bio-clip' src='#{baseurl}/#{image}' alt='18F team member #{person.data['full_name']}'>" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [128/80] |
||
else | ||
"<img class='img-circle team-img bio-clip' src='/assets/images/18f.png' alt='18F logo'>" | ||
"<img class='img-circle team-img bio-clip' src='#{baseurl}/assets/images/18f.png' alt='18F logo'>" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [106/80] |
||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extraneous
a
attribute in theanchor
tag