geb 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +56 -12
  4. data/lib/geb/commands/server.rb +3 -2
  5. data/lib/geb/config.rb +88 -0
  6. data/lib/geb/defaults.rb +2 -2
  7. data/lib/geb/page.rb +35 -3
  8. data/lib/geb/samples/basic/assets/css/site.css +41 -2
  9. data/lib/geb/samples/basic/geb.config.yml +19 -3
  10. data/lib/geb/samples/basic/index.html +24 -1
  11. data/lib/geb/samples/basic/shared/partials/_footer.html +4 -0
  12. data/lib/geb/samples/basic/shared/partials/_geb.html +26 -0
  13. data/lib/geb/samples/basic/shared/partials/_header.html +9 -0
  14. data/lib/geb/samples/bootstrap_jquery/assets/css/site.css +68 -1
  15. data/lib/geb/samples/bootstrap_jquery/blog/blog_post_1.html +83 -25
  16. data/lib/geb/samples/bootstrap_jquery/blog/index.html +39 -6
  17. data/lib/geb/samples/bootstrap_jquery/geb.config.yml +20 -3
  18. data/lib/geb/samples/bootstrap_jquery/index.html +252 -2
  19. data/lib/geb/samples/bootstrap_jquery/page.html +24 -2
  20. data/lib/geb/samples/bootstrap_jquery/shared/partials/_footer.html +2 -0
  21. data/lib/geb/samples/bootstrap_jquery/shared/partials/_geb.html +26 -0
  22. data/lib/geb/samples/bootstrap_jquery/shared/partials/_header.html +25 -0
  23. data/lib/geb/samples/bootstrap_jquery/shared/partials/_meta_tags.html +1 -1
  24. data/lib/geb/samples/bootstrap_jquery/shared/templates/_blog_post.html +19 -0
  25. data/lib/geb/samples/bootstrap_jquery/site.webmanifest +1 -1
  26. data/lib/geb/samples/geb.config.yml +17 -0
  27. data/lib/geb/server.rb +12 -6
  28. data/lib/geb/site/build.rb +73 -61
  29. data/lib/geb/site/release.rb +23 -28
  30. data/lib/geb/site/remote.rb +1 -1
  31. data/lib/geb/site/template.rb +6 -0
  32. data/lib/geb/site.rb +7 -0
  33. data/lib/geb/template.rb +1 -0
  34. data/lib/geb/utilities.rb +1 -1
  35. data/lib/geb.rb +1 -1
  36. data/test/api tests/test_cli.rb +1 -1
  37. data/test/api tests/test_config.rb +132 -0
  38. data/test/api tests/test_page.rb +88 -4
  39. data/test/api tests/test_server.rb +96 -32
  40. data/test/api tests/test_site.rb +131 -31
  41. data/test/command tests/test_geb_build.rb +2 -2
  42. data/test/command tests/test_geb_release.rb +6 -8
  43. data/test/command tests/test_geb_server.rb +21 -0
  44. metadata +4 -4
  45. data/lib/geb/samples/bootstrap_jquery/blog/blog_post_2.html +0 -35
  46. data/lib/geb/samples/bootstrap_jquery/blog/blog_post_3.html +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4160107ecc6dd44417d6b681fe18e036017228f08d2575245dda26d56b21cacd
4
- data.tar.gz: 9dac2e2d7e5c0c2ccdebc40d7092ed1d388236a42ea3a95bb1d12b2683fa124c
3
+ metadata.gz: 320443bc78778585ce6a490ec4559028ecf7db472d0ba883bd6ef96c519cf557
4
+ data.tar.gz: 2c8183e8ec958f84f51209d79362ef521cb82ea4a0fef74a2f4787fe3fdd6277
5
5
  SHA512:
6
- metadata.gz: 8167a7321d3cfabe53e26b06f4c7524b5c0b3626cb27aa4ac387c97a78edb700a3f15610c04f9045653eea1b3bee24db88327de39ff451a4b431ffdcc1d97e5f
7
- data.tar.gz: 45ea0613c98e977d295b457a73b4fb5dcc554ef0ad4e3f569b2819d88d96e06d70737cb58d00927c8a8c62f37d1ad55f349c49a9568aacadda373740941f6801
6
+ metadata.gz: cfe67c3d92152487de447791b4105992426d59ab476541e898576ab587130554480e26e85f379aea7de7caf93e370107ff680beb60f2be8f720bab69f5d3f5b7
7
+ data.tar.gz: ae8ae4c02727e063313516162a880f4e25825bfffc66f74d7412ac896cf4ce0c7d165171141638b66d9bfba7b7f64521316ee95ef328db6cd42dd26f5b861ab8
data/CHANGELOG.md CHANGED
@@ -24,6 +24,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
24
24
  ### Security
25
25
  - N/A
26
26
 
27
+ ## [0.1.12] - 2024-07-06
28
+ ### Added
29
+ - New Site Variables feature
30
+ - --debug option to the `geb server` command to show full build output when file changes are detected
31
+ - Updated bootstrap_jquery bundled template
32
+ - Updated basic bundled template
33
+ ### Changed
34
+ - Simplified build and release command APIs
35
+ ### Fixed
36
+ - Configured port not being used by the `geb server` command
37
+ - Fixed issue with template paths not working with certain wild card paths (.e.g. **/*.html)
38
+ ### Security
39
+ - Fixed issues with generating a site template with `geb release --with_template`, it now packages a sanitized version of `geb.config.yml` without remote_url and remote_path
40
+
27
41
  ## [0.1.11] - 2024-07-04
28
42
  ### Added
29
43
  - Initial release of Geb with core features for managing and building static websites.
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
1
  # Geb
2
+ ![Gem Version](https://img.shields.io/gem/v/geb.svg)
3
+ [![Changelog](https://img.shields.io/badge/Changelog-blue.svg)](CHANGELOG.md)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+ [![Code of Conduct](https://img.shields.io/badge/Code%20of%20Conduct-blue.svg)](CODE_OF_CONDUCT.md)
2
6
 
3
7
  Geb is a powerful and intuitive static website manager and builder named after the ancient Egyptian god Geb, the deity of the Earth. Just as Geb provides a stable foundation for the world, our software offers a robust and essential foundation for building and managing static websites, which form the very bedrock of the web.
4
8
 
@@ -24,6 +28,7 @@ With Geb, you can harness the power of site templates to streamline your workflo
24
28
  - [Partial Example](#partial-example)
25
29
  - [Result Page](#result-page)
26
30
  - [Discussion and key takeaways](#discussion-and-key-takeaways)
31
+ - [Site Variables](#site-variables)
27
32
  - [Command Reference](#command-reference)
28
33
  - [Roadmap](#roadmap)
29
34
  - [Development](#development)
@@ -197,8 +202,9 @@ that makes sense for your site.
197
202
 
198
203
  ## Pages, Templates and Partials
199
204
 
200
- Below are some examples of how to use pages, templates and partials with Geb.
201
- Read the examples first, then the discussion located after the examples.
205
+ Below are some examples of how to use pages, templates and partials with Geb.
206
+ Read the examples first, then the discussion located after the examples.
207
+
202
208
  ### Page Example
203
209
  Here is a simple page example, in the above site structure this might be `index.html` file
204
210
  ```erb
@@ -210,7 +216,7 @@ Here is a simple page example, in the above site structure this might be `index.
210
216
 
211
217
  <% start: content %>
212
218
  This is page content
213
- <% partial: shared/partials/_featured_product.html %>
219
+ <%= partial: shared/partials/_featured_product.html %>
214
220
  <% end: content %>
215
221
  ```
216
222
  ### Template Example
@@ -219,15 +225,15 @@ Here is a simple page example, in the above site structure this might be `index.
219
225
  <!DOCTYPE html>
220
226
  <html>
221
227
  <head>
222
- <title><% insert: title %></title>
223
- <% partial: shared/partials/_analytics.html %>
224
- <% partial: shared/partials/_meta_tags.html %>
225
- <% partial: shared/partials/_global_assets.html %>
228
+ <title><%= insert: title %></title>
229
+ <%= partial: shared/partials/_analytics.html %>
230
+ <%= partial: shared/partials/_meta_tags.html %>
231
+ <%= partial: shared/partials/_global_assets.html %>
226
232
  </head>
227
233
  <body>
228
- <% partial: shared/partials/_header.html %>
229
- <% insert: content %>
230
- <% partial: shared/partials/_footer.html %>
234
+ <%= partial: shared/partials/_header.html %>
235
+ <%= insert: content %>
236
+ <%= partial: shared/partials/_footer.html %>
231
237
  </body>
232
238
  </html>
233
239
  ```
@@ -236,7 +242,7 @@ Here is a simple page example, in the above site structure this might be `index.
236
242
  ```erb
237
243
  <h1>Best Product Ever<h1>
238
244
  <p>This is the best product ever</p>
239
- <% partial: shared/partials/_product_analytics.html %>
245
+ <%= partial: shared/partials/_product_analytics.html %>
240
246
  ```
241
247
  ### Result Page
242
248
  Below is the Page Example above, processed by `geb build` command.
@@ -262,7 +268,7 @@ Below is the Page Example above, processed by `geb build` command.
262
268
  ### Discussion and key takeaways
263
269
 
264
270
  - Pages are the actual content of the site. They are the only files that are served directly.
265
- - The example page above uses a template found in /shared/templates/_site.html
271
+ - The example page above uses a template found in /shared/templates/\_site.html
266
272
  - Templates are used to wrap pages in a common structure. They are not served directly.
267
273
  - The example template above has two content blocks, title and content.
268
274
  - The page above has those content areas filled in with whatever is required
@@ -272,8 +278,46 @@ Below is the Page Example above, processed by `geb build` command.
272
278
  - Obviously, the "start: what_ever_name" -> "end: what_ever_name" must have matching "names"
273
279
  - Partials are used to include common content in pages and templates. They are not served directly.
274
280
  - Partials can be nested, but be careful not to create circular references.
281
+ - A note on tags, <%= partial ... %> and <%= insert ... %> have and equal sign, while <% template ... %>, <% start ... %>, <% end ... %> do not. The reason is partial and insert actually change content where they are, while other tags are instructions.
275
282
  - That's about it... happy coding!
276
283
 
284
+ ## Site Variables
285
+
286
+ Geb supports a concept of site variables. In the geb configuration file you can specify site variables that are merged into the pages once templates and partials have been parsed.
287
+
288
+ Here is an example of what `geb.config.yml` may contain:
289
+
290
+ ```yaml
291
+ site_variables:
292
+ local:
293
+ title: "My Local Site"
294
+ site_url: "http://localhost:4000"
295
+ release:
296
+ title: "My Site"
297
+ site_url: "https://example.com"
298
+ ```
299
+
300
+ Geb will select the appropriate variables depending if you are building the site using `geb build` or releasing the site using `geb release`. Logically, `geb build` uses **local** variables, while `geb release` uses **release** variables.
301
+
302
+ To use the variables within templates, partials or pages, simply enclose the site variable name in \_{...}\_
303
+
304
+ <div><pre><code class="erb">&lt;html>
305
+ &lt;head&gt;
306
+ &lt;title&gt;_{title}_&gt;/title&gt;
307
+ &lt;meta name="twitter:image" content="_{site_url}_/assets/images/og-thumb.png" /&gt;
308
+ &lt;/head&gt;
309
+ &lt;/html&gt;
310
+ </code></pre>
311
+ </div>
312
+
313
+ Geb also has three special variables that are available during both `geb build` and `geb release`. These are:
314
+
315
+ - **page_title** - Extracted from the page &lt;title&gt;&lt;/title&gt; tag
316
+ - **page_relative_path** - Page path relative to the site URL
317
+ - **site_name** - Geb site name (either from configuration or development folder name)
318
+ - **geb_version** - Geb version number
319
+
320
+
277
321
  ## Command Reference
278
322
 
279
323
  ### geb build
@@ -23,9 +23,10 @@ module Geb
23
23
  example [" ", "--port 8080", "--skip_auto_build", "--skip_build"]
24
24
 
25
25
  # Define command options
26
- option :port, type: :int, default: 0, desc: "Port to run the server on, otherwise it will use config file setting"
26
+ option :port, type: :int, default: nil, desc: "Port to run the server on, otherwise it will use config file setting"
27
27
  option :skip_build, type: :boolean, default: false, desc: "Skip building the site before starting the server"
28
28
  option :skip_auto_build, type: :boolean, default: false, desc: "Don't automatically rebuild the site when a file changes"
29
+ option :debug, type: :boolean, default: false, desc: "Enable full output during site rebuild"
29
30
 
30
31
  # Call method for the server command
31
32
  # @param options [Hash] the options hash for the command
@@ -46,7 +47,7 @@ module Geb
46
47
  server_port = options[:port] || site.site_config.local_port || 0
47
48
 
48
49
  # initialize the server
49
- server = Geb::Server.new(site, server_port, !options[:skip_auto_build])
50
+ server = Geb::Server.new(site, server_port, !options[:skip_auto_build], options[:debug])
50
51
 
51
52
  # start the server
52
53
  server.start()
data/lib/geb/config.rb CHANGED
@@ -20,6 +20,16 @@ module Geb
20
20
  def initialize(e = ""); super(e, MESSAGE); end
21
21
  end # class ConfigFileNotFound < Geb::Error
22
22
 
23
+ class DestinationDirMissing < Geb::Error
24
+ MESSAGE = "Failed to generate configuration file, directory doesn't exist".freeze
25
+ def initialize(e = ""); super(e, MESSAGE); end
26
+ end # class DestinationDirMissing < Geb::Error
27
+
28
+ class ConfigAlreadyExists < Geb::Error
29
+ MESSAGE = "Failed to generate configuration file, it already exists".freeze
30
+ def initialize(e = ""); super(e, MESSAGE); end
31
+ end # class ConfigAlreadyExists < Geb::Error
32
+
23
33
  # check if the site directory specified has the required geb.config.yml file
24
34
  def self.site_directory_has_config?(site_path)
25
35
  File.exist?(File.join(site_path, Geb::Defaults::SITE_CONFIG_FILENAME))
@@ -42,6 +52,71 @@ module Geb
42
52
 
43
53
  end # def initialize
44
54
 
55
+ # generate the configuration file
56
+ # @param destination_directory [String] the destination directory where to generate the configuration file
57
+ # @raise DestinationDirMissing if the destination directory doesn't exist
58
+ # @raise ConfigAlreadyExists if the configuration file already exists
59
+ # @note the configuration file is generated without the following options (for security reasons):
60
+ # - site_name
61
+ # - remote_uri
62
+ # - remote_path
63
+ def generate_config_file(destination_directory)
64
+
65
+ # make sure the destination directory exists and there is no configuration file
66
+ raise DestinationDirMissing.new("Specified directory [#{destination_directory}] missing.") unless File.directory?(destination_directory)
67
+ raise ConfigAlreadyExists.new("Specified directory [#{destination_directory}] already has geb config.") if File.exist?(File.join(destination_directory, Geb::Defaults::SITE_CONFIG_FILENAME))
68
+
69
+ # initialize a new hash to store the configuration
70
+ new_config = {}
71
+
72
+ # add existing configuration to the new configuration
73
+ new_config['local_port'] = local_port if local_port
74
+ new_config['output_dir'] = output_dir unless output_dir == Geb::Defaults::OUTPUT_DIR
75
+ new_config['assets_dir'] = assets_dir unless assets_dir == Geb::Defaults::ASSETS_DIR
76
+ new_config['page_extensions'] = page_extensions unless page_extensions == Geb::Defaults::PAGE_EXTENSIONS
77
+ new_config['template_paths'] = template_paths if template_paths
78
+ new_config['template_and_partial_identifier'] = template_and_partial_identifier unless template_and_partial_identifier == Geb::Defaults::TEMPLATE_AND_PARTIAL_IDENTIFIER
79
+
80
+ # check if site variables are used
81
+ if @config['site_variables']
82
+
83
+ # initialize local and release site variables
84
+ new_config['site_variables'] = {}
85
+ new_config['site_variables']['local'] = {}
86
+ new_config['site_variables']['release'] = {}
87
+
88
+ # check if any local variables are used
89
+ new_config['site_variables']['local'] = @config['site_variables']['local'] if @config['site_variables']['local']
90
+
91
+ # check if any release variables are used, add only variable names and blank values
92
+ if @config['site_variables']['release']
93
+
94
+ # copy the local variables to the release variables, but set the values to emtpy strings
95
+ new_config['site_variables']['release'] = @config['site_variables']['release'].keys.each_with_object({}) { |key, hash| hash[key] = '' }
96
+
97
+ end # if
98
+
99
+ end # if
100
+
101
+ # write the new configuration to the destination directory
102
+ File.open(File.join(destination_directory, Geb::Defaults::SITE_CONFIG_FILENAME), 'w') do |file|
103
+
104
+ # generate configuration file header
105
+ file.write("#\n")
106
+ file.write("# Geb #{Geb::VERSION} Site Configuration\n")
107
+ file.write("# Generated by site template for #{site_name}\n")
108
+ file.write("#\n")
109
+ file.write("# For more information on the configuration options, see the fully document file at: \n")
110
+ file.write("# https://github.com/mainfram-work/geb/blob/main/lib/geb/samples/geb.config.yml\n")
111
+ file.write("#\n")
112
+
113
+ # write the new configuration to the file
114
+ file.write(new_config.to_yaml)
115
+
116
+ end # File.open
117
+
118
+ end # def generate_config_file
119
+
45
120
  # get the configured site name, if not set, use the site directory name
46
121
  # @return [String] the site name
47
122
  def site_name
@@ -99,5 +174,18 @@ module Geb
99
174
  return @config['template_paths'] || []
100
175
  end # def template_paths
101
176
 
177
+ # get the configured partial paths
178
+ # @return [Array] the partial paths
179
+ # @note the configured site variables are different depending on the environment (local or release)
180
+ def get_site_variables
181
+
182
+ # check if the site is releasing and return the site variables
183
+ environment = (@site.releasing ? 'release' : 'local')
184
+
185
+ # return the site variables for the environment
186
+ return( @config['site_variables']&.[](environment) || {}).dup
187
+
188
+ end # def get_site_variables
189
+
102
190
  end # class Config
103
191
  end # module Geb
data/lib/geb/defaults.rb CHANGED
@@ -18,7 +18,7 @@ module Geb
18
18
  # default values for site templates
19
19
  TEMPLATE_ARCHIVE_FILENAME = 'geb-template.tar.gz' # default the template archive filename
20
20
  AVAILABLE_TEMPLATES = # list of bundled templates (first one is the default template)
21
- ['bootstrap_jquery', 'basic']
21
+ ['basic', 'bootstrap_jquery']
22
22
  SITE_CONFIG_FILENAME = 'geb.config.yml' # site config file name
23
23
  HTTP_TEMPLATE_CONTENT_TYPES = # acceptable remote template content types
24
24
  ['application/x-gzip', 'application/gzip', 'application/octet-stream']
@@ -37,7 +37,7 @@ module Geb
37
37
 
38
38
  # default values for site pages
39
39
  PAGE_EXTENSIONS = # list of file extention to treat as pages
40
- ['.md', '.markdown', '.html', '.htm', '.txt', '.js', '.css']
40
+ ['.md', '.markdown', '.html', '.htm', '.txt', '.js', '.css', '.webmanifest']
41
41
  TEMPLATE_AND_PARTIAL_IDENTIFIER = /^_/ # filename pattern for templates or partials
42
42
 
43
43
  end # module Defaults
data/lib/geb/page.rb CHANGED
@@ -21,8 +21,9 @@ require 'fileutils'
21
21
  module Geb
22
22
  class Page
23
23
 
24
- # insert pattern constant
25
- INSERT_PATTERN = /<%= insert: (.*?) %>/
24
+ # variable pattern match
25
+ VARIABLE_PATTERN = /_\{(.*?)\}_/
26
+ PAGE_TITLE_PATTERN = /<title>(.*?)<\/title>/
26
27
 
27
28
  class PageFileNotFound < Geb::Error
28
29
  MESSAGE = "Page file not found".freeze
@@ -96,9 +97,10 @@ module Geb
96
97
  # initalise the new page content
97
98
  @parsed_content = @content.dup
98
99
 
99
- # parse the content for templates and partials
100
+ # parse the content for templates, partials and site variables
100
101
  @parsed_content = parse_for_templates(@parsed_content)
101
102
  @parsed_content = parse_for_partials(@parsed_content)
103
+ @parsed_content = parse_for_site_variables(@parsed_content)
102
104
 
103
105
  end # def parse
104
106
 
@@ -170,6 +172,36 @@ module Geb
170
172
 
171
173
  end # def parse_for_partials
172
174
 
175
+ # parse the content for site variables
176
+ # @param content [String] the content to parse for site variables. Default is the parsed page content.
177
+ # @return [String] the parsed content, with no site variables to parse.
178
+ # @note site variables are defined in the site configuration file
179
+ # @note site variables are matched using the VARIABLE_PATTERN
180
+ def parse_for_site_variables(content = @parsed_content)
181
+
182
+ # initialize the return parsed content
183
+ return_parsed_content = content.dup
184
+
185
+ # get the site variables, this method automatically loads release vs local variables
186
+ site_variables = @site.site_config.get_site_variables() || {}
187
+
188
+ # set the special variables
189
+ site_variables['page_relative_path'] = @path.gsub(@site.site_path, '')
190
+ site_variables['page_title'] = content.match(PAGE_TITLE_PATTERN)[1] if content.match(PAGE_TITLE_PATTERN)
191
+ site_variables['site_name'] = @site.site_config.site_name
192
+ site_variables['geb_version'] = Geb::VERSION
193
+
194
+ # find _{name}_ and replace with the site variable value
195
+ return_parsed_content.gsub!(VARIABLE_PATTERN) do |match|
196
+ key = match[2..-3] # remove _{ and }_
197
+ site_variables[key] || match
198
+ end # content.gsub!
199
+
200
+ # return the parsed content with variables handled
201
+ return return_parsed_content
202
+
203
+ end # def parse_for_site_variables
204
+
173
205
  # build the page, save it to the output folder
174
206
  # @param output_path [String] the output path
175
207
  # @raise [FailedToOutputPage] if the page could not be saved to the output folder
@@ -1,7 +1,46 @@
1
1
  BODY {
2
- background-color: #1A2D3D;
2
+ background-color: #FFFFFF;
3
3
  font-family: Arial, sans-serif;
4
4
  margin: 0;
5
5
  padding: 0;
6
- color: #fff;
6
+ color: #000000;
7
+ }
8
+
9
+ .header {
10
+ padding: 20px 10px;
11
+ border-bottom: 1px solid#9FD88D;
12
+ .header-right {
13
+ float: right;
14
+ a {
15
+ border: 1px solid #9FD88D;
16
+ border-radius: 5px;
17
+ color: #000000;
18
+ text-decoration: none;
19
+ padding: 10px;
20
+ &:hover { background-color: #9FD88D; }
21
+ }
22
+ }
23
+ }
24
+
25
+ .main {
26
+ padding: 20px;
27
+ .main-left {
28
+ float: left;
29
+ width: 40%;
30
+ padding: 10px;
31
+ }
32
+ .main-right {
33
+ float: right;
34
+ width: 60%;
35
+ img {
36
+ width: 100%;
37
+ border: 1px solid #9FD88D;
38
+ border-radius: 20px;
39
+ }
40
+ }
41
+ }
42
+
43
+ .footer {
44
+ padding-top: 20px;
45
+ clear: both;
7
46
  }
@@ -1,4 +1,3 @@
1
-
2
1
  # Geb Configuration File
3
2
  # =======================
4
3
  #
@@ -33,7 +32,7 @@
33
32
  # Set the local web server port that the site will run on.
34
33
  # Geb server command will use this port to start the local web server
35
34
  # If you don't specify a port, geb server command auto selects a port
36
- #local_port: 4000
35
+ local_port: 4000
37
36
 
38
37
  # Specifies the output directory, this directory will be used to store the output of
39
38
  # the build and release commands.
@@ -66,5 +65,22 @@
66
65
  # The site template files will be archived into geb-template.tar.gz file and put within
67
66
  # the release directory.
68
67
  # e.g. template_paths: ["assets", "shared", "*.html", "site.webmanifest"]
69
- #template_paths: []
68
+ template_paths: ['assets', '**/*.html', 'site.webmanifest', 'geb.config.yml']
69
+
70
+ # If you want to specify site variables, you can do so here. These variables will be available
71
+ # to the site as site.site_variables. You can specify different variables for different environments
72
+ # by specifying the environment name and the variables for that environment. Site variables are
73
+ # processed last, after templates and partials band can be used in pages, templates or partials.
74
+ # to use a site variable, use the syntax _{variable_name}_. If a variable is missing Geb will
75
+ # simply replace the _{tag}_ with an empty string.
76
+ # In the example below, use _{title}_ and _{site_url}_ in your pages, templates or partials.
77
+ # Geb will use local or release version depending if you are running the build or release command.
78
+ # Geb has the following site variables by default: page_relative_path, site_name, geb_version, page_title
79
+ site_variables:
80
+ local:
81
+ title: "My Local Site"
82
+ site_url: "http://localhost:4000"
83
+ release:
84
+ title: "My Site"
85
+ site_url: "https://example.com"
70
86
 
@@ -6,6 +6,29 @@ This is a website title
6
6
 
7
7
  <% start: content %>
8
8
 
9
- <p>Welcome to the site</p>
9
+ <!-- Main area, two by one, auto resize, no bootstrap -->
10
+ <div class="main">
11
+ <div class="main-left">
12
+ <h1>gem install <highlight>geb</highlight></h1>
13
+ <p>Build, manage and share static websites and templates, all hail geb the great.</p>
14
+ <p>
15
+ <a href="https://github.com/mainfram-work/geb.git" target="_blank">Github Repo</a><br />
16
+ <a href="https://rubygems.org/gems/geb" target="_blank">Ruby Gems</a
17
+ </p>
18
+ <p>
19
+ <small>
20
+ Geb, draws a symbolic connection to the ancient Egyptian god Geb, the deity of the Earth.
21
+ Just as Geb the god provides a stable foundation for the world, software Geb offers a robust
22
+ and essential foundation for building and managing static websites, which are the very bedrock
23
+ of the web.
24
+ </small>
25
+ </p>
26
+ </div>
27
+ <div class="main-right">
28
+ <img src="/assets/images/hero.png" alt="...">
29
+ </div>
30
+ </div>
31
+
32
+
10
33
 
11
34
  <% end: content %>
@@ -1,3 +1,7 @@
1
1
 
2
2
  <!-- Bootstrap Bundle -->
3
3
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
4
+
5
+ <div class="footer">
6
+ <%= partial: shared/partials/_geb.html %>
7
+ </div>
@@ -0,0 +1,26 @@
1
+
2
+ <style>
3
+ .geb-footer {
4
+ display: flex; flex-direction: column; justify-content: center; gap: 1rem; margin-top: 1rem; margin-bottom: 2rem;
5
+ .geb-badge-container { display: flex; justify-content: center; gap: 1rem; }
6
+ a { text-decoration: none; color: inherit; border: none; img { cursor: pointer; } }
7
+ code { width: auto; display: none; margin: 1rem auto 0; background-color: #f8f9fa; padding: 0.3rem; border-radius: 0.25rem; font-size: 0.7rem;}
8
+ }
9
+ </style>
10
+ <script>
11
+ function toggle_geb_code() {
12
+ const code = document.querySelector('.geb-footer code');
13
+ code.innerHTML = code.innerHTML.replace('[site_url]', window.location.origin);
14
+ code.style.display = code.style.display === 'none' ? 'block' : 'none';
15
+ window.scrollTo(0, document.body.scrollHeight);
16
+ }
17
+ </script>
18
+ <div class="geb-footer">
19
+ <div class="geb-badge-container">
20
+ <a href="https://github.com/mainfram-work/geb" target="_blank"><img src="https://img.shields.io/badge/built_with-geb-9FD88D" alt="Built with Geb" /></a>
21
+ <a href="javascript:toggle_geb_code()"><img src="https://img.shields.io/badge/geb-site_template_available-9FD88D" alt="Geb Site Template Available" /></a>
22
+ </div>
23
+ <code style="display: none;">
24
+ $ gem install geb<br />$ geb init new_site --template [site_url]
25
+ </code>
26
+ </div>
@@ -0,0 +1,9 @@
1
+
2
+ <div class="header">
3
+ <img src="/assets/images/apple-touch-icon.png" alt="" width="32" height="32" class="d-inline-block">
4
+ <strong>Sample Site</strong> <small>(basic)</small>
5
+ <div class="header-right">
6
+ <a href="/index.html">Home</a>
7
+ <a href="/page.html">Sample Page</a>
8
+ </div>
9
+ </div>
@@ -1,7 +1,74 @@
1
1
  BODY {
2
- background-color: #1A2D3D;
2
+ background-color: #1A2D3D !important;
3
3
  font-family: Arial, sans-serif;
4
4
  margin: 0;
5
5
  padding: 0;
6
6
  color: #fff;
7
+ }
8
+
9
+ nav {
10
+ background-color: #9FD88D;;
11
+ color: #1A2D3D;
12
+ padding: 10px;
13
+ .nav-link,a { color: #000000; }
14
+ }
15
+
16
+ .hero-image {
17
+ border: 10px solid #9FD88D;
18
+ border-radius: 100%;
19
+ }
20
+
21
+ highlight {
22
+ color: #9FD88D;
23
+ font-weight: bold;
24
+ }
25
+
26
+ .lead {
27
+ color: lightgrey;
28
+ font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
29
+ font-weight: bold;
30
+ }
31
+
32
+ .navbar-toggler {
33
+ border-color: transparent;
34
+ }
35
+ .navbar-toggler-icon {
36
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(26, 45, 61, 1)' stroke-width='2' linecap='round' linejoin='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
37
+ }
38
+
39
+ .nav-tabs {
40
+ border-bottom: 0px;
41
+ margin-bottom: 30px;
42
+ .nav-item { margin: 0px 10px; }
43
+ .nav-link { color: #9FD88D; }
44
+ .active {
45
+ background-color: #9FD88D !important;
46
+ }
47
+ }
48
+
49
+ .code-block {
50
+ background-color: #121F2A; /* Light grey background */
51
+ border: 1px solid #dee2e6; /* Light border */
52
+ border-radius: 0.25rem; /* Rounded corners */
53
+ padding: 1rem; /* Padding */
54
+ overflow-x: auto; /* Horizontal scrolling for long lines */
55
+ margin: 10px 5px;
56
+ a { text-decoration: none; }
57
+ }
58
+ .code-block code {
59
+ color: #d63384; /* Text color */
60
+ }
61
+
62
+ .prompt {
63
+ color: #6D1A43; /* Prompt color (blue) */
64
+ font-weight: bold;
65
+ }
66
+
67
+ .output {
68
+ color: #6c757d; /* Output color (grey) */
69
+ }
70
+
71
+ .comment {
72
+ color: #6a737d; /* Comment color (grey) */
73
+ font-style: italic; /* Italicize comments */
7
74
  }