From 9632542085b2d9c048ead466a482a9c2f1f7c3a9 Mon Sep 17 00:00:00 2001 From: Andrew Stowell Date: Mon, 22 Oct 2018 16:23:39 -0400 Subject: [PATCH] Split default theme file into includes, refactored sample content, setup home theme file. --- _config.yml | 4 + _includes/brand.html | 3 + _includes/footer.html | 8 ++ _includes/head.html | 5 +- _includes/icons.html | 46 +++++++++ _includes/nav.html | 12 +++ _includes/scripts.html | 7 ++ _layouts/default.html | 112 +++------------------- _layouts/home.html | 30 ++++++ _layouts/old_default.html | 154 ------------------------------- _posts/2018-10-21-test-post.md | 8 ++ _posts/2018-10-22-second-post.md | 8 ++ about.md | 7 -- index.md | 123 +----------------------- sample-content.md | 127 +++++++++++++++++++++++++ 15 files changed, 269 insertions(+), 385 deletions(-) create mode 100644 _includes/brand.html create mode 100644 _includes/footer.html create mode 100644 _includes/icons.html create mode 100644 _includes/nav.html create mode 100644 _includes/scripts.html create mode 100644 _layouts/home.html delete mode 100644 _layouts/old_default.html create mode 100644 _posts/2018-10-21-test-post.md create mode 100644 _posts/2018-10-22-second-post.md delete mode 100644 about.md create mode 100644 sample-content.md diff --git a/_config.yml b/_config.yml index e2b91c5..b1e8b1c 100644 --- a/_config.yml +++ b/_config.yml @@ -11,6 +11,10 @@ description: url: "http://theme.digitaladapt.com" baseurl: / +# set to false to hide excerpts on the homepage +show_excerpts: true +excerpt_separator: + # Avatar, image location override, default /images/avatar.jpg # avatar: /images/avatar.jpg diff --git a/_includes/brand.html b/_includes/brand.html new file mode 100644 index 0000000..29539b8 --- /dev/null +++ b/_includes/brand.html @@ -0,0 +1,3 @@ + +

{{ site.title }}

+

{{ site.description }}

diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..fce5fc9 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,8 @@ +
+ +
diff --git a/_includes/head.html b/_includes/head.html index 81b5102..ede132f 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,12 +1,11 @@ - - + {%- seo -%} {%- feed_meta -%} {%- if jekyll.environment == 'production' and site.google_analytics -%} - {%- include google-analytics.html -%} + {%- include google-analytics.html -%} {%- endif -%} diff --git a/_includes/icons.html b/_includes/icons.html new file mode 100644 index 0000000..365af71 --- /dev/null +++ b/_includes/icons.html @@ -0,0 +1,46 @@ + diff --git a/_includes/nav.html b/_includes/nav.html new file mode 100644 index 0000000..d29e879 --- /dev/null +++ b/_includes/nav.html @@ -0,0 +1,12 @@ + diff --git a/_includes/scripts.html b/_includes/scripts.html new file mode 100644 index 0000000..6f41fc6 --- /dev/null +++ b/_includes/scripts.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/_layouts/default.html b/_layouts/default.html index 245ec9e..3a4e620 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -7,98 +7,19 @@ --> - - - - {%- seo -%} - {%- feed_meta -%} - {%- if jekyll.environment == 'production' and site.google_analytics -%} - {%- include google-analytics.html -%} - {%- endif -%} - - - - - - - - - - - - - + {%- include head.html -%} @@ -107,13 +28,17 @@
- -
+
+

{{ page.title }}

+ {%- if page.description -%} +

{{ page.description }}

+ {%- endif -%} +
{{ content }}
@@ -121,26 +46,13 @@
- - - - - - - + {%- include scripts.html -%} diff --git a/_layouts/home.html b/_layouts/home.html new file mode 100644 index 0000000..a9f56b9 --- /dev/null +++ b/_layouts/home.html @@ -0,0 +1,30 @@ +--- +layout: default +--- + +{{ content }} + +{%- if site.posts.size > 0 -%} +
+
+

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

+
+ {%- assign date_format = site.date_format | default: "%b %-d, %Y" -%} + {%- for post in site.posts -%} + + {%- endfor -%} +
+
+
+{%- endif -%} diff --git a/_layouts/old_default.html b/_layouts/old_default.html deleted file mode 100644 index 6d705de..0000000 --- a/_layouts/old_default.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - {%- include head.html -%} - - - - - - - -
- - -
-
- {{ content }} -
- -
- - - - - - - - - - - diff --git a/_posts/2018-10-21-test-post.md b/_posts/2018-10-21-test-post.md new file mode 100644 index 0000000..c7c55bf --- /dev/null +++ b/_posts/2018-10-21-test-post.md @@ -0,0 +1,8 @@ +--- +title: Test Post +layout: post +banner: /images/pic01.jpg +category: blog +--- +Just a simple post. + diff --git a/_posts/2018-10-22-second-post.md b/_posts/2018-10-22-second-post.md new file mode 100644 index 0000000..2e6e2f6 --- /dev/null +++ b/_posts/2018-10-22-second-post.md @@ -0,0 +1,8 @@ +--- +title: Second Post +layout: post +banner: /images/pic02.jpg +category: blog +--- +More simple posts. + diff --git a/about.md b/about.md deleted file mode 100644 index 62a7245..0000000 --- a/about.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: About -layout: default -permalink: /about/ -weight: 2 ---- -Simple About Page diff --git a/index.md b/index.md index 2227ab6..d87020e 100644 --- a/index.md +++ b/index.md @@ -1,125 +1,6 @@ --- title: Home -layout: default +layout: home weight: 1 +description: Home Page Description --- - -Text can be **bold**, _italic_, or ~~strikethrough~~. - -[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://assets-cdn.github.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/sample-content.md b/sample-content.md new file mode 100644 index 0000000..30fa936 --- /dev/null +++ b/sample-content.md @@ -0,0 +1,127 @@ +--- +title: Sample Content +layout: page +weight: 1 +description: Sample Content Page Description +permalink: /sample-content/ +--- + +Text can be **bold**, _italic_, or ~~strikethrough~~. + +[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://assets-cdn.github.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. +```