add proposed changes

This commit is contained in:
xirsoi 2020-03-18 13:41:50 -05:00
parent b5d117c1bc
commit 288b967302
12 changed files with 223 additions and 135 deletions

View File

@ -37,21 +37,33 @@ Additionally, you may choose to set the following optional variables:
```yml
show_downloads: ["true" or "false" to indicate whether to provide a download URL]
show_excerpts: ["true" or "false" (defaults to false) to indicate whether excerpts are to be displayed for listed posts]
google_analytics: [Your Google Analytics tracking ID]
```
### Pages
Hacker adds some options at the page level as well and you can set these in the front matter.
```yml
hide_navigation: ["true" or "false" (defaults to false) controls if the navigation in the main mast is displayed]
excerpt: [an optional short description in posts to display under the post title and link on the list page]
```
### Stylesheet
If you'd like to add your own custom styles:
1. Create a file called `/assets/css/style.scss` in your site
2. Add the following content to the top of the file, exactly as shown:
```scss
---
---
@import "{{ site.theme }}";
```
3. Add any custom CSS (or Sass, including imports) you'd like immediately after the `@import` line
*Note: If you'd like to change the theme's Sass variables, you must set new values before the `@import` line in your stylesheet.*
@ -71,11 +83,13 @@ Templates often rely on URLs supplied by GitHub such as links to your repository
1. Look at [the template source](https://github.com/pages-themes/hacker/blob/master/_layouts/default.html) to determine the name of the variable. It will be in the form of `{{ site.github.zip_url }}`.
2. Specify the URL that you'd like the template to use in your site's `_config.yml`. For example, if the variable was `site.github.url`, you'd add the following:
```yml
github:
zip_url: http://example.com/download.zip
another_url: another value
```
3. When your site is built, Jekyll will use the URL you specified, rather than the default one provided by GitHub.
*Note: You must remove the `site.` prefix, and each variable name (after the `github.`) should be indent with two space below `github:`.*

View File

@ -1,5 +1,6 @@
title: Hacker theme
description: Hacker is a theme for GitHub Pages.
show_downloads: true
show_excerpts: true
google_analytics:
theme: jekyll-theme-hacker

View File

@ -13,17 +13,22 @@
<header>
<div class="container">
<a id="a-title" href="{{ '/' | relative_url }}">
<h1>{{ site.title | default: site.github.repository_name }}</h1>
<h1>{{ site.title | default: site.github.repository_name }}</h1>
<a href="{{ site.github.repository_url }}" class="btn btn-github" style="float:right">
<span class="icon"></span>
View on GitHub
</a>
<h2>{{ site.description | default: site.github.project_tagline }}</h2>
<section id="downloads">
<section id="downloads" float="left">
{% if site.show_downloads %}
<a href="{{ site.github.zip_url }}" class="btn">Download as .zip</a>
<a href="{{ site.github.tar_url }}" class="btn">Download as .tar.gz</a>
{% endif %}
<a href="{{ site.github.repository_url }}" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
{% unless page.hide_navigation == true %}
<a href="{{ site.url }}">Home</a> | <a href="/another-page/">Another Page</a>
{% endunless %}
</section>
</div>
</header>
@ -45,4 +50,4 @@
</script>
{% endif %}
</body>
</html>
</html>

24
_layouts/home.html Normal file
View File

@ -0,0 +1,24 @@
---
layout: default
---
{%- if site.posts.size > 0 -%}
<h1 class="post-list-heading">{{ page.list_title | default: "Posts" }}</h1>
<ul class="post-list">
{%- for post in site.posts limit:5 -%}
<li>
<hr />
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
<span class="post-meta">{{ post.date | date: date_format }}</span>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</h3>
{%- if site.show_excerpts -%}
{{ post.excerpt }}
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif -%}

View File

@ -8,7 +8,13 @@ layout: default
<p class="view">by {{ page.author | default: site.author }}</p>
{{content}}
{% if page.tags %}
<small>tags: <em>{{ page.tags | join: "</em> - <em>" }}</em></small>
<hr />
<section>
{% if page.previous %}
<a style="float:left" href="{{ page.previous.url }}">< Previous Post</a>
{% endif %}
{% if page.next %}
<a style="float:right" href="{{ page.next.url }}">Next Post ></a>
{% endif %}
</section>

View File

@ -0,0 +1,18 @@
---
layout: post
title: "An Even Older Post"
date: 2020-01-18 08:00:00-0600
excerpt: A post to demonstrate the flexibility of the in-post navigation links.
hide_navigation: true
---
This post shows that the 'previous' link will only display if there is a previous post to go to.
The 'next' link is smart in a similar way, which you can see if you click through to the format demonstration post at the end.
It also demonstrates the ability to hide the full site navigation menu normally seen above. This can be achieved by adding
```yml
hide_navigation: true
```
to your post's front matter.

View File

@ -0,0 +1,10 @@
---
layout: post
title: "An Older Post"
date: 2020-02-18 08:00:00-0600
excerpt: An older post to demonstrate in-post navigation.
---
This post exists to demonstrate the use of the 'previous' and 'next' links you see below!
Give them a try!

126
_posts/2020-03-18-a-post.md Normal file
View File

@ -0,0 +1,126 @@
---
layout: post
title: "A Post"
date: 2020-03-18 08:00:00-0600
excerpt: Example formatting for this theme! Click me!
---
Text can be **bold**, _italic_, ~~strikethrough~~ or `keyword`.
[Link to another page](./another-page.html).
There should be whitespace between paragraphs.
There should be whitespace between paragraphs. We recommend including a README, or a file with information about your project.
# Header 1
This is a normal paragraph following a header. GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.
## Header 2
> This is a blockquote following a header.
>
> When something is important enough, you do it even if the odds are not in your favor.
### Header 3
```js
// Javascript code with syntax highlighting.
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l)
return true;
}
```
```ruby
# Ruby code with syntax highlighting
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
```
#### Header 4
* This is an unordered list following a header.
* This is an unordered list following a header.
* This is an unordered list following a header.
##### Header 5
1. This is an ordered list following a header.
2. This is an ordered list following a header.
3. This is an ordered list following a header.
###### Header 6
| head1 | head two | three |
|:-------------|:------------------|:------|
| ok | good swedish fish | nice |
| out of stock | good and plenty | nice |
| ok | good `oreos` | hmm |
| ok | good `zoute` drop | yumm |
### There's a horizontal rule below this.
* * *
### Here is an unordered list:
* Item foo
* Item bar
* Item baz
* Item zip
### And an ordered list:
1. Item one
1. Item two
1. Item three
1. Item four
### And a nested list:
- level 1 item
- level 2 item
- level 2 item
- level 3 item
- level 3 item
- level 1 item
- level 2 item
- level 2 item
- level 2 item
- level 1 item
- level 2 item
- level 2 item
- level 1 item
### Small image
![Octocat](https://github.githubassets.com/images/icons/emoji/octocat.png)
### Large image
![Branching](https://guides.github.com/activities/hello-world/branching.png)
### Definition lists can be used with HTML syntax.
<dl>
<dt>Name</dt>
<dd>Godzilla</dd>
<dt>Born</dt>
<dd>1952</dd>
<dt>Birthplace</dt>
<dd>Japan</dd>
<dt>Color</dt>
<dd>Green</dd>
</dl>
```
Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
```
```
The final element.
```

View File

@ -85,7 +85,7 @@ header h1:before {
header h2 {
font-size: 18px;
font-weight: 300;
color: #666;
color: $grey;
}
#downloads .btn {
@ -180,6 +180,11 @@ code.highlighter-rouge {
border-radius: 2px;
}
table, th, tr, td {
border-collapse: collapse;
border: 1px solid white;
}
table {
width: 100%;
margin: 0 0 20px 0;
@ -189,6 +194,7 @@ th {
text-align: left;
border-bottom: 1px dashed #b5e853;
padding: 5px 10px;
color: $conifer;
}
td {

View File

@ -6,8 +6,7 @@ The Hacker Theme is an open source project supported by the efforts of an entire
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.
## Looking for support?
## Looking for support
We'd love to help. Check out [the support guidelines](SUPPORT.md).
@ -34,8 +33,6 @@ Feature requests are welcome. But take a moment to find out whether your idea fi
[Open an issue](https://github.com/pages-themes/hacker/issues/new) which describes the feature you would like to see, why you want it, how it should work, etc.
## Your first contribution
We'd love for you to contribute to the project. Unsure where to begin contributing to The Hacker Theme? You can start by looking through these "good first issue" and "help wanted" issues:

View File

@ -1,4 +1,4 @@
## Where to get help
# Where to get help
If you think you've found a bug in The Hacker Theme, please [check the existing issues](https://github.com/pages-themes/hacker/issues), and if no one has reported the problem, [open a new issue](https://github.com/pages-themes/hacker/issues/new).

123
index.md
View File

@ -1,123 +1,4 @@
---
layout: default
layout: home
list-title: Recent Posts
---
Text can be **bold**, _italic_, ~~strikethrough~~ or `keyword`.
[Link to another page](./another-page.html).
There should be whitespace between paragraphs.
There should be whitespace between paragraphs. We recommend including a README, or a file with information about your project.
# Header 1
This is a normal paragraph following a header. GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.
## Header 2
> This is a blockquote following a header.
>
> When something is important enough, you do it even if the odds are not in your favor.
### Header 3
```js
// Javascript code with syntax highlighting.
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l)
return true;
}
```
```ruby
# Ruby code with syntax highlighting
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
```
#### Header 4
* This is an unordered list following a header.
* This is an unordered list following a header.
* This is an unordered list following a header.
##### Header 5
1. This is an ordered list following a header.
2. This is an ordered list following a header.
3. This is an ordered list following a header.
###### Header 6
| head1 | head two | three |
|:-------------|:------------------|:------|
| ok | good swedish fish | nice |
| out of stock | good and plenty | nice |
| ok | good `oreos` | hmm |
| ok | good `zoute` drop | yumm |
### There's a horizontal rule below this.
* * *
### Here is an unordered list:
* Item foo
* Item bar
* Item baz
* Item zip
### And an ordered list:
1. Item one
1. Item two
1. Item three
1. Item four
### And a nested list:
- level 1 item
- level 2 item
- level 2 item
- level 3 item
- level 3 item
- level 1 item
- level 2 item
- level 2 item
- level 2 item
- level 1 item
- level 2 item
- level 2 item
- level 1 item
### Small image
![Octocat](https://github.githubassets.com/images/icons/emoji/octocat.png)
### Large image
![Branching](https://guides.github.com/activities/hello-world/branching.png)
### Definition lists can be used with HTML syntax.
<dl>
<dt>Name</dt>
<dd>Godzilla</dd>
<dt>Born</dt>
<dd>1952</dd>
<dt>Birthplace</dt>
<dd>Japan</dd>
<dt>Color</dt>
<dd>Green</dd>
</dl>
```
Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
```
```
The final element.
```