Skip to content

Commit

Permalink
Merge pull request #69 from olifre/theme-color
Browse files Browse the repository at this point in the history
Setup theme-color in head tags
  • Loading branch information
parkr authored Jul 18, 2021
2 parents b37cc36 + bc5732f commit 8367f9d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ If you'd like to add your own custom styles:

If you'd like to change the theme's HTML layout:

1. [Copy the original template](https://github.com/pages-themes/hacker/blob/master/_layouts/default.html) from the theme's repository<br />(*Pro-tip: click "raw" to make copying easier*)
2. Create a file called `/_layouts/default.html` in your site
3. Paste the default layout content copied in the first step
4. Customize the layout as you'd like
1. For some changes such as a custom `favicon`, you can add custom files in your local `_includes` folder. The files [provided with the theme](https://github.com/pages-themes/hacker/tree/master/_includes) provide a starting point and are included by the [original layout template](https://github.com/pages-themes/hacker/blob/master/_layouts/default.html).
2. For more extensive changes, [copy the original template](https://github.com/pages-themes/hacker/blob/master/_layouts/default.html) from the theme's repository<br />(*Pro-tip: click "raw" to make copying easier*)
3. Create a file called `/_layouts/default.html` in your site
4. Paste the default layout content copied in the first step
5. Customize the layout as you'd like

### Overriding GitHub-generated URLs

Expand Down
5 changes: 5 additions & 0 deletions _includes/head-custom-theme-colors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- start theme color meta headers -->
<meta name="theme-color" content="#151515">
<meta name="msapplication-navbutton-color" content="#151515">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- end theme color meta headers -->
9 changes: 9 additions & 0 deletions _includes/head-custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- start custom head snippets, customize with your own _includes/head-custom.html file -->

<!-- Setup theme-color. -->
{% include head-custom-theme-colors.html %}

<!-- You can set your favicon here. -->
<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->

<!-- end custom head snippets -->
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
{% include head-custom.html %}

{% seo %}
</head>
Expand Down

0 comments on commit 8367f9d

Please sign in to comment.