Skip to content
Permalink
Browse files

fix: Properly display ISC license in plain text and correctly parse r…

…equested license from URL.

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
  • Loading branch information...
Richienb committed Jun 23, 2019
1 parent fd54e71 commit 8a47aa09f83c5ef30e23c1841e206fc4117f9860
Showing with 55 additions and 53 deletions.
  1. +17 −18 licenses/ISC.ejs
  2. +1 −1 licenses/components/footer.ejs
  3. +27 −29 licenses/components/header.ejs
  4. +9 −4 middleware/load-options.js
  5. +1 −1 routes/get.js
@@ -1,27 +1,26 @@
<!DOCTYPE html>
<html id="home" lang="en">

<% include components/header %>

<body>
<article>
<%- gravatar %>
<h1>The ISC License (ISC)</h1>
<p>Copyright © <%- info %></p>
<article>
<%- gravatar %>
<h1>The ISC License (ISC)</h1>

<p>Copyright © <%- info %></p>

<p>Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.</p>
<p>Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.</p>

<p>THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p>
</article>
<% include components/footer %>
<p>THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p>
</article>
<% include components/footer %>
</body>

</html>
@@ -1,3 +1,3 @@
<footer>
<p><a target="_blank" rel="noopener" href="https://github.com/remy/mit-license">Fork this project to create your own MIT license that you can always link to.</a></p>
<p><a target="_blank" rel="noopener" href="https://github.com/remy/mit-license">Fork this project to create your own MIT license that you can always link to.</a></p>
</footer>
@@ -1,40 +1,38 @@
<head>
<title>MIT License</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description"
content="The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology. As a permissive license, it puts only very limited restriction on reuse and has, therefore, an excellent license compatibility.">
<!--
Welcome fellow open source developer. This project is here for you to
link to if you're like me and keep forgetting to include the
MIT-license.txt file.
<title>MIT License</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology. As a permissive license, it puts only very limited restriction on reuse and has, therefore, an excellent license compatibility.">
<!--
Welcome fellow open source developer. This project is here for you to
link to if you're like me and keep forgetting to include the
MIT-license.txt file.
Fork this project and send a pull request on:
Fork this project and send a pull request on:
https://github.com/remy/mit-license
https://github.com/remy/mit-license
By adding a new JSON file to the users directory, it will yield an
MIT License on a CNAME, for example:
By adding a new JSON file to the users directory, it will yield an
MIT License on a CNAME, for example:
{ "copyright": "Remy Sharp, https://remysharp.com" }
{ "copyright": "Remy Sharp, https://remysharp.com" }
Means visiting https://rem.mit-license.org/ shows "Remy Sharp" as the
copyright holder. Namespaces will be on a first come first serve basis,
and I'm open to folk joining the GitHub project.
Means visiting https://rem.mit-license.org/ shows "Remy Sharp" as the
copyright holder. Namespaces will be on a first come first serve basis,
and I'm open to folk joining the GitHub project.
For more options (including linking and license version targeting)
see the README in the github hosted project.
For more options see the README in the github hosted project.
Hope you find this useful too!
Hope you find this useful too!
- @rem
- @rem
-->
<!-- for HTML5 el styling -->
<script>
document.createElement('article');
document.createElement('footer');
</script>
<link rel="stylesheet" href="/themes/<%= theme %>.css">
-->
<!-- for HTML5 el styling -->
<script>
document.createElement('article');
document.createElement('footer');
</script>
<link rel="stylesheet" href="/themes/<%= theme %>.css">
</head>
@@ -5,14 +5,12 @@ module.exports = (req, res, next) => {

res.locals.options = parts.reduce(
(acc, curr) => {
if (!curr) {
return acc;
}
if (!curr) return acc;

let match = curr.match(/^@?(\d{4})$/) || [];

if (match.length) {
// pinned year
// Pinned year
if (curr.startsWith('@')) {
acc.pinnedYear = parseInt(curr.substr(1), 10);
} else {
@@ -38,6 +36,13 @@ module.exports = (req, res, next) => {
return acc;
}

if (curr.startsWith('+')) {
acc.license = curr
.substr(1)
.toUpperCase();
return acc;
}

acc.sha = curr; // not actually supported now - 2019-06-19
return acc;
},
@@ -58,7 +58,7 @@ module.exports = (req, res) => {
const year = options.pinnedYear
? options.pinnedYear
: [options.startYear, options.endYear].filter(Boolean).join('-');
const license = (user.license || 'MIT').toUpperCase();
const license = (options.license || user.license || 'MIT').toUpperCase();
const format = options.format || user.format || 'html';

const args = {

0 comments on commit 8a47aa0

Please sign in to comment.
You can’t perform that action at this time.