Skip to content

Commit 91fdd0b

Browse files
Website: New assets directory for all web-only files (#2180)
1 parent 964de5a commit 91fdd0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+261
-280
lines changed

.npmignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@ hide-*.js
55
.DS_Store
66
CNAME
77
.github/
8+
assets/
89
examples/
9-
img/
10-
templates/
1110
tests/
12-
scripts/
1311
*.tgz
1412
*.html
15-
style.css
16-
favicon.png
17-
logo.svg
1813
bower.json
1914
composer.json
2015
gulpfile.js

scripts/code.js renamed to assets/code.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if(!document.body.addEventListener) {
66

77
$$('[data-plugin-header]').forEach(function (element) {
88
var plugin = components.plugins[element.getAttribute('data-plugin-header')];
9-
element.innerHTML = '<div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>\n'
9+
element.innerHTML = '<div class="intro" data-src="assets/templates/header-plugins.html" data-type="text/html"></div>\n'
1010
+ '<h2>' + plugin.title + '</h2>\n<p>' + plugin.description + '</p>';
1111
});
1212

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

templates/header-main.html renamed to assets/templates/header-main.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1><a href="index.html"><img src="logo.svg" alt="Prism" /></a></h1>
1+
<h1><a href="index.html"><img src="assets/logo.svg" alt="Prism" /></a></h1>
22

33
<a href="download.html" class="download-button">Download</a>
44

templates/header-plugins.html renamed to assets/templates/header-plugins.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1><a href="index.html"><img src="logo.svg" alt="Prism" /> plugins</a></h1>
1+
<h1><a href="index.html"><img src="assets/logo.svg" alt="Prism" /> plugins</a></h1>
22

33
<a href="download.html" class="download-button">Download</a>
44

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

bower.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@
1414
},
1515
"ignore": [
1616
"**/.*",
17-
"img",
18-
"templates",
17+
"assets",
1918
"tests",
2019
"CNAME",
21-
"*.html",
22-
"style.css",
23-
"favicon.png",
24-
"logo.svg",
25-
"download.js",
26-
"prefixfree.min.js",
27-
"utopia.js",
28-
"code.js"
20+
"*.html"
2921
]
3022
}

download.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<head>
44

55
<meta charset="utf-8" />
6-
<link rel="icon" href="favicon.png" />
6+
<link rel="icon" href="assets/favicon.png" />
77
<title>Download ▲ Prism</title>
8-
<link rel="stylesheet" href="style.css" />
8+
<link rel="stylesheet" href="assets/style.css" />
99
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
1010
<style>
1111
form label {
@@ -124,15 +124,15 @@
124124
border-bottom-left-radius: 0;
125125
}
126126
</style>
127-
<script src="scripts/prefixfree.min.js"></script>
127+
<script src="assets/prefixfree.min.js"></script>
128128

129129
<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
130130
<script src="https://www.google-analytics.com/ga.js" async></script>
131131
</head>
132132
<body>
133133

134134
<header>
135-
<div class="intro" data-src="templates/header-main.html" data-type="text/html"></div>
135+
<div class="intro" data-src="assets/templates/header-main.html" data-type="text/html"></div>
136136

137137
<h2>Customize your download</h2>
138138
<p>Select your compression level, as well as the languages and plugins you need.</p>
@@ -170,16 +170,16 @@ <h2>Customize your download</h2>
170170

171171
</section>
172172

173-
<footer data-src="templates/footer.html" data-type="text/html"></footer>
173+
<footer data-src="assets/templates/footer.html" data-type="text/html"></footer>
174174

175-
<script src="scripts/utopia.js"></script>
175+
<script src="assets/utopia.js"></script>
176176
<script src="prism.js"></script>
177177
<script src="components.js"></script>
178178
<script src="dependencies.js"></script>
179-
<script src="scripts/code.js"></script>
180-
<script src="scripts/vendor/promise.js"></script>
181-
<script src="scripts/vendor/FileSaver.min.js"></script>
182-
<script src="scripts/download.js"></script>
179+
<script src="assets/code.js"></script>
180+
<script src="assets/vendor/promise.js"></script>
181+
<script src="assets/vendor/FileSaver.min.js"></script>
182+
<script src="assets/download.js"></script>
183183

184184
</body>
185185
</html>

examples.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<head>
44

55
<meta charset="utf-8" />
6-
<link rel="icon" href="favicon.png" />
6+
<link rel="icon" href="assets/favicon.png" />
77
<title>Examples ▲ Prism</title>
8-
<link rel="stylesheet" href="style.css" />
8+
<link rel="stylesheet" href="assets/style.css" />
99
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
1010
<style>
1111
#languages {
@@ -43,15 +43,15 @@
4343
padding-left: 40px;
4444
}
4545
</style>
46-
<script src="scripts/prefixfree.min.js"></script>
46+
<script src="assets/prefixfree.min.js"></script>
4747

4848
<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
4949
<script src="https://www.google-analytics.com/ga.js" async></script>
5050
</head>
5151
<body>
5252

5353
<header>
54-
<div class="intro" data-src="templates/header-main.html" data-type="text/html"></div>
54+
<div class="intro" data-src="assets/templates/header-main.html" data-type="text/html"></div>
5555

5656
<h2>Examples</h2>
5757
<p>The examples in this page serve a dual purpose: They act as unit tests, making it easy to spot bugs, and at the same time demonstrate what Prism can do, on simple and on edge cases.</p>
@@ -97,14 +97,14 @@ <h1>Per language examples</h1>
9797
</section>
9898
<section id="examples"></section>
9999

100-
<footer data-src="templates/footer.html" data-type="text/html"></footer>
100+
<footer data-src="assets/templates/footer.html" data-type="text/html"></footer>
101101

102-
<script src="scripts/utopia.js"></script>
102+
<script src="assets/utopia.js"></script>
103103
<script src="prism.js"></script>
104104
<script src="components.js"></script>
105-
<script src="scripts/code.js"></script>
106-
<script src="scripts/vendor/promise.js"></script>
107-
<script src="scripts/examples.js"></script>
105+
<script src="assets/code.js"></script>
106+
<script src="assets/vendor/promise.js"></script>
107+
<script src="assets/examples.js"></script>
108108

109109
</body>
110110
</html>

extending.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<head>
44

55
<meta charset="utf-8" />
6-
<link rel="icon" href="favicon.png" />
6+
<link rel="icon" href="assets/favicon.png" />
77
<title>Extending Prism ▲ Prism</title>
8-
<link rel="stylesheet" href="style.css" />
8+
<link rel="stylesheet" href="assets/style.css" />
99
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
1010
<link rel="stylesheet" href="plugins/line-highlight/prism-line-highlight.css" data-noprefix />
11-
<script src="scripts/prefixfree.min.js"></script>
11+
<script src="assets/prefixfree.min.js"></script>
1212
<style>
1313
ol.indent {
1414
margin: 1em 0;
@@ -22,7 +22,7 @@
2222
<body class="language-javascript">
2323

2424
<header>
25-
<div class="intro" data-src="templates/header-main.html" data-type="text/html"></div>
25+
<div class="intro" data-src="assets/templates/header-main.html" data-type="text/html"></div>
2626

2727
<h2>Extending Prism</h2>
2828
<p>Prism is awesome out of the box, but it’s even awesomer when it’s customized to your own needs. This section will help you write new language definitions, plugins and all-around Prism hacking.</p>
@@ -367,14 +367,14 @@ <h1>API documentation</h1>
367367
<p>All public and stable parts of <a href="docs/">Prism's API are documented here</a>.</p>
368368
</section>
369369

370-
<footer data-src="templates/footer.html" data-type="text/html"></footer>
370+
<footer data-src="assets/templates/footer.html" data-type="text/html"></footer>
371371

372-
<script src="scripts/utopia.js"></script>
372+
<script src="assets/utopia.js"></script>
373373
<script src="prism.js"></script>
374374
<script src="plugins/autoloader/prism-autoloader.js"></script>
375375
<script src="plugins/line-highlight/prism-line-highlight.js"></script>
376376
<script src="components.js"></script>
377-
<script src="scripts/code.js"></script>
377+
<script src="assets/code.js"></script>
378378

379379
</body>
380380
</html>

faq.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<head>
44

55
<meta charset="utf-8" />
6-
<link rel="icon" href="favicon.png" />
6+
<link rel="icon" href="assets/favicon.png" />
77
<title>FAQ ▲ Prism</title>
8-
<link rel="stylesheet" href="style.css" />
8+
<link rel="stylesheet" href="assets/style.css" />
99
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
1010
<style>
1111
#toc {
@@ -16,15 +16,15 @@
1616
color: black;
1717
}
1818
</style>
19-
<script src="scripts/prefixfree.min.js"></script>
19+
<script src="assets/prefixfree.min.js"></script>
2020

2121
<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
2222
<script src="https://www.google-analytics.com/ga.js" async></script>
2323
</head>
2424
<body>
2525

2626
<header>
27-
<div class="intro" data-src="templates/header-main.html" data-type="text/html"></div>
27+
<div class="intro" data-src="assets/templates/header-main.html" data-type="text/html"></div>
2828

2929
<h2>FAQ</h2>
3030
<p>Frequently Asked Questions, with a few Questions I want people to Frequently Ask.</p>
@@ -121,9 +121,9 @@ <h1>How can I use different highlighting for tokens with the same name in differ
121121
}</code></pre>
122122
</section>
123123

124-
<footer data-src="templates/footer.html" data-type="text/html"></footer>
124+
<footer data-src="assets/templates/footer.html" data-type="text/html"></footer>
125125

126-
<script src="scripts/utopia.js"></script>
126+
<script src="assets/utopia.js"></script>
127127
<script src="prism.js"></script>
128128
<script src="plugins/autoloader/prism-autoloader.min.js"></script>
129129
<script>
@@ -229,7 +229,7 @@ <h1>How can I use different highlighting for tokens with the same name in differ
229229
showTokens();
230230
}());
231231
</script>
232-
<script src="scripts/code.js"></script>
232+
<script src="assets/code.js"></script>
233233

234234
</body>
235235
</html>

gulpfile.js/changelog.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,7 @@ async function changes() {
320320

321321
function changedWebsite(info) {
322322
if (info.changes.length > 0 && info.changes.every(c => {
323-
if (/[\w-]+\.(?:html|svg)$/.test(c.file)) {
324-
return true;
325-
}
326-
if (/^scripts(?:\/[\w-]+)*\/[\w-]+\.js$/.test(c.file)) {
327-
return true;
328-
}
329-
return ['style.css'].indexOf(c.file) >= 0;
323+
return /[\w-]+\.html$/.test(c.file) || /^assets\//.test(c.file);
330324
})) {
331325
addEntry('Other >> Website', info);
332326
return true;

index.html

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
window.console && console.log('foo');
88
</script>
99
<meta charset="utf-8" />
10-
<link rel="icon" href="favicon.png" />
10+
<link rel="icon" href="assets/favicon.png" />
1111
<title>Prism</title>
12-
<link rel="stylesheet" href="style.css" />
12+
<link rel="stylesheet" href="assets/style.css" />
1313
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
14-
<script src="scripts/prefixfree.min.js"></script>
14+
<script src="assets/prefixfree.min.js"></script>
1515

1616
<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
1717
<script src="https://www.google-analytics.com/ga.js" async></script>
1818
</head>
1919
<body>
2020

2121
<header>
22-
<div class="intro" data-src="templates/header-main.html" data-type="text/html"></div>
22+
<div class="intro" data-src="assets/templates/header-main.html" data-type="text/html"></div>
2323

2424
<ul id="features">
2525
<li>
@@ -57,14 +57,14 @@ <h1>Used By</h1>
5757
<p>Prism is used on several websites, small and large. Some of them are:</p>
5858

5959
<div class="used-by-logos">
60-
<a href="https://www.smashingmagazine.com/" target="_blank"><img src="img/logo-smashing.png" alt="Smashing Magazine" /></a>
61-
<a href="https://alistapart.com/" target="_blank"><img src="img/logo-ala.png" alt="A List Apart" /></a>
62-
<a href="https://developer.mozilla.org/" target="_blank"><img src="img/logo-mdn.png" alt="Mozilla Developer Network (MDN)" /></a>
63-
<a href="https://css-tricks.com/" target="_blank"><img src="img/logo-css-tricks.png" alt="CSS-Tricks" /></a>
64-
<a href="https://www.sitepoint.com/" target="_blank"><img src="img/logo-sitepoint.png" alt="SitePoint" /></a>
65-
<a href="https://www.drupal.org/" target="_blank"><img src="img/logo-drupal.png" alt="Drupal" /></a>
66-
<a href="https://reactjs.org/" target="_blank"><img src="img/logo-react.png" alt="React" /></a>
67-
<a href="https://stripe.com/" target="_blank"><img src="img/logo-stripe.png" alt="Stripe" /></a>
60+
<a href="https://www.smashingmagazine.com/" target="_blank"><img src="assets/img/logo-smashing.png" alt="Smashing Magazine" /></a>
61+
<a href="https://alistapart.com/" target="_blank"><img src="assets/img/logo-ala.png" alt="A List Apart" /></a>
62+
<a href="https://developer.mozilla.org/" target="_blank"><img src="assets/img/logo-mdn.png" alt="Mozilla Developer Network (MDN)" /></a>
63+
<a href="https://css-tricks.com/" target="_blank"><img src="assets/img/logo-css-tricks.png" alt="CSS-Tricks" /></a>
64+
<a href="https://www.sitepoint.com/" target="_blank"><img src="assets/img/logo-sitepoint.png" alt="SitePoint" /></a>
65+
<a href="https://www.drupal.org/" target="_blank"><img src="assets/img/logo-drupal.png" alt="Drupal" /></a>
66+
<a href="https://reactjs.org/" target="_blank"><img src="assets/img/logo-react.png" alt="React" /></a>
67+
<a href="https://stripe.com/" target="_blank"><img src="assets/img/logo-stripe.png" alt="Stripe" /></a>
6868
</div>
6969
</section>
7070

@@ -75,13 +75,13 @@ <h1>Examples</h1>
7575
<pre data-src="prism.js"></pre>
7676

7777
<p>This page’s CSS code, highlighted with Prism:</p>
78-
<pre data-src="style.css"></pre>
78+
<pre data-src="assets/style.css"></pre>
7979

8080
<p>This page’s HTML, highlighted with Prism:</p>
8181
<pre data-src="index.html"></pre>
8282

8383
<p>This page’s logo (SVG), highlighted with Prism:</p>
84-
<pre data-src="logo.svg"></pre>
84+
<pre data-src="assets/logo.svg"></pre>
8585

8686
<p>If you’re still not sold, you can <a href="examples.html">view more examples</a> or <a href="test.html">try it out for yourself</a>.</p>
8787
</section>
@@ -292,12 +292,12 @@ <h1>Credits</h1>
292292
</ul>
293293
</section>
294294

295-
<footer data-src="templates/footer.html" data-type="text/html"></footer>
295+
<footer data-src="assets/templates/footer.html" data-type="text/html"></footer>
296296

297-
<script src="scripts/utopia.js"></script>
297+
<script src="assets/utopia.js"></script>
298298
<script src="prism.js"></script>
299299
<script src="components.js"></script>
300-
<script src="scripts/code.js"></script>
300+
<script src="assets/code.js"></script>
301301
<script>
302302
(function() {
303303
var languageItems = [];

0 commit comments

Comments
 (0)