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
@@ -6,30 +6,88 @@ Blog Post 1
6
6
 
7
7
  <% start: content %>
8
8
 
9
- <h1>Blog Post 1 Title</h1>
10
-
11
- <p class="lead">
12
- This is the first blog post. It is very interesting and you should read it.
13
- </p>
14
-
15
- <p>
16
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac purus nec
17
- libero ultrices ultricies. Nullam nec nunc nec nunc ultricies ultricies. Ut
18
- eget nunc nec nunc ultricies ultricies. Ut eget nunc nec nunc ultricies
19
- ultricies. Ut eget nunc nec nunc ultricies ultricies. Ut eget nunc nec nunc
20
- ultricies ultricies. Ut eget nunc nec nunc ultricies ultricies. Ut eget nunc
21
- nec nunc ultricies ultricies. Ut eget nunc nec nunc ultricies ultricies. Ut
22
- eget nunc nec nunc ultricies ultricies. Ut eget nunc nec nunc ultricies
23
- </p>
24
-
25
- <p>
26
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac purus nec
27
- libero ultrices ultricies. Nullam nec nunc nec nunc ultricies ultricies. Ut
28
- eget nunc nec nunc ultricies ultricies. Ut eget nunc nec nunc ultricies
29
- ultricies. Ut eget nunc nec nunc ultricies ultricies. Ut eget nunc nec nunc
30
- ultricies ultricies. Ut eget nunc nec nunc ultricies ultricies. Ut eget nunc
31
- nec nunc ultricies ultricies. Ut eget nunc nec nunc ultricies ultricies. Ut
32
- eget nunc nec nunc ultricies ultricies. Ut eget nunc nec nunc ultricies
33
- </p>
9
+ <main class="container mt-5">
34
10
 
11
+
12
+ <div class="row g-5">
13
+ <div class="col-md-8">
14
+
15
+ <article class="blog-post">
16
+ <h2 class="blog-post-title">Sample blog post</h2>
17
+ <p class="blog-post-meta">January 1, 2021 by <a href="#">Mark</a></p>
18
+
19
+ <p>This blog post shows a few different types of content that’s supported and styled with Bootstrap. Basic typography, lists, tables, images, code, and more are all supported as expected.</p>
20
+ <hr>
21
+ <p>This is some additional paragraph placeholder content. It has been written to fill the available space and show how a longer snippet of text affects the surrounding content. We'll repeat it often to keep the demonstration flowing, so be on the lookout for this exact same string of text.</p>
22
+ <h2>Blockquotes</h2>
23
+ <p>This is an example blockquote in action:</p>
24
+ <blockquote class="blockquote">
25
+ <p>Quoted text goes here.</p>
26
+ </blockquote>
27
+ <p>This is some additional paragraph placeholder content. It has been written to fill the available space and show how a longer snippet of text affects the surrounding content. We'll repeat it often to keep the demonstration flowing, so be on the lookout for this exact same string of text.</p>
28
+ <h3>Example lists</h3>
29
+ <p>This is some additional paragraph placeholder content. It's a slightly shorter version of the other highly repetitive body text used throughout. This is an example unordered list:</p>
30
+ <ul>
31
+ <li>First list item</li>
32
+ <li>Second list item with a longer description</li>
33
+ <li>Third list item to close it out</li>
34
+ </ul>
35
+ <p>And this is an ordered list:</p>
36
+ <ol>
37
+ <li>First list item</li>
38
+ <li>Second list item with a longer description</li>
39
+ <li>Third list item to close it out</li>
40
+ </ol>
41
+ <p>And this is a definiton list:</p>
42
+ <dl>
43
+ <dt>HyperText Markup Language (HTML)</dt>
44
+ <dd>The language used to describe and define the content of a Web page</dd>
45
+ <dt>Cascading Style Sheets (CSS)</dt>
46
+ <dd>Used to describe the appearance of Web content</dd>
47
+ <dt>JavaScript (JS)</dt>
48
+ <dd>The programming language used to build advanced Web sites and applications</dd>
49
+ </dl>
50
+ <h2>Inline HTML elements</h2>
51
+ <p>HTML defines a long list of available inline tags, a complete list of which can be found on the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element">Mozilla Developer Network</a>.</p>
52
+ <ul>
53
+ <li><strong>To bold text</strong>, use <code class="language-plaintext highlighter-rouge">&lt;strong&gt;</code>.</li>
54
+ <li><em>To italicize text</em>, use <code class="language-plaintext highlighter-rouge">&lt;em&gt;</code>.</li>
55
+ <li>Abbreviations, like <abbr title="HyperText Markup Langage">HTML</abbr> should use <code class="language-plaintext highlighter-rouge">&lt;abbr&gt;</code>, with an optional <code class="language-plaintext highlighter-rouge">title</code> attribute for the full phrase.</li>
56
+ <li>Citations, like <cite>— Mark Otto</cite>, should use <code class="language-plaintext highlighter-rouge">&lt;cite&gt;</code>.</li>
57
+ <li><del>Deleted</del> text should use <code class="language-plaintext highlighter-rouge">&lt;del&gt;</code> and <ins>inserted</ins> text should use <code class="language-plaintext highlighter-rouge">&lt;ins&gt;</code>.</li>
58
+ <li>Superscript <sup>text</sup> uses <code class="language-plaintext highlighter-rouge">&lt;sup&gt;</code> and subscript <sub>text</sub> uses <code class="language-plaintext highlighter-rouge">&lt;sub&gt;</code>.</li>
59
+ </ul>
60
+ <p>Most of these elements are styled by browsers with few modifications on our part.</p>
61
+ <h2>Heading</h2>
62
+ <p>This is some additional paragraph placeholder content. It has been written to fill the available space and show how a longer snippet of text affects the surrounding content. We'll repeat it often to keep the demonstration flowing, so be on the lookout for this exact same string of text.</p>
63
+ <h3>Sub-heading</h3>
64
+ <p>This is some additional paragraph placeholder content. It has been written to fill the available space and show how a longer snippet of text affects the surrounding content. We'll repeat it often to keep the demonstration flowing, so be on the lookout for this exact same string of text.</p>
65
+ <pre><code>Example code block</code></pre>
66
+ <p>This is some additional paragraph placeholder content. It's a slightly shorter version of the other highly repetitive body text used throughout.</p>
67
+ </article>
68
+
69
+
70
+ </div>
71
+
72
+ <div class="col-md-4">
73
+ <div class="position-sticky" style="top: 2rem;">
74
+ <div class="p-4 mb-3 bg-dark rounded">
75
+ <h4 class="fst-italic">Just Becasue</h4>
76
+ <p class="mb-0">Something interesting should go here. May the Geb bring you sites.</p>
77
+ </div>
78
+
79
+
80
+ <div class="p-4">
81
+ <h4 class="fst-italic">Elsewhere</h4>
82
+ <ol class="list-unstyled">
83
+ <li><a href="#">GitHub</a></li>
84
+ <li><a href="#">Twitter</a></li>
85
+ <li><a href="#">Facebook</a></li>
86
+ </ol>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+
92
+ </main>
35
93
  <% end: content %>
@@ -6,12 +6,45 @@ Blog
6
6
 
7
7
  <% start: content %>
8
8
 
9
- <h1>Welcome to the Blog</h1>
9
+ <main class="container mt-5">
10
+ <div class="row p-4 p-md-5 mb-4 text-white rounded bg-dark">
11
+ <div class="col-md-6 px-3">
12
+ <h1 class="display-4 fst-italic">Title of a featured blog post</h1>
13
+ <p class="lead my-3">Multiple lines of text that form the lede, informing new readers quickly and efficiently about what’s most interesting in this post’s contents.</p>
14
+ <p class="lead mb-0"><a href="/blog/blog_post_1.html" class="text-white fw-bold">Continue reading...</a></p>
15
+ </div>
16
+ <div class="col-md-6 px-3">
17
+ <img class="img-fluid" src="/assets/images/hero.png" alt="">
18
+ </div>
19
+ </div>
10
20
 
11
- <ul>
12
- <li><a href="blog_post_1.html">First Blog Post</a></li>
13
- <li><a href="blog_post_2.html">Second Blog Post</a></li>
14
- <li><a href="blog_post_3.html">Third Blog Post</a></li>
15
- </ul>
21
+ <div class="row mb-2">
22
+ <div class="col-md-6">
23
+ <div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
24
+ <div class="col p-4 d-flex flex-column position-static">
25
+ <strong class="d-inline-block mb-2">Best Category</strong>
26
+ <h3 class="mb-0">Another Post We Wrote</h3>
27
+ <div class="mb-1 text-muted">July 7</div>
28
+ <p class="card-text mb-auto">Some short content, you get the point</p>
29
+ <a href="/blog/blog_post_1.html" class="stretched-link">Continue reading</a>
30
+ </div>
31
+ </div>
32
+ </div>
16
33
 
34
+ <div class="col-md-6">
35
+ <div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
36
+ <div class="col p-4 d-flex flex-column position-static">
37
+ <strong class="d-inline-block mb-2 text-success">Super Interesting</strong>
38
+ <h3 class="mb-0">Yet Another Post</h3>
39
+ <div class="mb-1 text-muted">Nov 11</div>
40
+ <p class="card-text mb-auto">Some more short content, to wet your appetite.</p>
41
+ <a href="/blog/blog_post_1.html" class="stretched-link">Continue reading</a>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+
47
+
48
+
49
+ </main>
17
50
  <% end: content %>
@@ -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,4 +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: ["assets", "shared", "*.html", "site.webmanifest", "geb.config.yml"]
68
+ template_paths: ['assets', 'shared', '**/*.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"
86
+
@@ -1,11 +1,261 @@
1
1
  <% template: shared/templates/_site.html %>
2
2
 
3
3
  <% start: title %>
4
- This is a website title
4
+ Sample Site - (bootstrap 5 & jquery 3.6.0)
5
5
  <% end: title %>
6
6
 
7
7
  <% start: content %>
8
8
 
9
- <p>Welcome to the site</p>
9
+ <div class="container px-5 mt-5 mb-5">
10
+ <div class="row gx-5 align-items-center">
11
+ <div class="col-lg-6">
12
+ <img src="/assets/images/hero.png" class="img-fluid hero-image" alt="...">
13
+ </div>
14
+ <div class="col-lg-6">
15
+ <!-- Mashead text and app badges-->
16
+ <div class="mb-5 mb-lg-0 text-center text-lg-start">
17
+ <h1 class="display-4 lh-1 mb-3 mt-5">gem install <highlight>geb</highlight></h1>
18
+ <p class="lead fw-normal text-white mb-5">Build, manage and share static websites and templates, all hail geb the great</p>
19
+ <div class="d-flex flex-column flex-lg-row align-items-center">
20
+ <a class="btn btn-success me-lg-3 mb-4 mb-lg-0" href="https://github.com/mainfram-work/geb.git" target="_blank" role="button"><i class="bi bi-github"></i> Github Repo</a>
21
+ <a class="btn btn-success me-lg-3 mb-4 mb-lg-0" href="https://rubygems.org/gems/geb" target="_blank" role="button">
22
+ <svg width="18px" height="18px" viewBox="-18.5 0 293 293" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
23
+ <g fill="#FFFFFF">
24
+ <path d="M76.7478977,97.4337652 L76.585237,97.2711045 L40.4745594,133.381782 L128.148682,220.893244 L164.25936,184.945227 L215.822805,133.381782 L179.712127,97.2711045 L179.712127,97.1084438 L76.585237,97.1084438 L76.7478977,97.4337652 Z"></path>
25
+ <path d="M127.823361,0.975964259 L0.1347034,74.1732837 L0.1347034,220.567923 L127.823361,293.765242 L255.512018,220.567923 L255.512018,74.1732837 L127.823361,0.975964259 L127.823361,0.975964259 Z M231.112911,206.579102 L127.823361,266.112921 L24.5338099,206.579102 L24.5338099,87.8367833 L127.823361,28.3029635 L231.112911,87.8367833 L231.112911,206.579102 L231.112911,206.579102 Z"></path>
26
+ </g>
27
+ </svg>
28
+ Rubygems
29
+ </a>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
10
35
 
36
+ <div class="lead m-5">
37
+ <p class="m-2">
38
+ Geb, draws a symbolic connection to the ancient Egyptian god Geb, the deity of the Earth.
39
+ Just as Geb the god provides a stable foundation for the world, software Geb offers a robust
40
+ and essential foundation for building and managing static websites, which are the very bedrock
41
+ of the web.
42
+ </p>
43
+ </div>
44
+
45
+ <div class="container">
46
+ <ul class="nav nav-tabs bg-transparent " id="myTab" role="tablist">
47
+ <li class="nav-item" role="presentation">
48
+ <button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#installation" type="button" role="tab" aria-controls="home" aria-selected="true">Installation</button>
49
+ </li>
50
+ <li class="nav-item" role="presentation">
51
+ <button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#workflow" type="button" role="tab" aria-controls="profile" aria-selected="false">Typical Workflow</button>
52
+ </li>
53
+ <li class="nav-item" role="presentation">
54
+ <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#templates" type="button" role="tab" aria-controls="contact" aria-selected="false">Working With Site Templates</button>
55
+ </li>
56
+ <li class="nav-item" role="presentation">
57
+ <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#sitestructure" type="button" role="tab" aria-controls="contact" aria-selected="false">Site Structure</button>
58
+ </li>
59
+ <li class="nav-item" role="presentation">
60
+ <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#pagestemplatespartials" type="button" role="tab" aria-controls="contact" aria-selected="false">Pages, Templates and Partials</button>
61
+ </li>
62
+ </ul>
63
+ <div class="tab-content" id="myTabContent">
64
+ <div class="tab-pane fade show active" id="installation" role="tabpanel" aria-labelledby="home-tab">
65
+ <a name="installation"></a>
66
+ <pre class="code-block mb-5">
67
+ <h4>Installation</h4>
68
+ <code>
69
+ <span class="comment"># as simple as installing a ruby gem</span>
70
+ <span class="prompt">$</span> gem <strong>install</strong> geb
71
+
72
+ <span class="comment"># installing from source is just as simple</span>
73
+ <span class="prompt">$</span> <strong>git</strong> clone https://github.com/mainfram-work/geb.git
74
+ <span class="prompt">$</span> <strong>cd</strong> geb
75
+ <span class="prompt">$</span> <strong>bundle</strong> install
76
+ <span class="prompt">$</span> <strong>rake</strong> test
77
+ <span class="prompt">$</span> <strong>rake</strong> build
78
+ <span class="prompt">$</span> <strong>rake</strong> install
79
+
80
+ <span class="comment"># list all available geb commands and get help for each individual geb command</span>
81
+ <span class="prompt">$</span> geb <strong>help</strong>
82
+ <span class="prompt">$</span> geb &lt;command&gt; <strong>help</strong>
83
+ </code>
84
+ </pre>
85
+ </div>
86
+ <div class="tab-pane fade" id="workflow" role="tabpanel" aria-labelledby="profile-tab">
87
+ <a name="typical_workflow"></a>
88
+ <pre class="code-block mb-5">
89
+ <h4>Typical <strong>Workflow</strong></h4>
90
+ <code>
91
+ <span class="comment"># initialize a new site in the directory nexthing</span>
92
+ <span class="prompt">$</span> geb <strong>init</strong> nexthing
93
+ <span class="prompt">$</span> cd nexthing
94
+
95
+ <span class="comment"># build the site</span>
96
+ <span class="prompt">$</span> geb <strong>build</strong>
97
+
98
+ <span class="comment"># start a local web server to access your built site</span>
99
+ <span class="prompt">$</span> geb <strong>server</strong>
100
+
101
+ <span class="comment"># build a release version of the site</span>
102
+ <span class="prompt">$</span> geb <strong>release</strong>
103
+
104
+ <span class="comment"># upload the released site to your remote server</span>
105
+ <span class="prompt">$</span> geb <strong>upload</strong>
106
+ </code>
107
+ </pre>
108
+ </div>
109
+ <div class="tab-pane fade" id="templates" role="tabpanel" aria-labelledby="contact-tab">
110
+ <a name="site_templates"></a>
111
+ <pre class="code-block mb-5">
112
+ <h4>Working with <strong>site templates</strong></h4>
113
+ <code>
114
+ <span class="comment"># get started with one of the built in templates (full list on our <a href="#"><i class="bi bi-github"></i> github page</a>)</span>
115
+ <span class="prompt">$</span> geb <strong>init</strong> nexthing --template <strong>bootstrap_jquery</strong>
116
+ <span class="prompt">$</span> cd nexthing
117
+
118
+ <span class="comment"># create a template from your own site, it will upload with the rest of your site</span>
119
+ <span class="prompt">$</span> geb <strong>release</strong> --with_template
120
+
121
+ <span class="comment"># you can initialize new projects based on your previous projects</span>
122
+ <span class="prompt">$</span> geb <strong>init</strong> nexthing --template /path/to/some/other/site
123
+
124
+ <span class="comment"># you can also initialize new projects using other people's deployed templates</span>
125
+ <span class="prompt">$</span> geb <strong>init</strong> nexthing --template https://www.example.com/
126
+ </code>
127
+ </pre>
128
+ </div>
129
+ <div class="tab-pane fade" id="sitestructure" role="tabpanel" aria-labelledby="home-tab">
130
+ <pre class="code-block mb-5">
131
+ <h4>Site Structure, some basics</h4>
132
+ You can structure geb sites how ever you want.
133
+ Here is a default structure that is created when you initialize a new site with geb.
134
+ The structure below is for the site you are currently viewing.
135
+ There are several files and directories required by geb that are <code>highlighted</code>
136
+
137
+ ├── <code>assets</code> # assets directory for images, css, js, etc.
138
+ ├── images <span class="comment"># images directory</span>
139
+ ├── css <span class="comment"># css directory</span>
140
+ ├── js <span class="comment"># js directory</span>
141
+ ├── blog <span class="comment"># just a directory to hold blog posts </span>
142
+ ├── blog_post_1.html <span class="comment"># a sample blog post</span>
143
+ ├── index.html <span class="comment"># the blog index page</span>
144
+ ├── <code>geb.config.yml</code> # the site configuration file
145
+ ├── index.html <span class="comment"># site index pag, this page</span>
146
+ ├── page.html <span class="comment"># another page</span>
147
+ ├── <code>output</code> # the directory where the built site is output
148
+ ├── <code>local</code> # local build directory, this is where site is serverd from
149
+ ├── <code>release</code> # release build directory, this is we you would upload to a remote server
150
+ ├── shared <span class="comment"># shared directory for partials, templates, etc.</span>
151
+ ├── partials <span class="comment"># partials directory</span>
152
+ ├── _analytics.html <span class="comment"># partial with site analytics</span>
153
+ ├── _footer.html <span class="comment"># footer partial</span>
154
+ ├── _global_assets.html <span class="comment"># global assets partial (js and css references)</span>
155
+ ├── _header.html <span class="comment"># header partial</span>
156
+ ├── _meta_tags.html <span class="comment"># site mata tags partial</span>
157
+ ├── templates <span class="comment"># templates directory</span>
158
+ ├── _blog_post.html <span class="comment"># template for blog pages</span>
159
+ ├── _site.html <span class="comment"># template for general site pages</span>
160
+ ├── site.webmanifest <span class="comment"># site webmanifest file</span>
161
+
162
+ Files that start with _ are partials or templates and are not meant to be served directly.
163
+ You won't see these files in the output directory.
164
+
165
+ All references to assets (images, css, js, etc.) as well as links should be
166
+ <code>relative to the site root.</code>
167
+
168
+ It is possible to configure geb to use different directories for assets or output.
169
+ However, geb.config.yml must be updated to reflect these changes and located
170
+ in the site root. Check geb.config.yml for more information.
171
+
172
+ The rest is up to you. We like the convention of putting partials and templates in the
173
+ shared directory, but you can put them anywhere. You can create any directory structure
174
+ that makes sense for your site.
175
+
176
+ </pre>
177
+ </div>
178
+ <div class="tab-pane fade" id="pagestemplatespartials" role="tabpanel" aria-labelledby="home-tab">
179
+ <pre class="code-block mb-5">
180
+ <h4>Pages, Templates and Partials</h4>
181
+ Below are some examples of how to use pages, templates and partials with geb.
182
+ Read the examples, discussion is after the examples.
183
+ <hr>
184
+ <h5>Page Example <small><span class="comment">(e.g. /index.html)</span></small></h5>
185
+ <code>&lt;% template: shared/templates/_site.html %&gt;</code>
186
+
187
+ <code>&lt;% start: title %&gt;</code>
188
+ Page Title
189
+ <code>&lt;% end: title %&gt;</code>
190
+
191
+ <code>&lt;% start: content %&gt;</code>
192
+ This is page content
193
+ <code>&lt;% partial: shared/partials/_featured_product.html %&gt;</code>
194
+ <code>&lt;% end: content %&gt;</code>
195
+
196
+ <h5>Template Example <small><span class="comment">(e.g. /shared/templates/_site.html)</span></small></h5>
197
+ <code>&lt;% template: shared/templates/_site.html %&gt;</code>
198
+
199
+ &lt;!DOCTYPE html&gt;
200
+ &lt;html&gt;
201
+ &lt;head&gt;
202
+ &lt;title&gt;<code>&lt;% insert: title %&gt;</code>&lt;/title&gt;
203
+ &lt;% partial: shared/partials/_analytics.html %&gt;
204
+ &lt;% partial: shared/partials/_meta_tags.html %&gt;
205
+ &lt;% partial: shared/partials/_global_assets.html %&gt;
206
+ &lt;/head&gt;
207
+ &lt;body&gt;
208
+ &lt;% partial: shared/partials/_header.html %&gt;
209
+ <code>&lt;% insert: content %&gt;</code>
210
+ &lt;% partial: shared/partials/_footer.html %&gt;
211
+ &lt;/body&gt;
212
+ &lt;/html&gt;
213
+
214
+ <h5>Partial Example <small><span class="comment">(e.g. /shared/partials/_featued_product.html)</span></small></h5>
215
+ &lt;h1&gt;Best Product Ever&lt;h1&gt;
216
+ &lt;p&gt;This is the best product ever&lt;/p&gt;
217
+ <code>&lt;% partial: shared/partials/_product_analytics.html %&gt;</code>
218
+
219
+ <h5>Result Page</h5>
220
+ &lt;!DOCTYPE html&gt;
221
+ &lt;html&gt;
222
+ &lt;head&gt;
223
+ &lt;title&gt;Page Title&lt;/title&gt;
224
+ <span class="comment">&lt;!-- content from shared/partials/_analytics.html --&gt;</span>
225
+ <span class="comment">&lt;!-- content from shared/partials/_meta_tags.html --&gt;</span>
226
+ <span class="comment">&lt;!-- content from shared/partials/_global_assets.html --&gt;</span>
227
+ &lt;/head&gt;
228
+ &lt;body&gt;
229
+ <span class="comment">&lt;!-- content from shared/partials/_header.html --&gt;</span>
230
+ This is page content
231
+ &lt;h1&gt;Best Product Ever&lt;h1&gt;
232
+ &lt;p&gt;This is the best product ever&lt;/p&gt;
233
+ <span class="comment">&lt;!-- content from shared/partials/_product_analytics.html --&gt;</span>
234
+ <span class="comment">&lt;!-- content from shared/partials/_footer.html --&gt;</span>
235
+ &lt;/body&gt;
236
+ &lt;/html&gt;
237
+ <hr>
238
+ - Pages are the actual content of the site. They are the only files that are served directly.
239
+ - Example page above uses a template found in /shared/templates/_site.html
240
+ - Templates are used to wrap pages in a common structure. They are not served directly.
241
+ - Example template above has two content blocks, title and content.
242
+ - Page above has those content areas filled in what ever is required
243
+ - Page <code>start: what_ever_name</code> and template <code>insert: what_ever_name</code> must have matching "names"
244
+ - If a page uses a template, the template must be defined at the top of the page.
245
+ - If a page uses a template, any content not in a "start: what_ever_name" -> "end: what_ever_name" block is ignored.
246
+ - Obviously, the "start: what_ever_name" -> "end: what_ever_name" must have matching "names"
247
+ - Partials are used to include common content in pages and templates. They are not served directly.
248
+ - Partials can be nested, but be careful not to create circular references.
249
+ - Thats about it... happy coding!
250
+ </pre>
251
+ </div>
252
+ </div>
253
+ </div>
254
+
255
+
256
+
257
+
258
+
259
+
260
+
11
261
  <% end: content %>
@@ -5,7 +5,29 @@ This is another page
5
5
  <% end: title %>
6
6
 
7
7
  <% start: content %>
8
-
9
- <p>Welcome to the other page</p>
8
+ <div class="px-4 py-5 my-5 text-center">
9
+ <img class="d-block mx-auto mb-4" src="/assets/images/hero.png" alt="" width="200" height="200">
10
+ <h1 class="display-5 fw-bold text-body-emphasis">All hail GEB the great</h1>
11
+ <div class="col-lg-6 mx-auto">
12
+ <p class="lead mb-4">
13
+ Geb, draws a symbolic connection to the ancient Egyptian god Geb, the deity of the Earth.
14
+ Just as Geb the god provides a stable foundation for the world, software Geb offers a robust
15
+ and essential foundation for building and managing static websites, which are the very bedrock
16
+ of the web.
17
+ </p>
18
+ <div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
19
+ <a class="btn btn-lg btn-primary me-lg-3 mb-4 mb-lg-0" href="https://github.com/mainfram-work/geb.git" target="_blank" role="button"><i class="bi bi-github"></i> Github Repo</a>
20
+ <a class="btn btn-lg btn-outline-primary me-lg-3 mb-4 mb-lg-0 text-white" href="#" role="button">
21
+ <svg width="18px" height="18px" viewBox="-18.5 0 293 293" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
22
+ <g fill="#FFFFFF">
23
+ <path d="M76.7478977,97.4337652 L76.585237,97.2711045 L40.4745594,133.381782 L128.148682,220.893244 L164.25936,184.945227 L215.822805,133.381782 L179.712127,97.2711045 L179.712127,97.1084438 L76.585237,97.1084438 L76.7478977,97.4337652 Z"></path>
24
+ <path d="M127.823361,0.975964259 L0.1347034,74.1732837 L0.1347034,220.567923 L127.823361,293.765242 L255.512018,220.567923 L255.512018,74.1732837 L127.823361,0.975964259 L127.823361,0.975964259 Z M231.112911,206.579102 L127.823361,266.112921 L24.5338099,206.579102 L24.5338099,87.8367833 L127.823361,28.3029635 L231.112911,87.8367833 L231.112911,206.579102 L231.112911,206.579102 Z"></path>
25
+ </g>
26
+ </svg>
27
+ Rubygems
28
+ </a>
29
+ </div>
30
+ </div>
31
+ </div>
10
32
 
11
33
  <% end: content %>
@@ -1,3 +1,5 @@
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
+ <%= partial: shared/partials/_geb.html %>
@@ -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,25 @@
1
+ <nav class="navbar navbar-expand-lg">
2
+ <div class="container-fluid">
3
+ <a class="navbar-brand" href="/">
4
+ <img src="/assets/images/apple-touch-icon.png" alt="" width="32" height="32" class="d-inline-block">
5
+ <strong>Sample Site</strong> <small>(bootstrap 5 & jquery 3.6.0)</small>
6
+ </a>
7
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
8
+ <span class="navbar-toggler-icon"></span>
9
+ </button>
10
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
11
+ <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
12
+ <li class="nav-item">
13
+ <a class="nav-link active" aria-current="page" href="/index.html">Home</a>
14
+ </li>
15
+ <li class="nav-item">
16
+ <a class="nav-link" href="/page.html">Sample Page</a>
17
+ </li>
18
+ <li class="nav-item">
19
+ <a class="nav-link" href="/blog/index.html">Blog</a>
20
+ </li>
21
+ </ul>
22
+ </div>
23
+ </div>
24
+ </nav>
25
+
@@ -17,7 +17,7 @@
17
17
 
18
18
  <!-- Site manifest -->
19
19
  <link rel="canonical" href="_{site_url}_/_{relative_path}_" />
20
- <link rel="manifest" type="image/png" href="/site.webmanifest" />
20
+ <link rel="manifest" type="image/png" href="_{site_url}_/site.webmanifest" />
21
21
 
22
22
  <!-- Open Graph -->
23
23
  <meta property="og:type" content="website" />
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+
5
+ <title><%= insert: title %></title>
6
+
7
+ <%= partial: shared/partials/_analytics.html %>
8
+ <%= partial: shared/partials/_meta_tags.html %>
9
+ <%= partial: shared/partials/_global_assets.html %>
10
+
11
+ </head>
12
+ <body>
13
+
14
+ <%= partial: shared/partials/_header.html %>
15
+ <%= insert: content %>
16
+ <%= partial: shared/partials/_footer.html %>
17
+
18
+ </body>
19
+ </html>
@@ -1 +1 @@
1
- {"name":"","short_name":"","icons":[{"src":"/assets/images/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/assets/images/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
1
+ {"name":"","short_name":"","icons":[{"src":"_{site_url}_/assets/images/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"_{site_url}_/assets/images/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
@@ -67,4 +67,21 @@
67
67
  # the release directory.
68
68
  # e.g. template_paths: ["assets", "shared", "*.html", "site.webmanifest"]
69
69
  #template_paths: []
70
+
71
+ # If you want to specify site variables, you can do so here. These variables will be available
72
+ # to the site as site.site_variables. You can specify different variables for different environments
73
+ # by specifying the environment name and the variables for that environment. Site variables are
74
+ # processed last, after templates and partials band can be used in pages, templates or partials.
75
+ # to use a site variable, use the syntax _{variable_name}_. If a variable is missing Geb will
76
+ # simply replace the _{tag}_ with an empty string.
77
+ # In the example below, use _{title}_ and _{site_url}_ in your pages, templates or partials.
78
+ # Geb will use local or release version depending if you are running the build or release command.
79
+ # Geb has the following site variables by default: page_relative_path, site_name, geb_version, page_title
80
+ #site_variables:
81
+ # local:
82
+ # title: "My Local Site"
83
+ # site_url: "http://localhost:4000"
84
+ # release:
85
+ # title: "My Site"
86
+ # site_url: "https://example.com"
70
87