Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 94f3c12

Browse files
committed
Add asset pipeline for CSS
Closes #44
1 parent f3e2185 commit 94f3c12

File tree

10 files changed

+15858
-1175
lines changed

10 files changed

+15858
-1175
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
/*.xcodeproj
55
xcuserdata/
66
.swiftpm
7+
node_modules/
8+
.parcel-cache
9+
.vscode
10+
.cache

Assets/index.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,27 @@ jobs:
243243
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
244244
```
245245
246+
### Development
247+
## Web Assets
248+
249+
[Parcel](https://parceljs.org) is used to process Web assets such as CSS and JavaScript. To make changes, you need to have Node and a package manager such as `npm` installed. In the project root, run `npm install` to install the dependencies.
250+
251+
During development, run the following command in a terminal:
252+
253+
```terminal
254+
$ npm run watch
255+
```
256+
257+
This will start watching the source files in `Sources/web` with hot-reload support, auto-generating non-optimized assets in `Assets` whenever a source file is saved.
258+
259+
Once happy with the results, run this command to create production-ready assets:
260+
261+
```terminal
262+
$ npm run build
263+
```
264+
265+
Both the source files and the generated files are checked into this repository.
266+
246267
## License
247268

248269
MIT

Sources/swift-doc/Supporting Types/CSS.swift

Lines changed: 0 additions & 1172 deletions
This file was deleted.

Sources/swift-doc/Supporting Types/Layout.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ func layout(_ page: Page, baseURL: String) -> HTML {
1212
<meta name="viewport" content="width=device-width, initial-scale=1.0">
1313
<title>\#(page.module.name) - \#(page.title)</title>
1414
<base href="\#(baseURL)"/>
15-
<style type="text/css">
16-
\#(unsafeUnescaped: css)
17-
</style>
15+
<link rel="stylesheet" href="index.css" media="all" />
1816
</head>
1917
<body>
2018
<header>

0 commit comments

Comments
 (0)