diff options
author | Hugo Aguirre <bul-ikana@users.noreply.github.com> | 2020-10-19 04:48:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 04:48:49 +0300 |
commit | 1785f7722183aca70c3f84b9841a0f0d8cd88519 (patch) | |
tree | 3b7ec7954a50797ebe8bd42373c5dbf2f030dad8 | |
parent | 73f2ccace66f3490ed5921522b784d4227c02988 (diff) | |
parent | d2a88cb149fc76628c863c788597d816850a92b0 (diff) |
Merge pull request #20 from bul-ikana/dev
Dev
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | exampleSite/content/posts/documentation/image-5.png (renamed from static/images/image-5.png) | bin | 5043 -> 5043 bytes | |||
-rw-r--r-- | exampleSite/content/posts/documentation/index.md (renamed from exampleSite/content/posts/documentation.md) | 0 | ||||
-rw-r--r-- | exampleSite/content/posts/elements/image-4.png (renamed from static/images/image-4.png) | bin | 5227 -> 5227 bytes | |||
-rw-r--r-- | exampleSite/content/posts/elements/index.md (renamed from exampleSite/content/posts/elements.markdown) | 0 | ||||
-rw-r--r-- | exampleSite/content/posts/installation/image-3.png (renamed from static/images/image-3.png) | bin | 5273 -> 5273 bytes | |||
-rw-r--r-- | exampleSite/content/posts/installation/index.md (renamed from exampleSite/content/posts/installation.markdown) | 2 | ||||
-rw-r--r-- | exampleSite/content/posts/no-image/index.md (renamed from exampleSite/content/posts/no-image.markdown) | 2 | ||||
-rw-r--r-- | exampleSite/content/posts/usage/image-2.png (renamed from static/images/image-2.png) | bin | 5444 -> 5444 bytes | |||
-rw-r--r-- | exampleSite/content/posts/usage/index.md (renamed from exampleSite/content/posts/usage.markdown) | 2 | ||||
-rw-r--r-- | exampleSite/content/posts/welcome-to-hugo/image-1.png (renamed from static/images/image-1.png) | bin | 5306 -> 5306 bytes | |||
-rw-r--r-- | exampleSite/content/posts/welcome-to-hugo/index.md (renamed from exampleSite/content/posts/welcome-to-hugo.markdown) | 2 | ||||
-rw-r--r-- | layouts/_default/list.html | 6 | ||||
-rw-r--r-- | layouts/partials/seo.html | 2 | ||||
-rw-r--r-- | layouts/partials/sidebar.html | 8 | ||||
-rw-r--r-- | layouts/taxonomy/tag.html | 6 | ||||
-rw-r--r-- | static/css/custom.css | 1 |
18 files changed, 34 insertions, 15 deletions
@@ -10,6 +10,17 @@ Responsive theme built on bootstrap. Great for showcasing content with featured Easily add disqus, google analytics, social links and a facebook like box. +## Customization + +### Images +To change the featured image of your post, you must provide a `img` param in your post front-matter. This theme now supports [page resources](https://gohugo.io/content-management/page-resources/) so your featured image should be in the same directory than your `index.md` post file. + +If you don't include one, a default image will be used. You can also customize this default image by changing the `defaultImage` param in your theme config. Be aware that this default image should be located on your `static/images` directory + +### CSS +There is a `custom.css` file included where you can write and override any style you need. If you need additional files, you can add their relative links to the `custom_css` param in the theme config. + + ## Configuration Please see the sample [`config.toml`](https://github.com/bul-ikana/hugo-cards/blob/master/exampleSite/config.toml). @@ -52,8 +63,3 @@ The Google Analytics tracking ID #### disqus The disqus_thread ID - -### Customization - -#### custom_css -Relative links with custom.css files. This will let yout overwrite the theme's CSS.
\ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 73de99d..c1b498e 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -23,7 +23,7 @@ paginate = 6 analytics = "" disqus = "" - #custom_css = ["css/custom.css"] + custom_css = ["css/custom.css"] [params.copyright] name = "bool" diff --git a/static/images/image-5.png b/exampleSite/content/posts/documentation/image-5.png Binary files differindex 46520dd..46520dd 100644 --- a/static/images/image-5.png +++ b/exampleSite/content/posts/documentation/image-5.png diff --git a/exampleSite/content/posts/documentation.md b/exampleSite/content/posts/documentation/index.md index fac87f7..fac87f7 100644 --- a/exampleSite/content/posts/documentation.md +++ b/exampleSite/content/posts/documentation/index.md diff --git a/static/images/image-4.png b/exampleSite/content/posts/elements/image-4.png Binary files differindex f7f46e8..f7f46e8 100644 --- a/static/images/image-4.png +++ b/exampleSite/content/posts/elements/image-4.png diff --git a/exampleSite/content/posts/elements.markdown b/exampleSite/content/posts/elements/index.md index dafacbe..dafacbe 100644 --- a/exampleSite/content/posts/elements.markdown +++ b/exampleSite/content/posts/elements/index.md diff --git a/static/images/image-3.png b/exampleSite/content/posts/installation/image-3.png Binary files differindex afd37c2..afd37c2 100644 --- a/static/images/image-3.png +++ b/exampleSite/content/posts/installation/image-3.png diff --git a/exampleSite/content/posts/installation.markdown b/exampleSite/content/posts/installation/index.md index c12ee67..3565660 100644 --- a/exampleSite/content/posts/installation.markdown +++ b/exampleSite/content/posts/installation/index.md @@ -2,7 +2,7 @@ layout: post title: "Installation" img: image-3.png -categories: [one] +categories: ["one", "two"] tags: ["tag_c"] date: 2016-05-09 --- diff --git a/exampleSite/content/posts/no-image.markdown b/exampleSite/content/posts/no-image/index.md index ffbd961..51befdc 100644 --- a/exampleSite/content/posts/no-image.markdown +++ b/exampleSite/content/posts/no-image/index.md @@ -1,7 +1,7 @@ --- layout: post title: "Post with no image" -category: two +categories: ["one", "two"] date: 2016-06-09 --- When there is no image mentioned in the front-matter, default image will be displayed. You can change this image to any other one that suits your needs. diff --git a/static/images/image-2.png b/exampleSite/content/posts/usage/image-2.png Binary files differindex bbb10e5..bbb10e5 100644 --- a/static/images/image-2.png +++ b/exampleSite/content/posts/usage/image-2.png diff --git a/exampleSite/content/posts/usage.markdown b/exampleSite/content/posts/usage/index.md index 83ef94a..d2ee021 100644 --- a/exampleSite/content/posts/usage.markdown +++ b/exampleSite/content/posts/usage/index.md @@ -1,7 +1,7 @@ --- title: "Usage Guide" img: image-2.png -categories: [two] +categories: ["one", "two"] date: "2016-06-12" --- diff --git a/static/images/image-1.png b/exampleSite/content/posts/welcome-to-hugo/image-1.png Binary files differindex 872df82..872df82 100644 --- a/static/images/image-1.png +++ b/exampleSite/content/posts/welcome-to-hugo/image-1.png diff --git a/exampleSite/content/posts/welcome-to-hugo.markdown b/exampleSite/content/posts/welcome-to-hugo/index.md index f61f9c1..e786706 100644 --- a/exampleSite/content/posts/welcome-to-hugo.markdown +++ b/exampleSite/content/posts/welcome-to-hugo/index.md @@ -1,5 +1,5 @@ --- -title: "Welcome to Hugo!" +title: "Welcome to Hugox!" date: 2016-06-13 10:51:47 +0530 img: "image-1.png" categories: [one, two] diff --git a/layouts/_default/list.html b/layouts/_default/list.html index e1cd83d..dde78d5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -12,7 +12,11 @@ <div class="panel panel-default"> {{ if .Params.img }} - <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Params.img }}" alt="{{ .Title }}"> + {{ with .Resources.Match .Params.img }} + {{ range . }} + <img width="100%" src="{{ .RelPermalink }}" alt="{{ .Title }}"> + {{ end }} + {{ end }} {{ else }} <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Site.Params.defaultImage }}" alt="{{ .Site.Title }}"> {{ end }} diff --git a/layouts/partials/seo.html b/layouts/partials/seo.html index 817da4e..724f0e4 100644 --- a/layouts/partials/seo.html +++ b/layouts/partials/seo.html @@ -30,7 +30,7 @@ "@type": "Person", "name": "{{ .Site.Params.author }}" }, - "description": "{{ .Site.Params.description }}", + "description": "{{ .Site.Params.description }}" } </script> {{ end }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 1c5d9f5..155ce70 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,7 +1,11 @@ <div class="col-md-4 mt20"> <div class="post-img"> - {{ if .Params.img }} - <img width="600" src="{{ .Site.BaseURL}}images/{{ .Params.img }}" alt="{{ .Params.title }}"> + {{ if .Params.img }} + {{ with .Resources.Match .Params.img }} + {{ range . }} + <img width="100%" src="{{ .RelPermalink }}" alt="{{ .Title }}"> + {{ end }} + {{ end }} {{ else }} <img width="600" src="{{ .Site.BaseURL }}images/{{ .Site.Params.defaultImage }}" alt="webjeda"> {{ end }} diff --git a/layouts/taxonomy/tag.html b/layouts/taxonomy/tag.html index 8fb638d..7d12b65 100644 --- a/layouts/taxonomy/tag.html +++ b/layouts/taxonomy/tag.html @@ -12,7 +12,11 @@ <div class="panel panel-default"> {{ if .Params.img }} - <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Params.img }}" alt="{{ .Title }}"> + {{ with .Resources.Match .Params.img }} + {{ range . }} + <img width="100%" src="{{ .RelPermalink }}" alt="{{ .Title }}"> + {{ end }} + {{ end }} {{ else }} <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Site.Params.defaultImage }}" alt="{{ .Site.Title }}"> {{ end }} diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..6869376 --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1 @@ +/*Add your custom css here. This will override any existinc thems css*/
\ No newline at end of file |