Skip to content

Commit

Permalink
Feature/added target blank external icon for links (#999)
Browse files Browse the repository at this point in the history
* added external link image and also added to build script

* added target blank and external link icons in company page

* added external link icon and update indentation

* fixed children nodes have a element issue

* updated validation html with new external url's

* added internal and external url checking

* updated test files with email _blank condtion excluded

* Updating Upworthy and Intevity (twin technologies) (#973)

* adding content for company

* removing warning emoji from upworthy

* Twin Technologies is Now Intevity

* adding location

* renaming & updating info

* reorganizing

* Removing double h

* updating dependencies

* Update scopic-software.md (#992)

Added Office locations to scopic-software.md

* Updated details for CoreOS (#1010)

* Update README.md with coreos

* Update coreos.md

* Add Thorn (#1015)

* Add Thorn to README

* Add thorn.md company profile

* Add Thorn remote status detail

* Adding designcode  (#994)

* Update README.md

* Create designcode.md

* Update designcode.md

* Update designcode.md

* Update designcode.md

* Update README.md

* Update designcode.md

* Update README.md

* Update README.md

* Update designcode.md

* feature: add MongoDB company profile (#1003)

* Adding company profile for Scandit (#1005)

* Added profile for Scandit

* Added link to the company profile for Scandit

* Details company profile Sutherland (#1006)

* Add more infos sutherland

* Add profile infos for Sutherland

* Added Interpersonal Frequency company info (#1013)

* Added Interpersonal Frequency company info

* Added region for Interpersonal Frequency in README.md

* added mozzila (#1014)

Co-authored-by: Marija <simicmariya@gmail.com>

* Adding Hopper to list (#990)

* adding Hopper to readme

* adding hopper

* fixing line break

* fixing line issue in remote status

* fixes

* removing mozzila

* Detail suse profile (#1007)

* Update suse.md

* Update README.md

* Updated reg ex to accept urls without http or https

Co-authored-by: Aiden Threadgoode <64971702+a-thread@users.noreply.github.com>
Co-authored-by: danishirfannn <73023221+danishirfannn@users.noreply.github.com>
Co-authored-by: Aadarsh Baid <baidaadarsh@gmail.com>
Co-authored-by: amplifi <amplifi@users.noreply.github.com>
Co-authored-by: snehaj27 <69983797+snehaj27@users.noreply.github.com>
Co-authored-by: Adrienne Tacke <adriennetacke@users.noreply.github.com>
Co-authored-by: Nitin Gupta <gniting@users.noreply.github.com>
Co-authored-by: Simon Sassi <dualprodu@gmail.com>
Co-authored-by: Oscar Montes <oscmcojc1@live.com.mx>
Co-authored-by: mariyasimic <70208378+mariyasimic@users.noreply.github.com>
Co-authored-by: Marija <simicmariya@gmail.com>
Co-authored-by: ngutierrez31 <ngutierrez131@gmail.com>
  • Loading branch information
13 people authored Oct 29, 2020
1 parent 30a8567 commit a3612b2
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 30 deletions.
1 change: 1 addition & 0 deletions bin/build-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ async function buildSite() {
fs.mkdirSync( siteBuildPath );
fs.mkdirSync( path.join( siteBuildPath, 'assets' ) );
copyAssetToBuild( 'remoteintech.png', null, false );
copyAssetToBuild( 'external-link.svg', null, false );

// Set up styles/scripts to be included on all pages
const stylesheets = [ {
Expand Down
73 changes: 73 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,78 @@ exports.parseFromDirectory = contentPath => {
error( 'README.md', msg, ...params );
}

const mainUrl = 'remoteintech.company'

function addTargetBlankAndExternalLinkIcons (el) {
if (el.type === 'tag') {
const anchorTagElements = el.children.filter(element => element.name === 'a')
if (anchorTagElements.length > 0) {
anchorTagElements.forEach(element => {
const url = element.attribs.href
const urlInfo = getUrlInfo(url)

if (urlInfo.is_email || urlInfo.is_internal) {
return
}

element.attribs.target = '_blank'

$element = $( element )
$element.append('<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg" /> </span>')
})
}

if (el.children && el.children.length) {
el.children.forEach(element => {
addTargetBlankAndExternalLinkIcons(element)
})
}
}
}

/**
* Getting info about the url. It includes checking isEmail of isInternal
* @param {*} url
*/
function getUrlInfo (url) {
const data = {}

if (url.match(/^mailto:/)) { // checking url email or not
data.is_email = true
return data
}

const mainDomainFromGivenUrl = extractMainDomainFromUrl(url)

// checking url is email or not
if (mainDomainFromGivenUrl !== mainUrl) {
data.is_internal = false
return data
} else {
data.is_internal = true
}

return data
}

/**
* Extracting main domain from the url
* @param {*} url
*/
function extractMainDomainFromUrl (url) {
const domainRe = /(https?:\/\/){0,1}((?:[\w\d-]+\.)+[\w\d]{2,})/i; // taken example from https://stackoverflow.com/questions/6238351/fastest-way-to-detect-external-urls

const data = domainRe.exec(url)

const splittedDomain = data[2].split('.')

if (splittedDomain.length === 2) { // check extra subdomain is present or not
return data[2]
}

return splittedDomain[splittedDomain.length - 2] + '.' + splittedDomain[splittedDomain.length - 1] // return only main domain address
}

let lastCompanyName = null;

$( 'tr' ).each( ( i, tr ) => {
Expand Down Expand Up @@ -422,6 +494,7 @@ exports.parseFromDirectory = contentPath => {
// 'body' are block-level elements. I think this is correct,
// because from what I've seen, any inline content is wrapped
// in a <p>.
addTargetBlankAndExternalLinkIcons(el)
profileContent[ currentHeading ] = (
profileContent[ currentHeading ]
+ '\n\n' + $.html( el )
Expand Down
5 changes: 5 additions & 0 deletions site/assets/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions site/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@
</nav><!-- .jetpack-social-navigation -->
<div class="site-info">
Powered by
<a href="https://github.com/remoteintech/remote-jobs">
<a href="https://github.com/remoteintech/remote-jobs" target="_blank" rel="noopener noreferrer">
GitHub
</a>
and
<a href="https://www.netlify.com/">Netlify</a>
<a href="https://www.netlify.com/" target="_blank" rel="noopener noreferrer">Netlify</a>
<span role="separator"></span>
<a href="{{ editUrl }}" target="_blank" rel="noopener noreferrer">
Edit this page on GitHub
Expand Down
7 changes: 5 additions & 2 deletions site/templates/company.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ <h1 class="company-name">{{ company.name }}</h1>
href="{{ company.websiteUrl }}"
target="_blank"
rel="noopener noreferrer"
>{{ company.websiteText }}</a>
>
{{ company.websiteText }}
<img style="vertical-align: text-top;" src="/assets/external-link.svg" width="16px" height="16px">
</a>
{% if company.shortRegion %}
<span role="separator"></span>
{{ company.shortRegion }}
Expand Down Expand Up @@ -45,7 +48,7 @@ <h2>Missing info</h2>
<p>
<strong>Want to help?</strong>
<a href="{{ editUrl }}" target="_blank" rel="noopener noreferrer">
Send us a pull request on GitHub
Send us a pull request on GitHub <span style="vertical-align: text-top;"> <img src="/assets/external-link.svg" /> </span>
</a>
with your changes to this file!
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>We make websites and content management simple and fun with premiere web design &amp; development consulting services, by contributing to open platforms like WordPress, and by providing tools and products (like <a href="https://pushupnotifications.com/">PushUp</a>) that make web publishing a cinch.</p>
<p>We make websites and content management simple and fun with premiere web design &amp; development consulting services, by contributing to open platforms like WordPress, and by providing tools and products (like <a href="https://pushupnotifications.com/" target="_blank">PushUp<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>) that make web publishing a cinch.</p>

<p>At 10up, we don&#x2019;t just &#x201C;make&#x201D; things &#x2013; we engineer them. We&#x2019;re a group of people built to solve problems; made to create; wired to delight. From beautiful pixels to beautiful code, we constantly improve the things around us, applying our passions to our clients&#x2019; projects and goals.</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>Check out our <a href="https://10up.com/careers/">careers page</a> and send an email to <a href="mailto:jobs@10up.com">jobs@10up.com</a>. Our amazing Recruitment Manager Christine Garrison will be on the other end.</p>
<p>Check out our <a href="https://10up.com/careers/" target="_blank">careers page<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> and send an email to <a href="mailto:jobs@10up.com">jobs@10up.com</a>. Our amazing Recruitment Manager Christine Garrison will be on the other end.</p>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p><a href="https://pages.18f.gov/joining-18f/open-positions/">Open positions</a></p>
<p><a href="https://pages.18f.gov/joining-18f/open-positions/" target="_blank">Open positions<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></p>

<p>If you want to apply directly to 18F please email <a href="mailto:join18f@gsa.gov">join18f@gsa.gov</a>. We don&#x2019;t require a formal cover letter, but let us know more about you:</p>

Expand All @@ -8,4 +8,4 @@
If you&apos;re a Veteran of the U.S. Armed Forces or if you are eligible for &quot;derived&quot; preference, please mention that in your email so we can give you priority consideration.
Don&apos;t see an opening that suits you? Tell us what you want to do!</p>

<p><a href="https://pages.18f.gov/joining-18f/how-to-apply/">How to apply</a></p>
<p><a href="https://pages.18f.gov/joining-18f/how-to-apply/" target="_blank">How to apply<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></p>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

<p>Because we work on distributed teams so frequently, we&apos;ve developed certain strategies for working well as a collaborative operation.</p>

<p><a href="https://18f.gsa.gov/2015/10/15/best-practices-for-distributed-teams/">We have a &#x201C;remote first&#x201D; mindset.</a></p>
<p><a href="https://18f.gsa.gov/2015/10/15/best-practices-for-distributed-teams/" target="_blank">We have a &#x201C;remote first&#x201D; mindset.<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></p>
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
<p>If you know something we don&apos;t, help us fill it in! Here&apos;s how:</p>

<ul>
<li>Read our <a href="https://github.com/remoteintech/remote-jobs/blob/master/CONTRIBUTING.md">Contributing Guidelines</a></li>
<li>Have a look at our <a href="https://github.com/remoteintech/remote-jobs/blob/master/company-profiles/example.md">example company profile</a></li>
<li>Follow the structure of the example profile and <a href="https://github.com/remoteintech/remote-jobs/edit/master/company-profiles/45royale.md">send us a pull request with your changes to this file!</a></li>
<li>Read our <a href="https://github.com/remoteintech/remote-jobs/blob/master/CONTRIBUTING.md" target="_blank">Contributing Guidelines<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
<li>Have a look at our <a href="https://github.com/remoteintech/remote-jobs/blob/master/company-profiles/example.md" target="_blank">example company profile<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
<li>Follow the structure of the example profile and <a href="https://github.com/remoteintech/remote-jobs/edit/master/company-profiles/45royale.md" target="_blank">send us a pull request with your changes to this file!<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
</ul>

<p>Without
<a href="https://codepoints.net/U+FE0F?lang=en">variation selector</a>
<a href="https://codepoints.net/U+FE0F?lang=en" target="_blank">variation selector<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>
invisible character:</p>

<blockquote>
<p>&#x26A0; |</p>
</blockquote>

<p><strong>With</strong>
<a href="https://codepoints.net/U+FE0F?lang=en">variation selector</a>
<a href="https://codepoints.net/U+FE0F?lang=en" target="_blank">variation selector<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>
invisible character:</p>

<blockquote>
<p>&#x26A0; |</p>
</blockquote>

<p><strong>With</strong>
<a href="https://codepoints.net/U+FE0F?lang=en">variation selector</a>
<a href="https://codepoints.net/U+FE0F?lang=en" target="_blank">variation selector<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>
invisible character (x2):</p>

<blockquote>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>If you know something we don&apos;t, help us fill it in! Here&apos;s how:</p>

<ul>
<li>Read our <a href="https://github.com/remoteintech/remote-jobs/blob/master/CONTRIBUTING.md">Contributing Guidelines</a></li>
<li>Have a look at our <a href="https://github.com/remoteintech/remote-jobs/blob/master/company-profiles/example.md">example company profile</a></li>
<li>Follow the structure of the example profile and <a href="https://github.com/remoteintech/remote-jobs/edit/master/company-profiles/aerolab.md">send us a pull request with your changes to this file!</a></li>
<li>Read our <a href="https://github.com/remoteintech/remote-jobs/blob/master/CONTRIBUTING.md" target="_blank">Contributing Guidelines<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
<li>Have a look at our <a href="https://github.com/remoteintech/remote-jobs/blob/master/company-profiles/example.md" target="_blank">example company profile<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
<li>Follow the structure of the example profile and <a href="https://github.com/remoteintech/remote-jobs/edit/master/company-profiles/aerolab.md" target="_blank">send us a pull request with your changes to this file!<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
</ul>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<p><a href="https://andyet.com">&amp;yet</a> is about people. We&#x2019;re known as a design and development consultancy (specializing in Node, React, and realtime), but we don&#x2019;t fit neatly in a box.</p>
<p><a href="https://andyet.com" target="_blank">&amp;yet<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> is about people. We&#x2019;re known as a design and development consultancy (specializing in Node, React, and realtime), but we don&#x2019;t fit neatly in a box.</p>

<p>We design and <a href="https://andyet.com/software">develop custom software</a> for web, mobile, desktop, chat, and voice.</p>
<p>We design and <a href="https://andyet.com/software" target="_blank">develop custom software<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> for web, mobile, desktop, chat, and voice.</p>

<p>We enable millions of people to make super simple video calls with <a href="https://talky.io">Talky</a>.</p>
<p>We enable millions of people to make super simple video calls with <a href="https://talky.io" target="_blank">Talky<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>.</p>

<p>We pioneer software and standards for <a href="https://andyet.com/realtime">realtime communications</a>.</p>
<p>We pioneer software and standards for <a href="https://andyet.com/realtime" target="_blank">realtime communications<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>.</p>

<p>We <a href="https://gatherthepeople.com">wrote the book</a> on taking a human approach to marketing for people who would rather make what they love than persuade people to buy it.</p>
<p>We <a href="https://gatherthepeople.com" target="_blank">wrote the book<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> on taking a human approach to marketing for people who would rather make what they love than persuade people to buy it.</p>

<p>We create high-impact conference experiences such as <a href="http://experience.realtimeconf.com">RealtimeConf</a> and more recently&#x2013;<a href="http://andyetconf.com">&amp;yetConf</a>.</p>
<p>We create high-impact conference experiences such as <a href="http://experience.realtimeconf.com" target="_blank">RealtimeConf<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> and more recently&#x2013;<a href="http://andyetconf.com" target="_blank">&amp;yetConf<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>.</p>

<p><a href="https://andyet.com/about">Learn more about our team</a>.</p>
<p><a href="https://andyet.com/about" target="_blank">Learn more about our team<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a>.</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p><a href="https://goo.gl/maps/oJaAQFf12tv">Fuse Coworking in Richland, WA</a></p>
<p><a href="https://goo.gl/maps/oJaAQFf12tv" target="_blank">Fuse Coworking in Richland, WA<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></p>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>We employ several strategies to ensure an inclusive and collaborative environment for all our employees.</p>

<p>To communicate we use <a href="https://slack.com">Slack</a> (text-chat), our own product <a href="https://talky.io">Talky</a> (video chat and meetings), <a href="https://twistapp.com">Twist</a> (daily check-ins) and <a href="https://github.com">GitHub</a> (organization wide discussions).</p>
<p>To communicate we use <a href="https://slack.com" target="_blank">Slack<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> (text-chat), our own product <a href="https://talky.io" target="_blank">Talky<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> (video chat and meetings), <a href="https://twistapp.com" target="_blank">Twist<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> (daily check-ins) and <a href="https://github.com" target="_blank">GitHub<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a> (organization wide discussions).</p>

<p>One-on-ones and bi-weekly company-wide updates are a crucial part of staying connected and understanding our team as things change. We encourage employees to use these meetings to bring up frustrations, ideas, or whatever they need in order to be their best selves and to do their best work.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>If you know something we don&apos;t, help us fill it in! Here&apos;s how:</p>

<ul>
<li>Read our <a href="https://github.com/remoteintech/remote-jobs/blob/master/CONTRIBUTING.md">Contributing Guidelines</a></li>
<li>Have a look at our <a href="https://github.com/remoteintech/remote-jobs/blob/master/company-profiles/example.md">example company profile</a></li>
<li>Follow the structure of the example profile and <a href="https://github.com/remoteintech/remote-jobs/edit/master/company-profiles/angularclass.md">send us a pull request with your changes to this file!</a></li>
<li>Read our <a href="https://github.com/remoteintech/remote-jobs/blob/master/CONTRIBUTING.md" target="_blank">Contributing Guidelines<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
<li>Have a look at our <a href="https://github.com/remoteintech/remote-jobs/blob/master/company-profiles/example.md" target="_blank">example company profile<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
<li>Follow the structure of the example profile and <a href="https://github.com/remoteintech/remote-jobs/edit/master/company-profiles/angularclass.md" target="_blank">send us a pull request with your changes to this file!<span style="vertical-align: text-top;"> <img src="/assets/external-link.svg"> </span></a></li>
</ul>

0 comments on commit a3612b2

Please sign in to comment.