Skip to content

Commit 171918e

Browse files
author
Phillip Webb
committed
Initialize shared gh-pages infrastructure
0 parents  commit 171918e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+35217
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#*
2+
.#*
3+
*~
4+
_site
5+
.idea
6+
*.sw?
7+
.project
8+
sample-pages

.ruby-gemset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
spring-gh-pages

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby-1.9.3

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "http://rubygems.org"
2+
3+
gem "github-pages"

Gemfile.lock

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
GEM
2+
remote: http://rubygems.org/
3+
specs:
4+
RedCloth (4.2.9)
5+
classifier (1.3.3)
6+
fast-stemmer (>= 1.0.0)
7+
colorator (0.1)
8+
commander (4.1.5)
9+
highline (~> 1.6.11)
10+
directory_watcher (1.4.1)
11+
fast-stemmer (1.0.2)
12+
github-pages (1)
13+
RedCloth (= 4.2.9)
14+
jekyll (= 1.1.2)
15+
kramdown (= 1.0.2)
16+
liquid (= 2.5.1)
17+
maruku (= 0.6.1)
18+
rdiscount (= 1.6.8)
19+
redcarpet (= 2.2.2)
20+
highline (1.6.19)
21+
jekyll (1.1.2)
22+
classifier (~> 1.3)
23+
colorator (~> 0.1)
24+
commander (~> 4.1.3)
25+
directory_watcher (~> 1.4.1)
26+
kramdown (~> 1.0.2)
27+
liquid (~> 2.5.1)
28+
maruku (~> 0.5)
29+
pygments.rb (~> 0.5.0)
30+
redcarpet (~> 2.2.2)
31+
safe_yaml (~> 0.7.0)
32+
kramdown (1.0.2)
33+
liquid (2.5.1)
34+
maruku (0.6.1)
35+
syntax (>= 1.0.0)
36+
posix-spawn (0.3.6)
37+
pygments.rb (0.5.2)
38+
posix-spawn (~> 0.3.6)
39+
yajl-ruby (~> 1.1.0)
40+
rdiscount (1.6.8)
41+
redcarpet (2.2.2)
42+
safe_yaml (0.7.1)
43+
syntax (1.0.0)
44+
yajl-ruby (1.1.0)
45+
46+
PLATFORMS
47+
ruby
48+
49+
DEPENDENCIES
50+
github-pages

README.markdown

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Introduction
2+
3+
Spring's project pages are based on [Jekyll](http://jekyllrb.com) and [GitHub Pages](http://pages.github.com/). This means that each project's website is stored within the project repo, in a special branch called "gh-pages". In order to keep everything looking similar across the many individual Spring projects, common elements of the Jekyll site layout, css, etc are stored in [a shared gh-pages repository](http://github.com/spring-projects/gh-pages). If you're seeing this README in the gh-pages branch of an actual Spring project, that's because this file, along with all the other common files get merged periodically into each project.
4+
5+
This approach may sound a little funky (and it is), but it's way better than the misery of Git submodules. In fact, it's actually pretty easy. If you're just getting started, then follow the directions immediately below. If you're needing a refresher on how to keep things up to date, then head to the section at the bottom on "keeping up to date".
6+
7+
8+
# How to start a new `gh-pages` project page
9+
10+
From within your Spring project's git checkout directory:
11+
12+
### Create and checkout the gh-pages branch
13+
14+
git checkout --orphan gh-pages
15+
16+
### Remove all files
17+
18+
git rm -rf *
19+
git rm -rf '.*'
20+
21+
### Add the gh-pages-upstream remote
22+
23+
git remote add gh-pages-upstream https://github.com/spring-projects/gh-pages.git
24+
25+
### Pull in the common site infrastructure
26+
27+
git pull gh-pages-upstream gh-pages
28+
29+
30+
## Edit `_config.yml`
31+
32+
You'll need to tweak a few settings in `_config.yml`, sitting in the root directory. Edit this file and follow the instructions within. It should be self explanatory; you'll see that there are lots of instances of "spring-framework" as a project name. You should replace these with your own project's information as appropriate.
33+
34+
35+
## Create the project home page
36+
37+
### What kind of project are you?
38+
39+
At this point, you just need to give your project a home page. There are pre-fab samples included in the `_sample-pages` directory:
40+
41+
$ ls -1 _sample-pages
42+
documentation.md
43+
project_group.html
44+
project.html
45+
vaniall.md
46+
47+
At this point you need to make a decision: is your project a "grouping project", like Spring Data, acting as a parent for one or more child projects? If so, you should choose `project_group.html` in the following step. Otherwise, if you're dealing with an individual, concrete Spring project, e.g. Spring Data JPA, or Spring Security OAuth, you should choose `project.html`. The `documentation.md` can be used when you want to expose README.md files on your site.
48+
49+
### Copy the sample page to `index.html`
50+
51+
Based on your choice above, copy the correct sample page to `index.html`, e.g.:
52+
53+
$ cp sample-pages/project.html index.html
54+
55+
or
56+
57+
$ cp sample-pages/project_group.html index.html
58+
59+
60+
## Edit the content of your home page
61+
62+
### Edit the YAML front matter
63+
64+
Open up `index.html` in your favorite text editor. Within, you'll find "YAML front matter" at the top of the file, i.e. everything between the triple dashes that look like `---`. This section contains some basic metadata, and—if you've copied the `project.html` sample—also contains a custom section of information for your project "badges". These are icons that will render in the sidebar of your project page.
65+
66+
Edit the URLs and other values in the YAML front matter as appropriate. This should be self-explanatory.
67+
68+
> **Tip**: If a particular "badge" (e.g. Sonar) does not apply to your project, just delete that entry from the YAML.
69+
70+
### Understand the use of "captures" and "includes"
71+
72+
Next, you'll see a series of `{% capture variable_name %}` blocks that look like this:
73+
74+
{% capture billboard_description %}
75+
...
76+
{% endcapture %}
77+
78+
At the end of the file you'll see a `{% include %}` directive that looks like this:
79+
80+
{% include project_page.html %}
81+
82+
That `include` directive is the most important part. It brings in `project_page.html`, which will actually be responsible for rendering the page content.
83+
84+
The net effect is that you have one simple place to edit actual page content, and the actual rendering and placement of that content is handled for you by the include.
85+
86+
Ideally, you shouldn't have to touch any other files besides `_config.yml` and `index.html`, but of course if you need to you always can.
87+
88+
### Replace the filler text with copy specific to your project
89+
90+
Of course the next step is simply to change the prose within each `{% capture %}` block to read as you want it to. It's just Markdown, so do as you please with that in mind. Note that you'll want to move on to the next step to view the site locally before you get too far into the editing process; this will allow you view your changes live as you make them.
91+
92+
93+
## View the site locally
94+
95+
Assuming you're already within your project's clone directory, and you've already checked out the `gh-pages` branch, follow these simple directions to view your site locally:
96+
97+
### Install jekyll if you have not already
98+
99+
> **Note:** Jekyll 1.1.2 is a known good version.
100+
101+
gem install jekyll
102+
103+
### Run jekyll
104+
105+
Use the `--watch` flag to pick up changes to files as you make them, allowing you a nice edit-and-refresh workflow.
106+
107+
jekyll serve --watch
108+
109+
> **Important:** Because the `baseurl` is set explicitly within your project's `_config.yml` file, you'll need to fully-qualify the URL to view your project. For example, if your project is named "spring-xyz", your URL when running Jekyll locally will be <http://localhost:4000/spring-xyz/>. Don't forget the trailing slash! You'll get a 404 without it.
110+
111+
112+
## Commit your changes
113+
114+
Once you're satisified with your edits, commit your changes and push the `gh-pages` pages up to your project's `origin` remote.
115+
116+
git commit -m "Initialize project page"
117+
git push --set-upstream origin gh-pages
118+
git push
119+
120+
121+
## View your site live on the web
122+
123+
That's it! After not more than a few minutes, you should be able to see your site at http://spring-projects.github.io/{your-spring-project}
124+
125+
126+
# How to keep common gh-pages content up to date
127+
128+
Once you've set up your project's gh-pages infrastructure above, you'll get notified whenever
129+
changes are made to the shared gh-pages project. Actually, _your project_ will get notified,
130+
because a webhook configured on the gh-pages project will fire that ultimately creates a new
131+
issue in your project's GH Issues.
132+
> Yeah, it would have been nice to do proper pull requests instead of issues, but this arrangement
133+
with gh-pages branches and upstreams isn't based on forking. That means pull requests are no can do.
134+
This also means that if your project doesn't have issues turned on, you won't get notified! So you
135+
might consider doing that if you haven't already.
136+
137+
In any case, whether or not you get notified via the issue coming in from the webhook, sync'ing
138+
up to the latest from the shared gh-pages project is easy enough:
139+
140+
> This assumes you've got the `gh-pages-upstream` remote set up, per the instructions in sections
141+
above.
142+
143+
git checkout gh-pages
144+
git pull --no-ff gh-pages-upstream gh-pages

_config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
### Global gh-pages pre-amble
2+
safe: true
3+
lsi: false
4+
pygments: true
5+
markdown: redcarpet
6+
redcarpet:
7+
extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
8+
9+
10+
### The following properties will change on a project-by-project basis
11+
12+
# Context path in the remote website (usually /<project>), will be prepended to absolute URLs for static resources
13+
baseurl: /gh-pages
14+
15+
# Name of the project for display in places like page titles
16+
name: Spring Framework
17+
18+
# ID of the project in the metadata API at spring.io (if this is not a
19+
# valid project ID the javascript widgets in the home page will not work)
20+
project: spring-framework
21+
22+
# Project github URL
23+
github_repo_url: http://github.com/spring-projects/spring-framework
24+
25+
# Project forum URL
26+
forum: http://forum.spring.io/forum/spring-projects/container
27+
28+
29+
### The following properties are constant for most projects
30+
31+
main_site_url: http://spring.io
32+
projects_site_url: http://projects.spring.io
33+
forum_url: http://forum.spring.io

_includes/badges.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% if page.badges.twitter %}
2+
<div class="project-sub-link">
3+
<a href="https://twitter.com/{{ page.badges.twitter }}">
4+
<div class="spring-icon project-badges twitter" alt="Twitter" title="Twitter">
5+
</div>
6+
</a>
7+
</div>
8+
{% endif %}
9+
{% for badge in page.badges.custom %}
10+
<div class="project-sub-link">
11+
<a href="{{ badge.url }}">
12+
<div class="spring-icon project-badges {{ badge.icon }}" alt="{{ badge.name }}" title="{{ badge.name }}">
13+
</div>
14+
</a>
15+
</div>
16+
{% endfor %}

_includes/billboard.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<div class="billboard--wrapper project-header--wrapper">
2+
<div class="billboard--container">
3+
<div class="project-icon">
4+
</div>
5+
<div class="container-fluid">
6+
<div class="row-fluid">
7+
<div class="span8 billboard--area">
8+
<div class="content--title">
9+
{% capture breadcrumb %}
10+
[Projects]({{ site.projects_site_url }}){% if parent_link %} : {{ parent_link }}{% endif %}
11+
{% endcapture %}
12+
{{ breadcrumb | markdownify }}
13+
</div>
14+
15+
<div class="project--title">{{ site.name }}
16+
<div class="project--links--container">
17+
<a href="{{ site.github_repo_url }}" class="project-link">
18+
<i class="icon-github"></i>
19+
</a>
20+
<a href="{{ site.forum }}" class="project-link project-link-forum">
21+
<div class="spring-icon spring-icon-forum">
22+
</div>
23+
</a>
24+
</div>
25+
</div>
26+
27+
<div class="project--description">
28+
{{ billboard_description | markdownify }}
29+
</div>
30+
31+
{{ billboard_quickstart_button }}
32+
</div>
33+
</div>
34+
</div>
35+
</div>
36+
</div>

_includes/documentation.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<div class="js-documentation-widget">
2+
</div>

_includes/download_widget.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<div id="download-widget">
2+
<div class="row-fluid download-widget--container">
3+
<div class="download-widget--header js-item-dropdown-widget--wrapper">
4+
<div class="download-widget--title">
5+
Download
6+
</div>
7+
<div data-download-widget-controls style="display: inline-block"></div>
8+
</div>
9+
<div class="download-widget--body">
10+
<p>The recommended way to get started using <code>{{ site.project }}</code> in
11+
your project is with a dependency management system &ndash; the snippet below can
12+
be copied and pasted into your build. Need help? See our getting started guides
13+
on building with <a href="http://spring.io/guides/gs/maven/">Maven</a> and
14+
<a href="http://spring.io/guides/gs/gradle/">Gradle</a>.
15+
</p>
16+
<div class="js-download-maven-widget"></div>
17+
</div>
18+
</div>
19+
</div>

0 commit comments

Comments
 (0)