diff --git a/blog/hugolayout.md b/blog/hugolayout.md index 6989a37..7d37d15 100644 --- a/blog/hugolayout.md +++ b/blog/hugolayout.md @@ -491,7 +491,9 @@ If you're writing a `terms.html` you can find all page in the bundle with {{ end }} ``` -### Creating a search index using Scratch +### Search + +#### Creating a search index using Scratch @@ -518,6 +520,14 @@ We can utilise the Hugo command scratch, which creates a temporary scratch pad t {{- $.Scratch.Get "index" | jsonify -}} ``` +#### Creating a search page + +You can create a new `single.html` in `./layouts/search/`. + +Then you can create a new markdown file `index.md` in `./content/search`. + +This markdown file should set the `type` in the front matter - this should be set to `search` so it uses the search `single.html`. + ### SEO To optimise Hugo for SEO we can follow this guide: . @@ -751,3 +761,74 @@ Alternatively, you can do: {{ end }} ``` + +#### Favicon + +TODO: Create seperate note with link to generating a favicon for a project. + +You can generate a favicon here: . + +If you already have an icon you want to use, you can create a set of favicons out of it here: . + +You should add the following to the `head.html` to set the favicon and additional ios/android settings. Remember to set the `manifest.json`. + +```hugo + + + + + + + + +``` + +#### Search engine tags + +These tell google and other search engines that they can index and scrape the site. + +```hugo + + +``` + +#### Twitter/Facebook tags + +More information on these is here: . These are optional if you're not maintaining a facebook app to go alongside the website. + +```hugo + + + + +``` + +#### Other tags + +```hugo + + + + + + + + + + + + + + +``` + +#### Internal templates + +Hugo ships with internal templates for common metadata for sites: . + +```hugo +{{- template "_internal/opengraph.html" . -}} +{{- template "_internal/google_news.html" . -}} +{{- template "_internal/schema.html" . -}} +{{- template "_internal/twitter_cards.html" . -}} +``` diff --git a/blog/themes/hugo-theme-chunky-poster b/blog/themes/hugo-theme-chunky-poster index a2b62a3..71c99b0 160000 --- a/blog/themes/hugo-theme-chunky-poster +++ b/blog/themes/hugo-theme-chunky-poster @@ -1 +1 @@ -Subproject commit a2b62a370ba07825ad3c7a915de24a78ed35e6f2 +Subproject commit 71c99b07bf35060bad81d1a4b3f26bca59458317 diff --git a/tasks.todo b/tasks.todo index b5c76d8..3a3a104 100644 --- a/tasks.todo +++ b/tasks.todo @@ -24,12 +24,12 @@ Tasks: ✔ Change homepage description layout. @done (5/7/2020, 6:39:03 PM) ☐ Refactor front page like (https://www.educative.io/edpresso) + ☐ Another layout for cards (https://codewithhugo.com) ✔ Sort out colour scheme @done (5/5/2020, 4:09:10 AM) ✔ Document the taxonomies list page http://localhost:1313/authors/ @done (5/7/2020, 6:35:07 PM) ✔ Using scratch? @done (5/7/2020, 6:56:29 PM) Misc: - ☐ Add search to project ☐ Add social metadata ☐ Add Hugo notice (admonitions) (https://github.com/martignoni/hugo-notice) ✔ Add commento to project @done (5/4/2020, 4:59:34 AM) @@ -74,3 +74,17 @@ Tasks: Final build: ☐ Change the front matter for `_index.md` in `post`. + + Search: + ☐ Find simple CSS design for search bar. + ☐ Implement search using a library. + Notes: + - Search is done from the navbar, when enter is pressed, go to a html page for results? + Flow: + - Implement search in JS, have it return a js object + - Use JQuery to render a "card" with this metadata + - Using the title, the image and the tags etc + Links: + - https://codewithhugo.com/hugo-lunrjs-search-index/ + - https://gist.github.com/HugoDF/aac2e529f79cf90d2050d7183571684b + - https://git.sr.ht/~exprez135/mediumish-taliaferro/tree/master/layouts/search-page/search.html (recursive search for subdirectories)