diff --git a/README.md b/README.md index 424e109..2c7afdf 100644 --- a/README.md +++ b/README.md @@ -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:`.* diff --git a/_config.yml b/_config.yml index c5cf3fd..fbf60b1 100644 --- a/_config.yml +++ b/_config.yml @@ -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 \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index aa65198..9896c24 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -13,17 +13,22 @@
- -

{{ site.title | default: site.github.repository_name }}

+

{{ site.title | default: site.github.repository_name }}

+
+ + View on GitHub

{{ site.description | default: site.github.project_tagline }}

-
+
{% if site.show_downloads %} Download as .zip Download as .tar.gz {% endif %} - View on GitHub + + {% unless page.hide_navigation == true %} + Home | Another Page + {% endunless %}
@@ -45,4 +50,4 @@ {% endif %} - + \ No newline at end of file diff --git a/_layouts/home.html b/_layouts/home.html new file mode 100644 index 0000000..b81f637 --- /dev/null +++ b/_layouts/home.html @@ -0,0 +1,24 @@ +--- +layout: default +--- + +{%- if site.posts.size > 0 -%} +

{{ page.list_title | default: "Posts" }}

+ +{%- endif -%} \ No newline at end of file diff --git a/_layouts/post.html b/_layouts/post.html index 0676aff..3ff48e6 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -8,7 +8,13 @@ layout: default

by {{ page.author | default: site.author }}

{{content}} - -{% if page.tags %} - tags: {{ page.tags | join: " - " }} +
+
+{% if page.previous %} + < Previous Post {% endif %} + +{% if page.next %} + Next Post > +{% endif %} +
\ No newline at end of file diff --git a/_posts/2020-01-18-an-even-older-post.md b/_posts/2020-01-18-an-even-older-post.md new file mode 100644 index 0000000..7e9a750 --- /dev/null +++ b/_posts/2020-01-18-an-even-older-post.md @@ -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. diff --git a/_posts/2020-02-18-an-older-post.md b/_posts/2020-02-18-an-older-post.md new file mode 100644 index 0000000..5515d49 --- /dev/null +++ b/_posts/2020-02-18-an-older-post.md @@ -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! diff --git a/_posts/2020-03-18-a-post.md b/_posts/2020-03-18-a-post.md new file mode 100644 index 0000000..485ff77 --- /dev/null +++ b/_posts/2020-03-18-a-post.md @@ -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. + +
+
Name
+
Godzilla
+
Born
+
1952
+
Birthplace
+
Japan
+
Color
+
Green
+
+ +``` +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. +``` diff --git a/_sass/jekyll-theme-hacker.scss b/_sass/jekyll-theme-hacker.scss index b3123a1..ac743f4 100644 --- a/_sass/jekyll-theme-hacker.scss +++ b/_sass/jekyll-theme-hacker.scss @@ -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 { diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 99259dc..5ecf28e 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -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: diff --git a/docs/SUPPORT.md b/docs/SUPPORT.md index 09915fe..b505d21 100644 --- a/docs/SUPPORT.md +++ b/docs/SUPPORT.md @@ -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). diff --git a/index.md b/index.md index e039c9a..230a695 100644 --- a/index.md +++ b/index.md @@ -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. - -
-
Name
-
Godzilla
-
Born
-
1952
-
Birthplace
-
Japan
-
Color
-
Green
-
- -``` -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. -```