Skip to content

Commit

Permalink
Merge pull request #31 from maks/update-to-full-ns
Browse files Browse the repository at this point in the history
Update to full null safety, rm sass, autoprefix, say.
  • Loading branch information
maks authored Jun 29, 2023
2 parents 282a8da + db1395f commit b0ca771
Show file tree
Hide file tree
Showing 73 changed files with 444 additions and 2,983 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v2.0.0

* updated to full null safety
* removed support for sass, autoprefixer and say
* removed old code, examples, etc

# v1.0.4

* cleanup code
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020, Maksim Lin (admin@manichord.com),
Copyright (c) 2020, 2023 Maksim Lin (admin@manichord.com),
Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

Expand Down
62 changes: 0 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Includes support for:
* yaml front-matter
* json / yaml data processing
* a webserver
* Sass + autoprefix support

*think: Jekyll for Dart*

Expand Down Expand Up @@ -40,38 +39,6 @@ you can see the necessary configuration for HTTPS-Support
Generate a self-signed certificate, name it dart.cert and dart.key, place it under <project root>/etc
and run `dsg -x --usesec` and - voila. That's it!

#### Support for SASS_PATH
[Understanding and Using Sass Load Paths](https://technology.customink.com/blog/2014/10/09/understanding-and-using-sass-load-paths/)

These settings in your .dsg/site.yaml ()
```yaml
sasscompiler: sass
sass_path:
- "package:zengen"
- "package:mdl"
```
generate the following SASS_PATH:
```bash
dsg -s

Settings:
Loglevel: info
...
SASS compiler: sass
SASS_PATH (only for sass): /Users/example/.pub-cache/hosted/pub.dartlang.org/zengen-0.3.2/lib
/Volumes/Daten/DevLocal/DevDart/MaterialDesignLite/lib
...

```
As you can see the first path is resolved to .pub-cache, the second path
is resolve to a local working dir where the mdl-library resides

Now you can define your SASS-Import as follows:
```scss
// Imports package:mdl/lib/assets/styles/button/variables
@import "assets/styles/button/variables";
```

### What it does
DSG is a static site generator in [Dart](https://www.dartlang.org/), with a webserver included.
Expand Down Expand Up @@ -255,11 +222,7 @@ Supported vars:
- yaml_delimeter: ---
- use_markdown: true
- default_template: default.html
- sasscompiler: sassc
- usesass: true
- autoprefixer: true
- browser: Chromium
- talktome: true (on OSX, false on all the other OSs)
- watchfolder1, watchfolder2 and watchfolder3
## Markdown
Expand Down Expand Up @@ -354,22 +317,6 @@ Article published on: {{# formatDate }} {{ date }} {{/ formatDate }}
```
will output: `Article published on: 26 Jan 2020`


## SASS
If DSG finds a .scss file in your output dir (web) it compiles it to the corresponding .css file.
Install instruction for SASS can be found [here](https://sass-lang.com/install)
In short it's `gem install sass` and `gem install sassc`

You can turn off SASS either with `--no-usesass` or with the appropriate setting in site.yaml

Or **install sassc**, eg on MacOS: `brew install sassc`

## Autoprefixer
After compiling .SCSS to .CSS DSG calls autoprefixer <yourcss>
Install autoprefixer with `npm install --global autoprefixer-cli`

You can turn off Autoprefixer either with `--no-useapfx` or with the appropriate setting in site.yaml

# Install
Install
```shell
Expand All @@ -393,21 +340,12 @@ Usage: dsg [options]
-s, --settings Prints settings
-h, --help Shows this message
-g, --generate Generate site
-c, --generatecss Generate CSS (compile SCSS2CSS)
-w, --watch Observes SRC-dir
-x, --watchandserve Shortcut to watch and serve
-i, --init Initializes your site
(not combinable with other options)

--serve Serves your site
--[no-]usesass Enables / disables SASS to CSS compiler
(defaults to on)

--[no-]useapfx Enables / disables Autoprefixer
(defaults to on)

--[no-]talktome Enables / disables Speek-Output
(defaults to on)

--ip Sets the IP-Address to listen on
(defaults to "127.0.0.1")
Expand Down
9 changes: 4 additions & 5 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
include: package:pedantic/analysis_options.yaml

analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
# language:
# strict-casts: true
# strict-inference: true
# strict-raw-types: true
exclude:
- lib/**/*.g.dart
- lib/**/*.freezed.dart
Expand Down
5 changes: 5 additions & 0 deletions bin/dsg.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import 'dart:async';
import 'dart:io';

import 'package:bonsai/bonsai.dart';
import 'package:dsg/dsg.dart';

Future main(List<String> arguments) async {
const debug = true;
if (debug) {
Log.init(true);
}
final application = Application();
exitCode = await application.run(arguments);
}
Binary file added bin/dsg.exe
Binary file not shown.
41 changes: 0 additions & 41 deletions build.jenkins

This file was deleted.

1 change: 0 additions & 1 deletion example/lib/main.dart

This file was deleted.

6 changes: 0 additions & 6 deletions example/simple/.dsg/html/_content/about/index.html

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
97 changes: 0 additions & 97 deletions example/simple/.dsg/html/_content/assets/styles/styles.scss

This file was deleted.

5 changes: 0 additions & 5 deletions example/simple/.dsg/html/_content/blog/index.md

This file was deleted.

5 changes: 0 additions & 5 deletions example/simple/.dsg/html/_content/blog/postA.md

This file was deleted.

7 changes: 0 additions & 7 deletions example/simple/.dsg/html/_content/blog/postB.md

This file was deleted.

7 changes: 0 additions & 7 deletions example/simple/.dsg/html/_content/blog/postC.md

This file was deleted.

Binary file removed example/simple/.dsg/html/_content/favicon.ico
Binary file not shown.
26 changes: 0 additions & 26 deletions example/simple/.dsg/html/_content/features.html

This file was deleted.

12 changes: 0 additions & 12 deletions example/simple/.dsg/html/_content/index.html

This file was deleted.

Loading

0 comments on commit b0ca771

Please sign in to comment.