Skip to content

Commit c78a8f5

Browse files
committed
Merge pull request #57 from hashhar/refactor
Refactor the website and improve some consistency
2 parents ea73135 + 61bb280 commit c78a8f5

24 files changed

+260
-298
lines changed

404.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
subtitle: "Whoops! Page Not Found"
55
---
66

7-
<p>Sorry - we're in the process of getting the new Open Live Writer website set up and you appear to have tried to
8-
visit a page that doesn't exist yet.</p>
7+
<p>Sorry - we're in the process of getting the new Open Live Writer website set up and you appear to have tried to visit a page that doesn't exist yet.</p>
98
<p>If you don't mind, please
109
<a target="_blank" href="https://github.com/OpenLiveWriter/OpenLiveWriter.Github.io/issues/new">log an issue</a>
1110
with the URL you were trying to reach and where you clicked in Open Live Writer to get sent here. Thanks!

_includes/download.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
<div class="button">
3-
<a href="https://openlivewriter.azureedge.net/stable/Releases/OpenLiveWriterSetup.exe"
4-
onClick="ga('send', 'event', 'Download', 'download', 'OpenLiveWriterSetup.exe'); return true;">Download</a>
5-
<p class="top">click to begin</p>
6-
<p class="bottom">5.2MB .exe</p>
7-
</div>
1+
<div class="button">
2+
<a href="https://openlivewriter.azureedge.net/stable/Releases/OpenLiveWriterSetup.exe" onClick="ga('send', 'event', 'Download', 'download', 'OpenLiveWriterSetup.exe'); return true;">Download</a>
3+
<p class="top">Click to begin</p>
4+
<p class="bottom">5.2MB (.exe)</p>
5+
</div>

_includes/download_source.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="download-source">
2+
<h3 class="download-source-header">Download Source</h3>
3+
<a class="zip-download-link" href="https://github.com/OpenLiveWriter/OpenLiveWriter/archive/0.5.0.0.zip"></a>
4+
<a class="tar-download-link" href="https://github.com/OpenLiveWriter/OpenLiveWriter/archive/0.5.0.0.tar.gz"></a>
5+
</div>

_includes/footer.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
<p>Copyright &copy; {{ site.time | date: "%Y" }} <a href="http://dotnetfoundation.org">.NET Foundation</a>.</p>
2-
1+
<div style="text-align: right">
2+
<p>Copyright &copy; {{ site.time | date: "%Y" }} <a href="http://dotnetfoundation.org">.NET Foundation</a>.</p>
3+
</div>

_includes/google_analytics.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{% if site.google_analytics_tracking_id %}
22
<script>
3-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
3+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
77

8-
ga('create', '{{ site.google_analytics_tracking_id }}', 'auto');
9-
ga('send', 'pageview');
10-
11-
var trackOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
12-
function () { document.location = url; } });
13-
}
8+
ga('create', '{{ site.google_analytics_tracking_id }}', 'auto');
9+
ga('send', 'pageview');
10+
11+
var trackOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
12+
function () { document.location = url; } });
13+
}
1414
</script>
1515
{% endif %}

_includes/news_item.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ <h2>
99
{{ post.date | date_to_string }}
1010
</span>
1111
<a href="https://github.com/{{ post.author }}" class="post-author">
12-
<img src="https://github.com/{{ post.author }}.png" class="avatar" alt="{{ post.author }} avatar" width="24" height="24">
12+
<img src="https://github.com/{{ post.author }}.png" class="avatar" alt="{{ post.author }} avatar" width="24" height="24" />
1313
{{ post.author }}
1414
</a>
1515
</div>
1616
<div class="post-content">
1717
{{ post.content }}
1818
</div>
19-
</article>
19+
</article>

_layouts/default.html

Lines changed: 71 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,92 @@
11
{% include head.html %}
2-
3-
<body>
2+
<body>
3+
<div class="main-container">
44
{% include google_analytics.html %}
5-
<!-- HEADER -->
5+
<!-- OLW banner and GitHub badge -->
66
<div id="header_wrap" class="outer">
77
<header class="inner">
8-
<a id="forkme_banner" href="https://github.com/OpenLiveWriter">View on GitHub</a>
9-
<h1 id="project_title"><a href="/"><img src="/images/openlivewriter-purpleheader.png" alt="Open Live Writer"/></a></h1>
10-
{% if page.subtitle %}
11-
<h2 id="project_tagline" style="margin-bottom: 0px">{{ page.subtitle }}</h2>
12-
{% endif %}
8+
<a id="forkme_banner" href="https://github.com/OpenLiveWriter">View on GitHub</a>
9+
<h1 id="project_title"><a href="/"><img src="/images/openlivewriter-purpleheader.png" alt="Open Live Writer"/></a></h1>
10+
{% if page.subtitle %}
11+
<h2 id="project_tagline">{{ page.subtitle }}</h2>
12+
{% endif %}
1313
</header>
1414
</div>
15-
<!-- Tabbed Navigation -->
15+
<!-- Tabbed navigation bar -->
1616
<ul class="nav nav-tabs">
17-
<li id="index.html" class="active" role="presentation"><a href="/index.html">Home</a></li>
18-
<li id="news" role="presentation"><a href="/news">News</a></li>
19-
<li id="blog" role="presentation"><a href="/blog">Blog</a></li>
20-
<li id="GSoC" role="presentation"><a href="/GSoC">GSoC</a></li>
21-
<li id="tutorials" role="presentation"><a href="/tutorials">Tutorials</a></li>
17+
<li id="home" class="active" role="presentation"><a href="/">Home</a></li>
18+
<li id="news" role="presentation"><a href="/news">News</a></li>
19+
<li id="blog" role="presentation"><a href="/blog">Blog</a></li>
20+
<li id="tutorials" role="presentation"><a href="/tutorials">Tutorials</a></li>
2221
</ul>
23-
<style>
24-
25-
.header-img {
26-
margin: 0;
27-
margin-right: 5px;
28-
margin-left: 5px;
29-
height: 40px;
30-
}
31-
32-
.nav-tabs {
33-
background-color: #7E4999;
34-
}
35-
36-
.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus {
37-
color: #7E4999;
38-
background-color: #fff;
39-
/* border: 1px solid #ddd; */
40-
border-bottom-color: transparent;
41-
}
42-
43-
.nav-tabs > li > a:hover {
44-
background-color: #ddd;
45-
color: #7E4999
46-
}
47-
48-
.nav-tabs > li > a {
49-
margin-right: 0;
50-
border-radius: 0 0 0 0;
51-
color: #fff;
52-
/* border: 1px solid transparent; */
53-
}
54-
55-
</style>
56-
22+
<!-- INCLUDE DOWNLOAD BUTTON IF THE PAGE HAS IT SET IN THE FRONT-MATTER -->
5723
{% if page.download == true %}
58-
{% include download.html %}
24+
{% include download.html %}
5925
{% endif %}
60-
6126
<!-- MAIN CONTENT -->
6227
<div id="main_content_wrap" class="outer">
63-
<div id="main_content" class="inner">
64-
{% if page.categories contains 'news' or page.categories contains 'blog' %}
65-
<h1 id="post-heading"><a href="{{ page.url }}">{{ page.title }}</a></h1><br/>
66-
{% endif %}
67-
{{ content }}
68-
</div>
69-
</div>
70-
<div id="footer_wrap" class="outer">
71-
<footer id="footer" class="inner">{% include footer.html %}</footer>
28+
<div id="main_content" class="inner">
29+
{{ content }}
30+
</div>
7231
</div>
73-
<script>
74-
$(document).ready ( function() {
32+
</div>
33+
<!-- FOOTER -->
34+
<div id="footer_wrap" class="outer">
35+
<footer id="footer" class="inner">
36+
{% include footer.html %}
37+
<!-- DOWNLOAD SOURCE IN THE FOOTER -->
38+
{% include download_source.html %}
39+
</footer>
40+
</div>
41+
<!-- SCRIPTS AND STYLES -->
42+
<script>
43+
// This function manages which navigation tab is currently active
44+
$(document).ready(function() {
7545
var current_href = window.location.href;
46+
// Filters out the leading folder from the url
7647
var re = /\/\w+\//i;
7748
var m;
7849
while ((m = re.exec(current_href)) !== null) {
7950
if (m.index === re.lastIndex) {
8051
re.lastIndex++;
8152
}
82-
var current_tab = m[0];
83-
$(".nav li").each(function() {
84-
if (current_tab.indexOf(this.id) > -1) {
85-
$(this).addClass("active");
86-
} else {
87-
$(this).removeClass("active");
88-
}
89-
})
90-
break;
91-
}
92-
})
93-
</script>
94-
</body>
53+
var current_tab = m[0];
54+
// Iterate over all navigation tabs and update the active tab
55+
$(".nav li").each(function() {
56+
if (current_tab.indexOf(this.id) > -1) {
57+
$(this).addClass("active");
58+
} else {
59+
$(this).removeClass("active");
60+
}
61+
})
62+
break;
63+
};
64+
})
65+
</script>
66+
<style>
67+
/* Make the navigation tab bar have a purple background */
68+
.nav-tabs {
69+
background-color: #7E4999;
70+
}
71+
/* Make the active tab white with purple text and sharp edged */
72+
.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus {
73+
color: #7E4999;
74+
background-color: #fff;
75+
/* border: 1px solid #ddd; */
76+
border-bottom-color: transparent;
77+
}
78+
/* Make the hovered tab background slightly different */
79+
.nav-tabs > li > a:hover {
80+
background-color: #ddd;
81+
color: #7E4999
82+
}
83+
/* Make the tabs square and white */
84+
.nav-tabs > li > a {
85+
margin-right: 0;
86+
border-radius: 0 0 0 0;
87+
color: #fff;
88+
/* border: 1px solid transparent; */
89+
}
90+
</style>
91+
</body>
9592
</html>

_posts/2015-12-09-initial-public-release.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,3 @@ look at the roadmap to see what the current plans are.
2323
For the latest news and updates about Open Live Writer, you can follow us on Twitter
2424
(@OpenLiveWriter), by keeping an eye on the website
2525
http://www.OpenLiveWriter.org or by watching this repo and subscribing to notifications.
26-
27-
### Downloads
28-
[Source Code (zip)](https://github.com/OpenLiveWriter/OpenLiveWriter/archive/0.5.0.0.zip)
29-
30-
[Source Code (tar.gz)](https://github.com/OpenLiveWriter/OpenLiveWriter/archive/0.5.0.0.tar.gz)

_posts/2015-12-17-blogger-v3-api-support.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ download: true
1010
This release provides the initial version of Blogger support using their latest API to unblock users of Blogger.
1111

1212
To force an update, visit [http://openlivewriter.org](http://openlivewriter.org) then download and run the installer. Otherwise if you start Open Live Writer and wait a minute or so, next time you restart Live Writer you should be running the latest version (go to Help, About Open Live Writer to see what version you are on)
13-
14-
### Downloads
15-
[Source Code (zip)](https://github.com/OpenLiveWriter/OpenLiveWriter/archive/0.5.1.2.zip)
16-
17-
[Source Code (tar.gz)](https://github.com/OpenLiveWriter/OpenLiveWriter/archive/0.5.1.2.tar.gz)

getting-started/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ <h3>Give your post a title</h3>
2121

2222
<p>Type a title for your post where it says <strong>Enter a post title</strong>. </p>
2323

24-
<p><img title="" style="display: inline" alt="Enter title" src="/getting-started/title.png" width="465" height="316" /></p>
24+
<p><img title="" style="display: inline" alt="Enter title" src="/getting-started/title.png" /></p>
2525

2626
<h3>Start writing your story</h3>
2727

2828
<p>Write your story in the post window. If you want to format the text, use the commands in the ribbon. Create headings by using the options in the <strong>HTML styles</strong> group. Change the style of a font by using the options in the <strong>Font</strong> group. You can add links, pictures or video from the <strong>Insert</strong> group.</p>
2929

30-
<p><img title="story" style="display: inline" alt="An example blog post" src="/getting-started/story.png" width="465" height="308" /></a></p>
30+
<p><img title="story" style="display: inline" alt="An example blog post" src="/getting-started/story.png" /></a></p>
3131

3232
<h3>Publish your story</h3>
3333

0 commit comments

Comments
 (0)