nesta 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/tests.yml +1 -1
  3. data/.gitignore +1 -0
  4. data/{CHANGES → CHANGELOG.md} +117 -21
  5. data/Gemfile.lock +28 -26
  6. data/LICENSE +1 -1
  7. data/README.md +45 -31
  8. data/RELEASING.md +1 -1
  9. data/bin/nesta +4 -1
  10. data/lib/nesta/app.rb +1 -2
  11. data/lib/nesta/commands/build.rb +38 -0
  12. data/lib/nesta/commands/new.rb +2 -1
  13. data/lib/nesta/commands.rb +1 -0
  14. data/lib/nesta/config.rb +49 -75
  15. data/lib/nesta/config_file.rb +5 -1
  16. data/lib/nesta/helpers.rb +0 -5
  17. data/lib/nesta/models/file_model.rb +191 -0
  18. data/lib/nesta/models/menu.rb +67 -0
  19. data/lib/nesta/models/page.rb +167 -0
  20. data/lib/nesta/models.rb +3 -422
  21. data/lib/nesta/navigation.rb +0 -5
  22. data/lib/nesta/overrides.rb +32 -43
  23. data/lib/nesta/plugin.rb +0 -16
  24. data/lib/nesta/static/assets.rb +50 -0
  25. data/lib/nesta/static/html_file.rb +26 -0
  26. data/lib/nesta/static/site.rb +104 -0
  27. data/lib/nesta/version.rb +1 -1
  28. data/lib/nesta.rb +1 -3
  29. data/nesta.gemspec +5 -5
  30. data/templates/config/config.yml +28 -2
  31. data/templates/themes/README.md +1 -1
  32. data/templates/themes/views/master.sass +1 -1
  33. data/test/integration/atom_feed_test.rb +1 -1
  34. data/test/integration/commands/build_test.rb +53 -0
  35. data/test/integration/overrides_test.rb +1 -1
  36. data/test/integration/sitemap_test.rb +1 -1
  37. data/test/support/temporary_files.rb +1 -1
  38. data/test/support/test_configuration.rb +2 -4
  39. data/test/unit/config_test.rb +25 -94
  40. data/test/unit/static/assets_test.rb +56 -0
  41. data/test/unit/static/html_file_test.rb +41 -0
  42. data/test/unit/static/site_test.rb +104 -0
  43. data/views/atom.haml +2 -2
  44. data/views/comments.haml +2 -2
  45. data/views/footer.haml +1 -1
  46. data/views/header.haml +2 -3
  47. data/views/layout.haml +2 -2
  48. data/views/master.sass +1 -1
  49. data/views/mixins.sass +2 -2
  50. data/views/normalize.scss +0 -1
  51. data/views/sitemap.haml +1 -1
  52. metadata +42 -31
  53. /data/test/unit/{file_model_test.rb → models/file_model_test.rb} +0 -0
  54. /data/test/unit/{menu_test.rb → models/menu_test.rb} +0 -0
  55. /data/test/unit/{page_test.rb → models/page_test.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e80fef7e8fe518a674eb7527d91410d162fca8288985971e641a3329ae192eef
4
- data.tar.gz: bc6f671dc4f0ae10b403fa53b489f06c74ae8e9c6560ae49e08dc2518185dc22
3
+ metadata.gz: 7080f8e4c8c7b993aaaf2f1f2ea59edbefd0b49ef73218a8f20d6877880b18c2
4
+ data.tar.gz: 806b5caf9fbfc69221087bd98254e282ddb5ba0e4288ee835d3af22fc879ab9f
5
5
  SHA512:
6
- metadata.gz: 857872073a0ea318df15323bd0f9a64de0104106b45c0c749a2261e266866abc0dd38f475fa98de07fb9cb09ee41411b837ec91a1e7d581bb1924f697557184d
7
- data.tar.gz: 828a24e35350cfae15ff093f42a67a6ee33faf48435b0e0d9ff831e3e5a1592b2e22db2910442eb39adc7642f5b3f451224dcf8f49fcc11d7a062e7a48f4b47c
6
+ metadata.gz: 17a405a098acca204751044cff182ee6484c93c373b7266a2c194345736438b71366b05cd04ea8d64e7949c9ab071e01cde387a1c68d1190a2087d211fa45060
7
+ data.tar.gz: 8d37d4b2b1fb4df23d57403da16c865db06a4a899a942a594cfac47212f998c52ef330ae9091149e1858c06f390f2ed9e4ef94621b115c52f04ed821d0cc9b7d
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: ["2.7", "3.0", "3.1", "head"]
11
+ ruby: ["2.7", "3.0", "3.1", "3.2"]
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
14
  - uses: actions/checkout@v3
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /.rbenv-version
7
7
  /.ruby-version
8
8
  /.rvmrc
9
+ /checksums
9
10
  /config/config.yml
10
11
  /config/deploy.rb
11
12
  /db/*.db
@@ -1,4 +1,99 @@
1
- = 0.13.0 / (28 September 2022)
1
+ # Changelog
2
+
3
+ ## 0.15.0 (11 July 2023)
4
+
5
+ * Upgrade to Sinatra 3. (Graham Ashton)
6
+
7
+ * The `models.rb` file has been long and unnecessarily hard to navigate
8
+ for too long. It has been split up into multiple files, one for each
9
+ class. (Graham Ashton, suggested by Lilith River)
10
+
11
+ * Remove support for the BlueCloth markdown library. Nesta uses Tilt
12
+ for rendering Markdown, and BlueCloth support has been removed in
13
+ Tilt 2.2.0. See rtomayko/tilt#382 for details.
14
+
15
+ If your site uses BlueCloth, remove your call to `Tilt.prefer`,
16
+ and Nesta will use its default Markdown processor. See Nesta's docs
17
+ on [configuring the Markdown processor] for more details.
18
+
19
+ [configuring the Markdown processor]: https://nestacms.com/docs/creating-content/changing-the-markdown-processor
20
+
21
+ (Graham Ashton)
22
+
23
+ ## 0.14.0 (23 March 2023)
24
+
25
+ * Nesta can now be used as a Static Site Generator (SSG) with its new
26
+ `nesta build` command! Server Side Rendering (SSR) is still supported,
27
+ as is development with a local web server.
28
+
29
+ Back in the days when Heroku allowed us to deploy Nesta on their
30
+ platform for free, there really didn't seem to be any point in
31
+ converting a site to a bunch of static HTML and CSS files. If you
32
+ enabled the appropriate HTTP cache-control headers, Heroku would
33
+ automatically cache an entire site in memory, so there was no real
34
+ performance benefit. That's why Nesta never had SSG support, even
35
+ though everybody seemed to think it was cool.
36
+
37
+ But Heroku is not free any more. And there's a wide choice of hosting
38
+ platforms for static site generators. So why not?
39
+
40
+ See the docs for full details, but in short:
41
+
42
+ - If you run `bundle exec nesta build`, Nesta will generate a static
43
+ copy of your site in a ./dist directory.
44
+
45
+ - You might want to add ./dist to your .gitignore file.
46
+
47
+ - There are a couple of new config settings in config.yml.
48
+
49
+ - You can configure hosting platforms like Netlify, AWS Amplify,
50
+ Vercel (and others) to redeploy your site by running the build
51
+ command when you push changes to your git repository.
52
+
53
+ This was fun to implement. (Graham Ashton)
54
+
55
+ * Sass and SCSS files are now rendered with Dart Sass (the main implementation
56
+ of Sass). We had been using the (now deprecated) libsass library.
57
+
58
+ Sass has changed a bit since libsass was current, so you may need to make
59
+ some small changes to your stylesheets. Documentation that should help with
60
+ those changes can be found here:
61
+
62
+ https://sass-lang.com/documentation/breaking-changes
63
+
64
+ * Replace Nesta's custom template-locating code with Sinatra's #find_template
65
+ method. (Graham Ashton, suggested by Lilith River)
66
+
67
+ * Update multiple dependencies to fix security vulnerabilities; see commit
68
+ history for details. (Graham Ashton)
69
+
70
+ * Built-in support for configuring Nesta via environment variables has been
71
+ dropped. (Graham Ashton)
72
+
73
+ Should you still want to configure Nesta via the environment you can
74
+ use Erb in `config.yml`, like this:
75
+
76
+ some_value: <%= ENV.fetch('NESTA_VARIABLE') %>
77
+
78
+ * During a tidy up of the config file code, the `yaml_conf` attribute on
79
+ the Nesta::Config class has been renamed to `config`. This is unlikely
80
+ to affect you, but if it does just change the name. (Graham Ashton)
81
+
82
+ * The `yaml_path` attribute on the Nesta::Config class has been moved
83
+ to `Nesta::ConfigFile.path`. Again, I can't imagine why anybody would
84
+ have written code that used it, but it's a breaking change so I'm
85
+ mentioning it. (Graham Ashton)
86
+
87
+ * Support for loading plugins from a local directory (which was deprecated
88
+ in version 0.9.10) has been removed. (Graham Ashton)
89
+
90
+ * The local_stylesheet? helper method (deprecated in 0.9.1) has been
91
+ removed. (Graham Ashton)
92
+
93
+ * The breadcrumb_label helper method (deprecated in 0.9.3) has been removed.
94
+ (Graham Ashton)
95
+
96
+ ## 0.13.0 (28 September 2022)
2
97
 
3
98
  * Update dependencies in order to support Ruby 3.0 and above.
4
99
  (Graham Ashton)
@@ -24,7 +119,7 @@
24
119
  * Stopped the test suite from executing external commands during tests.
25
120
  (Graham Ashton)
26
121
 
27
- = 0.12.0 / (30 June 2020)
122
+ ## 0.12.0 (30 June 2020)
28
123
 
29
124
  * Upgrade to Sinatra 2 and Rack 2. (Graham Ashton)
30
125
 
@@ -40,12 +135,12 @@
40
135
  * Stop running the test suite under Ruby 2.3 and 2.4, both of which
41
136
  have reached end-of-life. (Graham Ashton)
42
137
 
43
- = 0.11.1 / (26 March 2015)
138
+ ## 0.11.1 (26 March 2015)
44
139
 
45
140
  * Tighten dependency on Tilt, as version 2.x is incompatible.
46
141
  (Graham Ashton)
47
142
 
48
- = 0.11.0 / (16 March 2015)
143
+ ## 0.11.0 (16 March 2015)
49
144
 
50
145
  * Allow Haml pages to use the built-in Markdown filter again, by
51
146
  including the haml-contrib gem.
@@ -88,7 +183,7 @@
88
183
 
89
184
  * Support for Ruby 2.2. (Graham Ashton)
90
185
 
91
- = 0.10.0 / (25 April 2014)
186
+ ## 0.10.0 (25 April 2014)
92
187
 
93
188
  * Upgraded the default theme to a responsive design, using Google's
94
189
  Roboto Slab web font. (Graham Ashton)
@@ -212,7 +307,7 @@
212
307
  this list. See GitHub for the full list of commits.
213
308
  https://github.com/gma/nesta/compare/v0.9.13...v0.10.0
214
309
 
215
- = 0.9.13 / (3 March 2012)
310
+ ## 0.9.13 (3 March 2012)
216
311
 
217
312
  * The nesta script has a new command; edit. You can pass it the path
218
313
  to a file within your content/pages folder and it will open the file
@@ -270,9 +365,9 @@
270
365
  * Bug fix: Summaries on Haml pages were not marked up as paragraphs.
271
366
  See #75.
272
367
 
273
- = 0.9.12 / (Released then pulled, due to rubygems [still] being a total mess)
368
+ ## 0.9.12 (Released then pulled, due to rubygems [still] being a total mess)
274
369
 
275
- = 0.9.11 / (22 September 2011)
370
+ ## 0.9.11 (22 September 2011)
276
371
 
277
372
  * Use Tilt to render the Markdown, Textile and Haml in content/pages.
278
373
  RDiscount is now the default Markdown processor. To continue using
@@ -299,7 +394,7 @@
299
394
  within the content folder by crafting a relative path containing
300
395
  the string '../' (Louis Nyffenegger).
301
396
 
302
- = 0.9.10 / (9 September 2011)
397
+ ## 0.9.10 (9 September 2011)
303
398
 
304
399
  * Load Nesta plugins from gems. Any gem whose name begins with
305
400
  nesta-plugin- can be used in a project by adding it to the project's
@@ -317,7 +412,7 @@
317
412
  the Sass rendering engine by default, which allows it to find .sass
318
413
  files within the gem if no matching files are found locally.
319
414
 
320
- = 0.9.9 / (24 August 2011)
415
+ ## 0.9.9 (24 August 2011)
321
416
 
322
417
  * Bug fix: What a debacle this is turning into. The new Nesta::Env
323
418
  class must be required before the code in 'nesta/app' is loaded.
@@ -325,7 +420,7 @@
325
420
  via config.ru. Running Nesta any other way lead to an immediate
326
421
  crash.
327
422
 
328
- = 0.9.8 / (22 August 2011)
423
+ ## 0.9.8 (22 August 2011)
329
424
 
330
425
  * Bug fix: The Sinatra app's root directory wasn't set which meant
331
426
  that Nesta couldn't always find the ./public directory (such as when
@@ -336,12 +431,12 @@
336
431
  Nesta::Env class. In 0.9.6 I forgot to actually set Nesta::App.root
337
432
  as well, which was a big mistake. Whoops.
338
433
 
339
- = 0.9.7 / (19 August 2011)
434
+ ## 0.9.7 (19 August 2011)
340
435
 
341
436
  * No code changes from 0.9.6; version number increased to allow new gem
342
437
  to be deployed to rubygems.org.
343
438
 
344
- = 0.9.6 / (18 August 2011) [never released due to packaging bug]
439
+ ## 0.9.6 (18 August 2011) [never released due to packaging bug]
345
440
 
346
441
  * Nesta no longer cares whether you write your Sass stylesheets in the
347
442
  original indented Sass format or the default SCSS syntax (which is a
@@ -367,7 +462,7 @@
367
462
  Nesta::App.root would be before requiring nesta/app. Fixed by
368
463
  creating Nesta::Env and moving root to there instead.
369
464
 
370
- = 0.9.5 / (1 May 2011)
465
+ ## 0.9.5 (1 May 2011)
371
466
 
372
467
  * Added --version option to nesta command (Christopher Lindblom).
373
468
 
@@ -393,14 +488,14 @@
393
488
  within Haml templates. See https://github.com/gma/nesta/pull/18
394
489
  (Carl Furrow).
395
490
 
396
- = 0.9.4 / 18 February 2011
491
+ ## 0.9.4 (18 February 2011)
397
492
 
398
493
  * Updated the link colours in the default theme.
399
494
 
400
495
  * Set the default encoding to UTF-8. Without it Heroku would sometimes
401
496
  fail to render pages (issue 14).
402
497
 
403
- = 0.9.3 / 18 January 2011
498
+ ## 0.9.3 (18 January 2011)
404
499
 
405
500
  * The route and view for serving the home page (/) has been removed,
406
501
  and the home page must now be created as an index page in
@@ -442,7 +537,7 @@
442
537
  * Bug fix: Don't output empty <li> tags for nested submenus that are
443
538
  beneath the requested number of levels.
444
539
 
445
- = 0.9.2 / 10 January 2011
540
+ ## 0.9.2 (10 January 2011)
446
541
 
447
542
  * Made the FileModel.metadata method public, to allow for custom
448
543
  metadata at the top of each page. (Wynn Netherland)
@@ -452,7 +547,7 @@
452
547
 
453
548
  * Added templates required by `nesta theme:create`.
454
549
 
455
- = 0.9.1 / 31 December 2010
550
+ ## 0.9.1 (31 December 2010)
456
551
 
457
552
  * Re-implemented the default theme, using semantic HTML5 and
458
553
  Andy Clarke's Universal Internet Explorer 6 CSS. Named the previous
@@ -465,15 +560,16 @@
465
560
  * Moved the navigation helpers into the Nesta::Navigation::Renderers
466
561
  module.
467
562
 
468
- = 0.9.0 / 20 December 2010
563
+ ## 0.9.0 (20 December 2010)
469
564
 
470
565
  * Packaged Nesta as a gem for the first time, instead of as a template
471
566
  site that can be cloned, edited and deployed. Added the `nesta`
472
567
  command for generating new sites and managing themes.
473
568
 
474
- = Previous versions / from 26 November 2008
569
+ ## Previous versions (from 26 November 2008)
475
570
 
476
571
  * Prior to 0.9.0 Nesta was distributed as a git repository that could
477
572
  be forked, edited and deployed. The only change log for these
478
- versions is the Git commit history.
573
+ versions is the commit history:
574
+
479
575
  https://github.com/gma/nesta/commits/master
data/Gemfile.lock CHANGED
@@ -1,14 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nesta (0.13.0)
4
+ nesta (0.15.0)
5
5
  RedCloth (~> 4.2)
6
6
  haml (>= 3.1, < 6.0)
7
7
  haml-contrib (>= 1.0)
8
- rack (~> 2.0)
8
+ rack (~> 2)
9
+ rake
9
10
  rdiscount (~> 2.1)
10
- sassc (>= 2.2)
11
- sinatra (~> 2.0)
11
+ sass-embedded (~> 1.58)
12
+ sinatra (~> 3.0)
12
13
  tilt (~> 2.0)
13
14
 
14
15
  GEM
@@ -28,6 +29,7 @@ GEM
28
29
  rack-test (>= 0.5.4)
29
30
  xpath (>= 2.0, < 4.0)
30
31
  ffi (1.15.5)
32
+ google-protobuf (3.22.2)
31
33
  haml (5.2.2)
32
34
  temple (>= 0.8.0)
33
35
  tilt
@@ -39,9 +41,9 @@ GEM
39
41
  rb-inotify (>= 0.9)
40
42
  rb-kqueue (>= 0.2)
41
43
  mini_mime (1.1.2)
42
- mini_portile2 (2.8.0)
43
- minitest (5.16.3)
44
- minitest-reporters (1.5.0)
44
+ mini_portile2 (2.8.1)
45
+ minitest (5.18.0)
46
+ minitest-reporters (1.6.0)
45
47
  ansi
46
48
  builder
47
49
  minitest (>= 5.0)
@@ -51,37 +53,38 @@ GEM
51
53
  rb-fsevent (>= 0.9)
52
54
  rb-inotify (>= 0.8)
53
55
  unicorn (>= 4.5)
54
- mustermann (2.0.2)
56
+ mustermann (3.0.0)
55
57
  ruby2_keywords (~> 0.0.1)
56
- nokogiri (1.13.8)
58
+ nokogiri (1.14.3)
57
59
  mini_portile2 (~> 2.8.0)
58
60
  racc (~> 1.4)
59
- public_suffix (5.0.0)
60
- racc (1.6.0)
61
- rack (2.2.4)
62
- rack-protection (2.2.2)
61
+ public_suffix (5.0.1)
62
+ racc (1.6.2)
63
+ rack (2.2.6.4)
64
+ rack-protection (3.0.5)
63
65
  rack
64
66
  rack-test (2.0.2)
65
67
  rack (>= 1.3)
66
- raindrops (0.20.0)
68
+ raindrops (0.20.1)
67
69
  rake (13.0.6)
68
70
  rb-fsevent (0.11.2)
69
71
  rb-inotify (0.10.1)
70
72
  ffi (~> 1.0)
71
73
  rb-kqueue (0.2.8)
72
74
  ffi (>= 0.5.0)
73
- rdiscount (2.2.0.2)
74
- ruby-progressbar (1.11.0)
75
+ rdiscount (2.2.7)
76
+ ruby-progressbar (1.13.0)
75
77
  ruby2_keywords (0.0.5)
76
- sassc (2.4.0)
77
- ffi (~> 1.9)
78
- sinatra (2.2.2)
79
- mustermann (~> 2.0)
80
- rack (~> 2.2)
81
- rack-protection (= 2.2.2)
78
+ sass-embedded (1.58.3)
79
+ google-protobuf (~> 3.21)
80
+ rake (>= 10.0.0)
81
+ sinatra (3.0.5)
82
+ mustermann (~> 3.0)
83
+ rack (~> 2.2, >= 2.2.4)
84
+ rack-protection (= 3.0.5)
82
85
  tilt (~> 2.0)
83
- temple (0.8.2)
84
- tilt (2.0.11)
86
+ temple (0.10.0)
87
+ tilt (2.1.0)
85
88
  unicorn (6.1.0)
86
89
  kgio (~> 2.6)
87
90
  raindrops (~> 0.7)
@@ -98,7 +101,6 @@ DEPENDENCIES
98
101
  minitest-reporters
99
102
  mr-sparkle
100
103
  nesta!
101
- rake
102
104
 
103
105
  BUNDLED WITH
104
- 2.3.14
106
+ 2.4.6
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2022 Graham Ashton
1
+ Copyright (c) 2008-2023 Graham Ashton
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,34 +1,37 @@
1
- # Nesta - a CMS for Ruby Developers
1
+ # Lightweight file-based CMS and Static Site Generator
2
2
 
3
- A file-based CMS for web sites and blogs, written in [Sinatra][frank].
3
+ Nesta is a lightweight CMS for building content sites and blogs, written in
4
+ [Sinatra].
4
5
 
5
- Content can be written in [Markdown][markdown] or [Textile][textile] and
6
- stored in text files (though you can also use Haml if you need to add
7
- some HTML to your pages). There's no database; write your content in
8
- your editor. Publish by pushing to a git repository.
6
+ Content can be written in [Markdown] or [Textile], stored in text files on your
7
+ computer. There is no database.
9
8
 
10
- [frank]: http://www.sinatrarb.com/ "Sinatra"
11
- [markdown]: http://daringfireball.net/projects/markdown/
12
- [textile]: http://textism.com/tools/textile/
9
+ You do your writing in your text editor.
10
+
11
+ Publish by pushing your changes to a git repository that's setup to deploy your
12
+ changes to the web.
13
+
14
+ [Sinatra]: http://www.sinatrarb.com/ "Sinatra"
15
+ [Markdown]: http://daringfireball.net/projects/markdown/
16
+ [Textile]: http://textism.com/tools/textile/
13
17
 
14
18
  ## Installation
15
19
 
16
- Begin by installing the gem:
20
+ Begin by [installing Ruby], then the Nesta gem:
17
21
 
18
22
  $ gem install nesta
19
23
 
20
- Then use the `nesta` command to generate a new site:
24
+ Use the `nesta` command to generate a new site:
21
25
 
22
- $ nesta new mysite.com --git
26
+ $ nesta new mysite.com --git # a git repo is optional, but recommended
23
27
 
24
28
  Install a few dependencies, and you're away:
25
29
 
26
30
  $ cd mysite.com
27
31
  $ bundle
28
32
 
29
- You'll find basic configuration options for your site in
30
- `config/config.yml`. The defaults will work, but you'll want to tweak it
31
- before you go very far.
33
+ You'll find configuration options for your site in `config/config.yml`. The
34
+ defaults will work, but you'll want to tweak it before you go very far.
32
35
 
33
36
  That's it - you can launch a local web server in development mode using
34
37
  mr-sparkle...
@@ -36,32 +39,43 @@ mr-sparkle...
36
39
  $ bundle exec mr-sparkle config.ru
37
40
 
38
41
  ...then point your web browser at http://localhost:8080. Start editing
39
- the files in `content/pages` (see the [docs on writing content][] for
40
- full instructions).
42
+ the files in `content/pages` (see the [docs on writing content] for full
43
+ instructions).
44
+
45
+ You can either [deploy it] behind a web server, or build a static version of
46
+ your site:
41
47
 
42
- [docs on writing content]: http://nestacms.com/docs/creating-content
48
+ $ nesta build # but see config.yml for related settings
49
+
50
+ [installing Ruby]: https://www.ruby-lang.org/en/documentation/installation/
51
+ [docs on writing content]: http://nestacms.com/docs/creating-content/
52
+ [deploy it]: https://nestacms.com/docs/deployment/
43
53
 
44
54
  ## Support
45
55
 
46
56
  There's plenty of information on <http://nestacms.com>. If you need some
47
- help with anything feel free to file an issue, or contact me (@grahamashton)
48
- on Twitter.
57
+ help with anything feel free to file an issue, or contact me on Mastodon
58
+ ([@gma@hachyderm.io]) or Twitter ([@grahamashton]).
59
+
60
+ If you like Nesta you can keep up with developments by following [@nestacms]
61
+ on Twitter, and on [the blog].
49
62
 
50
- If you like Nesta you can keep up with developments by following [@nestacms][]
51
- on Twitter, and on [the blog][].
63
+ [@gma@hachyderm.io]: https://hachyderm.io/@gma
64
+ [@grahamashton]: https://twitter.com/grahamashton
65
+ [@nestacms]: https://twitter.com/nestacms
66
+ [the blog]: https://nestacms.com/blog
52
67
 
53
- [@nestacms]: http://twitter.com/nestacms
54
- [the blog]: http://nestacms.com/blog
68
+ ![Tests](https://github.com/gma/nesta/actions/workflows/tests.yml/badge.svg)
55
69
 
56
70
  ## Contributing
57
71
 
58
- If you want to add a new feature, I recommend that you file an issue to discuss
59
- it before you start coding. I'm likely to suggest that we implement it as a
60
- [plugin][] (to keep Nesta itself lean and simple), so you might save yourself
61
- some time if we chat about a good approach before you start.
72
+ If you want to add a new feature, please [create an issue] to discuss it before
73
+ you start coding. I might suggest that we implement it as a [plugin] (to keep
74
+ Nesta itself lean and simple), or be able to chip in with ideas on how to
75
+ approach it.
62
76
 
63
- [plugin]: http://nestacms.com/docs/plugins
77
+ [create an issue]: https://github.com/gma/nesta/issues/new
78
+ [plugin]: https://nestacms.com/docs/plugins
64
79
 
65
- -- Graham ([@grahamashton][] on Twitter).
80
+ -- Graham
66
81
 
67
- [@grahamashton]: http://twitter.com/grahamashton
data/RELEASING.md CHANGED
@@ -10,7 +10,7 @@ the steps:
10
10
  the version number in `Gemfile.lock` to be updated too, so regenerate
11
11
  it now and check them in together.
12
12
 
13
- 3. Update the `CHANGES` file with a summary of significant changes since
13
+ 3. Update the `CHANGLOG.md` file with a summary of significant changes since
14
14
  the previous release.
15
15
 
16
16
  4. Commit these changes with a commit message of 'Bump version to <version>'
data/bin/nesta CHANGED
@@ -24,6 +24,7 @@ COMMANDS
24
24
  theme:install <url> Install a theme from a git repository.
25
25
  theme:enable <name> Make the theme active, updating config.yml.
26
26
  theme:create <name> Makes a template for a new theme in ./themes.
27
+ build [path] Build static copy of site (path defaults to ./dist)
27
28
 
28
29
  OPTIONS FOR new
29
30
  --git Create a new git repository for the project.
@@ -41,6 +42,7 @@ EOF
41
42
  def self.parse_command_line
42
43
  opts = GetoptLong.new(
43
44
  ['--bash-completion', GetoptLong::NO_ARGUMENT],
45
+ ['--domain', GetoptLong::REQUIRED_ARGUMENT],
44
46
  ['--git', GetoptLong::NO_ARGUMENT],
45
47
  ['--help', '-h', GetoptLong::NO_ARGUMENT],
46
48
  ['--version', '-v', GetoptLong::NO_ARGUMENT],
@@ -118,7 +120,7 @@ _nesta() {
118
120
  cur="${COMP_WORDS[COMP_CWORD]}"
119
121
  prev="${COMP_WORDS[COMP_CWORD-1]}"
120
122
 
121
- opts="new 'demo:content' edit 'plugin:create' 'theme:install' 'theme:enable' 'theme:create'"
123
+ opts="new 'demo:content' edit 'plugin:create' 'theme:install' 'theme:enable' 'theme:create' build"
122
124
 
123
125
  case "${cur}" in
124
126
  theme:*)
@@ -172,6 +174,7 @@ _1st_arguments=(
172
174
  'theme\:install:Install a theme from a git repository'
173
175
  'theme\:enable:Make the theme active, updating config.yml'
174
176
  'theme\:create:Makes a template for a new theme in ./themes'
177
+ 'build\:Build static copy of site'
175
178
  )
176
179
 
177
180
  local expl
data/lib/nesta/app.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'sinatra/base'
2
2
  require 'haml'
3
- require 'sassc'
4
3
 
5
4
  require File.expand_path('../nesta', File.dirname(__FILE__))
6
5
  require File.expand_path('env', File.dirname(__FILE__))
@@ -18,6 +17,7 @@ module Nesta
18
17
  set :root, Nesta::Env.root
19
18
  set :views, File.expand_path('../../views', File.dirname(__FILE__))
20
19
  set :haml, { format: :html5 }
20
+ set :public_folder, 'public'
21
21
 
22
22
  helpers Overrides::Renderers
23
23
  helpers Navigation::Renderers
@@ -90,5 +90,4 @@ module Nesta
90
90
  end
91
91
  end
92
92
 
93
- Nesta::Plugin.load_local_plugins
94
93
  Nesta::Plugin.initialize_plugins
@@ -0,0 +1,38 @@
1
+ require 'rake'
2
+
3
+ require_relative '../static/assets'
4
+ require_relative '../static/site'
5
+
6
+ module Nesta
7
+ module Commands
8
+ class Build
9
+ DEFAULT_DESTINATION = "dist"
10
+
11
+ attr_accessor :domain
12
+
13
+ def initialize(build_dir = nil, options = {})
14
+ @build_dir = build_dir || DEFAULT_DESTINATION
15
+ if @build_dir == Nesta::App.settings.public_folder
16
+ raise RuntimeError.new("#{@build_dir} is already used, for assets")
17
+ end
18
+ @domain = options['domain'] || configured_domain_name
19
+ end
20
+
21
+ def configured_domain_name
22
+ Nesta::Config.build.fetch('domain', 'localhost')
23
+ end
24
+
25
+ def execute(process)
26
+ logger = Proc.new { |message| puts message }
27
+ site = Nesta::Static::Site.new(@build_dir, @domain, logger)
28
+ site.render_pages
29
+ site.render_not_found
30
+ site.render_atom_feed
31
+ site.render_sitemap
32
+ site.render_templated_assets
33
+ Nesta::Static::Assets.new(@build_dir, logger).copy_attachments
34
+ Nesta::Static::Assets.new(@build_dir, logger).copy_public_folder
35
+ end
36
+ end
37
+ end
38
+ end
@@ -25,7 +25,8 @@ module Nesta
25
25
  def create_repository(process)
26
26
  FileUtils.cd(@path) do
27
27
  File.open('.gitignore', 'w') do |file|
28
- file.puts %w[._* .*.swp .bundle .DS_Store .sass-cache].join("\n")
28
+ lines = %w[._* .*.swp .bundle .DS_Store .sass-cache dist]
29
+ file.puts lines.join("\n")
29
30
  end
30
31
  process.run('git', 'init')
31
32
  process.run('git', 'add', '.')
@@ -7,6 +7,7 @@ require File.expand_path('path', File.dirname(__FILE__))
7
7
  require File.expand_path('system_command', File.dirname(__FILE__))
8
8
  require File.expand_path('version', File.dirname(__FILE__))
9
9
 
10
+ require File.expand_path('commands/build', File.dirname(__FILE__))
10
11
  require File.expand_path('commands/demo', File.dirname(__FILE__))
11
12
  require File.expand_path('commands/edit', File.dirname(__FILE__))
12
13
  require File.expand_path('commands/new', File.dirname(__FILE__))