diff options
author | Rafed Muhammad Yasir <rafed123@yahoo.com> | 2020-05-03 22:29:11 +0300 |
---|---|---|
committer | Rafed Muhammad Yasir <rafed123@yahoo.com> | 2020-05-03 22:29:11 +0300 |
commit | 887f2619640e5cf1b4c19594741fef474fd8c323 (patch) | |
tree | 094ea030aa046725ecfd01d5902ea4bbccbddb4b | |
parent | d8a5c1c9d05d960c02d136a42c5d0d8262617fff (diff) |
Refactored index/404 page
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | layouts/404.html | 74 | ||||
-rw-r--r-- | layouts/index.html | 68 | ||||
-rw-r--r-- | layouts/partials/index/list-blog-brief.html | 18 | ||||
-rw-r--r-- | layouts/partials/index/section-bullet.html | 27 | ||||
-rw-r--r-- | layouts/partials/index/tag-bullet.html | 32 |
6 files changed, 89 insertions, 137 deletions
@@ -64,19 +64,18 @@ theme = "ramium" title = "Ramium" disqusShortname = "disqus-code" googleAnalytics = "analytics-code" -summaryLength = 40 pluralizeListTitles = false enableemoji = false [params] description = "A description for the meta tag of the site" googleSearch = "google-search-code" - showDate = true # make false if dont want to show date + showDate = true # make false if dont want to show date for evergeen articles math = false # best to enable this in the front matter of a page githubLink = "rafed/ramium/" - tagsInHome = 40 - sectionsInHome = 5 + tagsInHome = 40 # set zero to not show in home page + sectionsInHome = 5 # set zero to not show in home page paginatePostsPerPage = 5 paginateTagsPerPage = 6 diff --git a/layouts/404.html b/layouts/404.html index 16f4217..3a5962c 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -14,82 +14,20 @@ Here's what may have happened: </h1> <h1 class="subtitle is-6"> - 1. The page does not exist + 1. The page was moved to another location. You can search for it above. </h1> <h1 class="subtitle is-6"> - 2. The page was moved to another location. Use the search bar above + 2. The page was removed. You can read another one from below. </h1> <h1 class="subtitle is-6"> - 3. The content was removed. Read an article from below. + 3. This page never existed </h1> </div> </div> </section> -<div class="columns is-centered has-text-centered"> - <div class="column is-10"> - <div class="content"> - <a href="{{ "/tags/" | relURL }}"> - <h1>Read articles by tags</h1> - </a> - <p class="tags-summary"> - {{ $randTags := (slice)}} - {{ range $name, $taxonomy := .Site.Taxonomies.tags }} - {{ $randTags = $randTags | append $name }} - {{ end }} - {{ $randTags = sort (first .Site.Params.TagsInHome (shuffle $randTags)) }} - - {{ range $name := $randTags }} - <a href="{{ "/tags/" | relURL }}{{ $name | urlize }}"> - <span class="tag is-dark is-large is-rounded"> - {{ $name | humanize }} - </span> - </a> - {{ end }} - </p> - </div> - </div> -</div> -<br> - -<div class="columns is-centered has-text-centered"> - <div class="column is-10"> - <div class="content"> - <a href="{{ "/sections/" | relURL }}"> - <h1>Sections</h1> - </a> - <p class="tags-summary"> - {{ $randSections := shuffle (where .Site.Sections ".Title" "not in" "Posts Addons") }} - {{ range sort (first .Site.Params.SectionsInHome $randSections) "Title" }} - <a href="{{ .RelPermalink }}"> - <span class="tag is-dark is-large"> - {{ .Title | humanize | title }} - </span> - </a> - {{ end }} - </p> - </div> - </div> -</div> -<br> - -<div class="columns is-centered"> - <div class="column is-7"> - <div class="content"> - <a href="{{ "/posts/" | relURL }}"> - <h1 class="is-3">Recent posts</h1> - </a> - </div> - {{ range first 5 (where .Site.RegularPages.ByPublishDate.Reverse ".Section" "not in" "addons") }} - {{- partial "blog-brief.html" . -}} - {{ end }} - - <div class="content"> - <a href="{{ "/posts/" | relURL }}"> - <h4 class="has-text-centered seeall">See all</h4> - </a> - </div> - </div> -</div> +{{- partial "index/tag-bullet.html" . -}} +{{- partial "index/section-bullet.html" . -}} +{{- partial "index/list-blog-brief.html" . -}} {{ end }}
\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 76c7910..0be1372 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -20,70 +20,8 @@ </div> </section> -<div class="columns is-centered has-text-centered"> - <div class="column is-10"> - <div class="content"> - <a href="{{ "/tags/" | relURL }}"> - <h1>Read articles by tags</h1> - </a> - <p class="tags-summary"> - {{ $randTags := (slice)}} - {{ range $name, $taxonomy := .Site.Taxonomies.tags }} - {{ $randTags = $randTags | append $name }} - {{ end }} - {{ $randTags = sort (first .Site.Params.TagsInHome (shuffle $randTags)) }} - - {{ range $name := $randTags }} - <a href="{{ "/tags/" | relURL }}{{ $name | urlize }}"> - <span class="tag is-dark is-large is-rounded"> - {{ $name | humanize }} - </span> - </a> - {{ end }} - </p> - </div> - </div> -</div> -<br> - -<div class="columns is-centered has-text-centered"> - <div class="column is-10"> - <div class="content"> - <a href="{{ "/sections/" | relURL }}"> - <h1>Sections</h1> - </a> - <p class="tags-summary"> - {{ $randSections := shuffle (where .Site.Sections ".Title" "not in" "Posts Addons") }} - {{ range sort (first .Site.Params.SectionsInHome $randSections) "Title" }} - <a href="{{ .RelPermalink }}"> - <span class="tag is-dark is-large"> - {{ .Title | humanize | title }} - </span> - </a> - {{ end }} - </p> - </div> - </div> -</div> -<br> - -<div class="columns is-centered"> - <div class="column is-7"> - <div class="content"> - <a href="{{ "/posts/" | relURL }}"> - <h1 class="is-3">Recent posts</h1> - </a> - </div> - {{ range first 5 (where .Site.RegularPages.ByPublishDate.Reverse ".Section" "not in" "addons") }} - {{- partial "blog-brief.html" . -}} - {{ end }} - - <div class="content"> - <a href="{{ "/posts/" | relURL }}"> - <h4 class="has-text-centered seeall">See all</h4> - </a> - </div> - </div> -</div> +{{- partial "index/tag-bullet.html" . -}} +{{- partial "index/section-bullet.html" . -}} +{{- partial "index/list-blog-brief.html" . -}} {{ end }}
\ No newline at end of file diff --git a/layouts/partials/index/list-blog-brief.html b/layouts/partials/index/list-blog-brief.html new file mode 100644 index 0000000..120b034 --- /dev/null +++ b/layouts/partials/index/list-blog-brief.html @@ -0,0 +1,18 @@ +<div class="columns is-centered"> + <div class="column is-7"> + <div class="content"> + <a href="{{ "/posts/" | relURL }}"> + <h1 class="is-3">Recent posts</h1> + </a> + </div> + {{ range first 5 (where .Site.RegularPages.ByPublishDate.Reverse ".Section" "not in" "addons") }} + {{- partial "blog-brief.html" . -}} + {{ end }} + + <div class="content"> + <a href="{{ "/posts/" | relURL }}"> + <h4 class="has-text-centered seeall">See all</h4> + </a> + </div> + </div> +</div>
\ No newline at end of file diff --git a/layouts/partials/index/section-bullet.html b/layouts/partials/index/section-bullet.html new file mode 100644 index 0000000..183e5a3 --- /dev/null +++ b/layouts/partials/index/section-bullet.html @@ -0,0 +1,27 @@ +{{ if ne .Site.Params.SectionsInHome 0 }} + +{{ $randSections := shuffle (where .Site.Sections ".Title" "not in" "Posts Addons") }} +{{ if gt (len $randSections) 1 }} + +<div class="columns is-centered has-text-centered"> + <div class="column is-10"> + <div class="content"> + <a href="{{ "/sections/" | relURL }}"> + <h1>Sections</h1> + </a> + <p class="tags-summary"> + {{ range sort (first .Site.Params.SectionsInHome $randSections) "Title" }} + <a href="{{ .RelPermalink }}"> + <span class="tag is-dark is-large"> + {{ .Title | humanize | title }} + </span> + </a> + {{ end }} + </p> + </div> + </div> +</div> +<br> + +{{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/index/tag-bullet.html b/layouts/partials/index/tag-bullet.html new file mode 100644 index 0000000..d5ebf5f --- /dev/null +++ b/layouts/partials/index/tag-bullet.html @@ -0,0 +1,32 @@ +{{ if ne .Site.Params.TagsInHome 0 }} + +{{ $randTags := (slice)}} +{{ range $name, $taxonomy := .Site.Taxonomies.tags }} +{{ $randTags = $randTags | append $name }} +{{ end }} +{{ $randTags = sort (first .Site.Params.TagsInHome (shuffle $randTags)) }} + +{{ if gt (len $randTags) 1 }} + +<div class="columns is-centered has-text-centered"> + <div class="column is-10"> + <div class="content"> + <a href="{{ "/tags/" | relURL }}"> + <h1>Read articles by tags</h1> + </a> + <p class="tags-summary"> + {{ range $name := $randTags }} + <a href="{{ "/tags/" | relURL }}{{ $name | urlize }}"> + <span class="tag is-dark is-large is-rounded"> + {{ $name | humanize }} + </span> + </a> + {{ end }} + </p> + </div> + </div> +</div> +<br> + +{{ end }} +{{ end }}
\ No newline at end of file |