Skip to content

Commit c4ad533

Browse files
committed
🚧 IN PROGRESS: minor code fixes
1 parent d80effb commit c4ad533

File tree

76 files changed

+83
-156
lines changed

Some content is hidden

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

76 files changed

+83
-156
lines changed

css/index.css

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
.no-js {
2-
}
3-
.page {
1+
.index {
42
&__header {
53
}
64
&__main {
75
}
86
&__footer {
97
}
10-
}
8+
}

dist/about.html

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!doctype html>
2+
<html class="no-js" lang="en" dir="ltr">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
7+
<meta name="robots" content="index,follow">
8+
<meta name="googlebot" content="index,follow">
9+
<title>PostHTML</title>
10+
<meta name="description" content="Description goes here">
11+
<link rel="stylesheet" href="css/styles.css" media="print" onload="this.media='all'">
12+
</head>
13+
14+
<body class="index">
15+
16+
<header class="index__header">
17+
<h1>PostHTML Classes</h1>
18+
</header>
19+
<main class="index__main">
20+
21+
</main>
22+
<footer class="index__footer">Here is the about page.</footer>
23+
</body>
24+
<script src="js/scripts.js"></script>
25+
26+
</html>

dist/css/styles.css

-1
This file was deleted.
-5.75 KB
Binary file not shown.
-8.97 KB
Binary file not shown.
-12.6 KB
Binary file not shown.
-1.25 KB
Binary file not shown.
-29.1 KB
Binary file not shown.
-1.73 KB
Binary file not shown.
-44.3 KB
Binary file not shown.
-2.64 KB
Binary file not shown.
-3.65 KB
Binary file not shown.
-305 KB
Binary file not shown.
-4.37 KB
Binary file not shown.
-4.48 KB
Binary file not shown.
-5.86 KB
Binary file not shown.
-6.02 KB
Binary file not shown.
-6.89 KB
Binary file not shown.
-8.03 KB
Binary file not shown.
-2.09 KB
Binary file not shown.
-2.18 KB
Binary file not shown.
-2.69 KB
Binary file not shown.
-2.96 KB
Binary file not shown.
Binary file not shown.
-8.03 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dist/img/favicons/browserconfig.xml

-15
This file was deleted.

dist/img/favicons/coast-228x228.png

-10.7 KB
Binary file not shown.

dist/img/favicons/favicon-16x16.png

-460 Bytes
Binary file not shown.

dist/img/favicons/favicon-32x32.png

-1.07 KB
Binary file not shown.

dist/img/favicons/favicon-48x48.png

-1.73 KB
Binary file not shown.

dist/img/favicons/favicon.ico

-32.5 KB
Binary file not shown.
-6.54 KB
Binary file not shown.
-55.5 KB
Binary file not shown.
-2.94 KB
Binary file not shown.

dist/img/favicons/manifest.json

-59
This file was deleted.

dist/img/favicons/manifest.webapp

-14
This file was deleted.

dist/img/favicons/mstile-144x144.png

-5.75 KB
Binary file not shown.

dist/img/favicons/mstile-150x150.png

-5.96 KB
Binary file not shown.

dist/img/favicons/mstile-310x150.png

-10.7 KB
Binary file not shown.

dist/img/favicons/mstile-310x310.png

-20.3 KB
Binary file not shown.

dist/img/favicons/mstile-70x70.png

-2.51 KB
Binary file not shown.
-1.76 KB
Binary file not shown.

dist/img/favicons/yandex-browser-manifest.json

-9
This file was deleted.

dist/index.html

100755100644
+26-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
<!doctype html><html class="no-js"lang="en"dir="ltr"><meta charset="utf-8"><meta name="viewport"content="width=device-width,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta name="robots"content="index,follow"><meta name="googlebot"content="index,follow"><title>PostHTML</title><meta name="description"content="Description goes here"><link rel="stylesheet"href="css/styles.css"media="print"onload="this.media='all'"><link rel="shortcut icon"href="img/favicons/favicon.ico"><link rel="icon"type="image/png"sizes="16x16"href="img/favicons/favicon-16x16.png"><link rel="icon"type="image/png"sizes="32x32"href="img/favicons/favicon-32x32.png"><link rel="icon"type="image/png"sizes="48x48"href="img/favicons/favicon-48x48.png"><link rel="manifest"href="img/favicons/manifest.json"><meta name="mobile-web-app-capable"content="yes"><meta name="theme-color"content="#fff"><meta name="application-name"><link rel="apple-touch-icon"sizes="57x57"href="img/favicons/apple-touch-icon-57x57.png"><link rel="apple-touch-icon"sizes="60x60"href="img/favicons/apple-touch-icon-60x60.png"><link rel="apple-touch-icon"sizes="72x72"href="img/favicons/apple-touch-icon-72x72.png"><link rel="apple-touch-icon"sizes="76x76"href="img/favicons/apple-touch-icon-76x76.png"><link rel="apple-touch-icon"sizes="114x114"href="img/favicons/apple-touch-icon-114x114.png"><link rel="apple-touch-icon"sizes="120x120"href="img/favicons/apple-touch-icon-120x120.png"><link rel="apple-touch-icon"sizes="144x144"href="img/favicons/apple-touch-icon-144x144.png"><link rel="apple-touch-icon"sizes="152x152"href="img/favicons/apple-touch-icon-152x152.png"><link rel="apple-touch-icon"sizes="167x167"href="img/favicons/apple-touch-icon-167x167.png"><link rel="apple-touch-icon"sizes="180x180"href="img/favicons/apple-touch-icon-180x180.png"><link rel="apple-touch-icon"sizes="1024x1024"href="img/favicons/apple-touch-icon-1024x1024.png"><meta name="apple-mobile-web-app-capable"content="yes"><meta name="apple-mobile-web-app-status-bar-style"content="black-translucent"><meta name="apple-mobile-web-app-title"><link rel="apple-touch-startup-image"media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-640x1136.png"><link rel="apple-touch-startup-image"media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-750x1334.png"><link rel="apple-touch-startup-image"media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-828x1792.png"><link rel="apple-touch-startup-image"media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-1125x2436.png"><link rel="apple-touch-startup-image"media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-1242x2208.png"><link rel="apple-touch-startup-image"media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-1242x2688.png"><link rel="apple-touch-startup-image"media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-1536x2048.png"><link rel="apple-touch-startup-image"media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-1668x2224.png"><link rel="apple-touch-startup-image"media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-1668x2388.png"><link rel="apple-touch-startup-image"media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-2048x2732.png"><link rel="apple-touch-startup-image"media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"href="img/favicons/apple-touch-startup-image-1620x2160.png"><link rel="apple-touch-startup-image"media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-1136x640.png"><link rel="apple-touch-startup-image"media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-1334x750.png"><link rel="apple-touch-startup-image"media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-1792x828.png"><link rel="apple-touch-startup-image"media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2436x1125.png"><link rel="apple-touch-startup-image"media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2208x1242.png"><link rel="apple-touch-startup-image"media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2688x1242.png"><link rel="apple-touch-startup-image"media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2048x1536.png"><link rel="apple-touch-startup-image"media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2224x1668.png"><link rel="apple-touch-startup-image"media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2388x1668.png"><link rel="apple-touch-startup-image"media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2732x2048.png"><link rel="apple-touch-startup-image"media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"href="img/favicons/apple-touch-startup-image-2160x1620.png"><link rel="icon"type="image/png"sizes="228x228"href="img/favicons/coast-228x228.png"><meta name="msapplication-TileColor"content="#fff"><meta name="msapplication-TileImage"content="img/favicons/mstile-144x144.png"><meta name="msapplication-config"content="img/favicons/browserconfig.xml"><link rel="yandex-tableau-widget"href="img/favicons/yandex-browser-manifest.json"><body class="page"><header class="page__header"><h1>PostHTML Classes</h1></header><main class="page__main"></main><footer class="page__footer"></footer><noscript><link rel="stylesheet"href="css/styles.css"></noscript><script src="js/scripts.js"></script>
1+
<!doctype html>
2+
<html class="no-js" lang="en" dir="ltr">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
7+
<meta name="robots" content="index,follow">
8+
<meta name="googlebot" content="index,follow">
9+
<title>PostHTML</title>
10+
<meta name="description" content="Description goes here">
11+
<link rel="stylesheet" href="css/styles.css" media="print" onload="this.media='all'">
12+
</head>
13+
14+
<body class="index">
15+
16+
<header class="index__header">
17+
<h1>PostHTML Classes</h1>
18+
</header>
19+
<main class="index__main">
20+
21+
</main>
22+
<footer class="index__footer">Here is the home page</footer>
23+
</body>
24+
<script src="js/scripts.js"></script>
25+
26+
</html>

dist/js/scripts.js

-1
This file was deleted.

html/pages/about.html

+5-12
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,18 @@
99
<title>PostHTML</title>
1010
<meta name="description" content="Description goes here">
1111
<link rel="stylesheet" href="css/styles.css" media="print" onload="this.media='all'">
12-
<link rel="icon" href="img/posthtml-logo.png">
1312
</head>
1413

14+
<body class="index">
1515

16-
<body class="about">
17-
18-
<header class="about__header">
16+
<header class="index__header">
1917
<h1>PostHTML Classes</h1>
2018
</header>
21-
<main class="about__main">
19+
<main class="index__main">
2220

2321
</main>
24-
<footer class="about__footer">Here is my page</footer>
25-
26-
27-
<noscript>
28-
<link rel="stylesheet" href="css/styles.css">
29-
</noscript>
22+
<footer class="index__footer">Here is the about page.</footer>
3023
</body>
3124
<script src="js/scripts.js"></script>
3225

33-
</html>
26+
</html>

html/pages/index.html

+2-9
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
<title>PostHTML</title>
1010
<meta name="description" content="Description goes here">
1111
<link rel="stylesheet" href="css/styles.css" media="print" onload="this.media='all'">
12-
<link rel="icon" href="img/posthtml-logo.png">
1312
</head>
1413

15-
1614
<body class="index">
1715

1816
<header class="index__header">
@@ -21,13 +19,8 @@ <h1>PostHTML Classes</h1>
2119
<main class="index__main">
2220

2321
</main>
24-
<footer class="index__footer">Here is my lint page</footer>
25-
26-
27-
<noscript>
28-
<link rel="stylesheet" href="css/styles.css">
29-
</noscript>
22+
<footer class="index__footer">Here is the home page</footer>
3023
</body>
3124
<script src="js/scripts.js"></script>
3225

33-
</html>
26+
</html>

html/templates/components/head.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
<title>PostHTML</title>
77
<meta name="description" content="Description goes here">
88
<link rel="stylesheet" href="css/styles.css" media="print" onload="this.media='all'">
9-
<link rel="icon" href="img/posthtml-logo.png" />
10-
</head>
9+
</head>

html/templates/views/about.html

+5-10
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@
33

44
<module href="html/templates/components/head.html"></module>
55

6-
<body class="about">
6+
<body class="index">
77

8-
<header class="about__header">
8+
<header class="index__header">
99
<h1>PostHTML Classes</h1>
1010
</header>
11-
<main class="about__main">
11+
<main class="index__main">
1212

1313
</main>
14-
<footer class="about__footer">Here is my page</footer>
15-
16-
17-
<noscript>
18-
<link rel="stylesheet" href="css/styles.css">
19-
</noscript>
14+
<footer class="index__footer">Here is the about page.</footer>
2015
</body>
2116
<script src="js/scripts.js"></script>
2217

23-
</html>
18+
</html>

html/templates/views/index.html

+2-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@ <h1>PostHTML Classes</h1>
1111
<main class="index__main">
1212

1313
</main>
14-
<footer class="index__footer">Here is my lint page</footer>
15-
16-
17-
<noscript>
18-
<link rel="stylesheet" href="css/styles.css">
19-
</noscript>
14+
<footer class="index__footer">Here is the home page</footer>
2015
</body>
2116
<script src="js/scripts.js"></script>
2217

23-
</html>
18+
</html>

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"dev:html": "posthtml 'html/templates/views/*.html' -o html/pages",
8-
"dev:watch": "onchange 'html/templates' -- run-p dev:html",
9-
"dev:bem": "onchange 'html/templates/bem' -- run-p html:bem",
7+
"html:process": "posthtml 'html/templates/views/*.html' -o html/pages",
8+
"html:watch": "onchange 'html/templates' -- run-p html:process",
9+
"html:bemify": "onchange 'html/templates/bem' -- run-p html:bem",
1010
"dev:server": "browser-sync start --server --ss 'html/pages' --files 'html/templates/**/*.html' --no-notify --no-open",
11-
"server": "run-p dev:watch dev:server dev:bem",
11+
"server": "run-p html:watch dev:server html:bemify",
1212
"html:css": "node utilities/html-css.js",
1313
"html:bem": "node utilities/bem.js",
1414
"html:favicon": "node utilities/favicons.js",
15-
"build:dist": "mkdir -p dist/{css,js,img,fonts/web}",
15+
"build:dist": "mkdir -p dist/{css,js,img,fonts}",
1616
"build:html-validate": "posthtml 'html/pages/*html' --use posthtml-w3c",
1717
"build:minify": "html-minifier --input-dir html/pages --output-dir dist --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-tag-whitespace",
18-
"build:html-dist": "npm run dev:html && cp html/pages/*.html dist",
18+
"build:html-dist": "npm run html:process && cp html/pages/*.html dist",
1919
"build": "run-s build:*"
2020
},
2121
"posthtml": {
@@ -44,4 +44,4 @@
4444
"posthtml-modules": "^0.6.2",
4545
"posthtml-w3c": "^0.9.0"
4646
}
47-
}
47+
}

setup.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
mkdir -p {css,html,js,img}
22
cd css && mkdir {base,config,objects,globals,components,utilities,pages}
33
touch styles.css
4+
cd ..
45

56
cd js && touch scripts.js && echo "console.log('scripts.js is working');" > scripts.js && cd ..
67
cd html && mkdir -p {pages,templates}
@@ -12,5 +13,6 @@ npm init -y
1213
npm i -D posthtml posthtml-cli posthtml-load-config html-minifier posthtml-modules posthtml-w3c posthtml-hint posthtml-classes posthtml-bem posthtml-favicons browser-sync npm-run-all onchange
1314

1415
git init
15-
touch .gitignore && echo "node_modules/" > .gitignore
16-
echo "**/.DS_Store" > .gitignore
16+
touch .gitignore
17+
echo "node_modules/" >> .gitignore
18+
echo "**/.DS_Store" >> .gitignore

utilities/favicons.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ posthtml()
77
.use(favIconPlugin({ outDir: "./dist/img/favicons", configuration: { path: "img/favicons" } }))
88
.process(html)
99
.then((res) => {
10-
fs.writeFileSync('html/pages/index.html', res.html);
10+
fs.writeFileSync('html/templates/components/head.html', res.html);
1111
});

utilities/html-css.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ const html = fs.readFileSync('html/templates/views/index.html');
1717

1818

1919
posthtml()
20-
.use(require('posthtml-classes')(config))
21-
.process(html);
20+
.use(require('posthtml-classes')(config))
21+
.process(html);

0 commit comments

Comments
 (0)