1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-24 21:20:17 +01:00
Commit Graph

87 Commits

Author SHA1 Message Date
6945b0de20
layouts/_default/single.html: Improve Schema.org keywords
Use delimit function over a union of Categories and Tags. This is
much easier to read, results in correct delimiting with no trailing
comma, and works even if one of the slices is nil.
2017-07-07 16:25:56 +03:00
1311adde33
layouts: Revert to built-in Disqus template
Hugo 0.25 improved the embedded Disqus template so we can just use
theirs now.

See: https://github.com/gohugoio/hugo/pull/3655
See: https://github.com/gohugoio/hugo/pull/3639
2017-07-07 15:31:17 +03:00
a81ed6803b
layouts/_default/baseof.html: Allow disabling of SRI
Some sites using edge caching like that on a CDN or S3 might have
issues with assets being cached too long, causing user agents to
refuse to load assets due to SRI hash mismatch. These sites should
disable the use of sub-resource integrity hashes using this config
option in their config:

    disable_sri = true
2017-04-12 21:38:10 +03:00
Mike Lococo
2e5eef29a6 Add option to control post truncation. 2017-04-04 12:45:11 +03:00
e7749e9bde
layouts/_default/baseof.html: Don't create whitespace
Cleans up some template logic so that extra, unnecessary whitespace
isn't created during site generation.
2017-04-04 12:21:52 +03:00
77671af35d
layouts/: Use absLangURL to determine active page in menu
On sites with multiple languages we need to use the absolute URL in
the test to determine if the current page should be marked "active"
in the menu bar. Perhaps a bug with Hugo that relative links end up
like "/bg/bg/about" instead of "/bg/about".
2017-04-04 12:03:07 +03:00
09d089f214
layouts/_default/baseof.html: Remove trailing whitespace 2017-04-04 11:54:30 +03:00
zidenis
e811b25fdc highlights the current navbar menu entry 2017-04-04 11:53:38 +03:00
e2ccfe8bf3
Clean up empty whitespace in JSON-LD
Use secret formatting feature of Go templates, adding - to blocks
to clear whitespace around the tags.
2017-03-24 16:49:26 +02:00
d554b6bead
layouts/_default/single.html: Only get imageConfig on local images
Don't try to get image information when the image isn't local. We
generally expect that images are in the local filesystem's static
directory, but if the user has specified a remote image—ie, with
an http:// or https:// prefix—then we shouldn't try imageConfig.
2017-03-24 16:31:50 +02:00
3b3598960c
Revert "Revert "layouts: Add imageConfig to set height and width""
This reverts commit 5e1b0f40ab.
2017-03-24 16:02:44 +02:00
5e1b0f40ab Revert "layouts: Add imageConfig to set height and width"
This reverts commit bf9bca9656.

If the user specifies a non-local image then the build generates
an error. See #56. We need to have a way to only get imageInfo for
local images...
2017-03-24 11:07:20 +02:00
Caleb Cushing
2e6a27300e add previous and next relations (#55)
* add previous and next relations

https://www.w3.org/TR/html5/links.html#link-type-next

* undo rel's on disabled buttons
2017-03-24 10:59:41 +02:00
bf9bca9656
layouts: Add imageConfig to set height and width
Hugo 0.18 introduced the imageConfig function which allows you to
access the height and width of images, which makes bots consuming
the structured data happy.
2017-02-21 08:24:01 +02:00
4d7a544dac
layouts: Quote some parameters in JSON LD
Current Hugo 0.19-DEV doesn't quote these anymore, so we need to
add quotes manually. I'm not sure if this is a design decision or
not on Hugo's part.
2017-02-21 08:17:19 +02:00
d6cc7839ef
layouts/_default/list.html: Use .Date for modification time on nodes
I'm not sure if it really matters to bots who will parse this (it's
much more important on content pages of course), but using .Date on
nodes like the homepage and taxonomy terms pages will set the date
to be that of the latest post in that range—to me this does indeed
seem to be "time when the object was last updated"[0].

[0] https://developers.facebook.com/docs/reference/opengraph/object-type/website/
2017-01-22 14:58:13 +02:00
2459ad9567
layouts/_default/single.html: Simplify sharing icon logic
Allowing users to select specific icons they want to show makes the
configuration and logic a bit tricky. A user brought up the case of
disabling sharing icons on certain pages/posts, and it was actaully
not possible without adding lots of extra logic, not to mention the
pain of having to test all possible configurations.

Instead, it is much simpler to just allow sharing icons to be either
on or off as desired in the site config or page/post frontmatter:

  sharingicons = false

Otherwise, sharing icons default to being enabled, as this is most
in line with what would be expected on a "blog".
2017-01-21 19:16:57 +02:00
8ab05ae625
Add Schema.org implementation based on JSON-LD
This replaces the metadata that Hugo's own schema.html template had
been providing, but does so in JSON-LD notation rather than via the
use of <meta> tags (this is Google's currently recommended form of
specifying this markup). There are a few exceptions where I did not
follow the conventions used in Hugo's template, for example the use
of up to six images from a post's frontmatter, because Google's tool
only recognizes one image, as well as different logic for a post's
publish and modified dates (using enableGitInfo = true).

Using this new markup, Google's Structured Data Testing Tool is now
able to understand site metadata much better (before it was reading
none).

The implementation here is a mix of the elements and types from the
official Schema.org types—for example, Blog and BlogPosting—as well
as from Google's search documentation. Note that Google's docs are
geared towards AMP, where some metadata is required, while for non-
AMP pages the metadata is just recommended.

We will have to re-evaluate this in the future, for example to add
height and width information to image metadata.

See: https://schema.org/Blog
See: https://schema.org/BlogPosting
See: https://developers.google.com/search/docs/data-types/data-type-selector
See: https://search.google.com/structured-data/testing-tool
2017-01-20 15:58:30 +02:00
0e381ab120
Start using SRI hashes for CSS/JS assets
Uses Hugo's site data mechanism to load pre-generated asset hashes.
2017-01-11 10:42:49 +02:00
1f6cc0cf42
layouts/_default/single.html: Adjust Disqus logic
Bring the Disqus comments inside the <article> tag. The article has
a sizeable bottom margin seprating it from the blog footer, and if
Disqus comments are active they appear after this margin, and this
looks ugly.

Semantically, I think the comments should actually be inside the
article tag anyways (since they are directly related), as well as
further wrapped in article tags, but we don't control the code that
Disqus injects so we'll have to make do with this.

See: https://www.w3.org/TR/html5/sections.html#the-article-element
2017-01-07 11:22:45 +02:00
af39372a24
layouts/_default/baseof.html: Revert to simple "read more" link
Prepending the site's URL to relative links was a hack but at the
time I couldn't understand why href="#" didn't take us to the top
of the page. It turns out that this was because of the <base> tag
that I have now removed.
2017-01-05 15:23:09 +02:00
fa0df752a1
layouts/_default/baseof.html: Remove base tag
It was screwing up relative links like the ones in footnotes. I'm
not sure why I added it in the first place, actually, as the docs
specifically say "specifies the base URL to use for all relative
URLs contained within a document".

See: https://developer.mozilla.org/en/docs/Web/HTML/Element/base
2017-01-05 15:20:29 +02:00
ffb8487c13
layouts/_default/baseof.html: Remove second RSS link
link tags with rel="feed" don't seem to be valid. They are flagged
by the w3c validator and modern documentation only mentions the use
of rel="alternate", which we are already using.

See: https://validator.w3.org
See: https://developer.mozilla.org/en-US/docs/Web/RSS/Getting_Started/Syndicating
2017-01-05 14:34:10 +02:00
8616dd8c10
layouts/_default/baseof.html: Use .Site.RegularPages instead of .Site.Pages
Hugo 0.18 changes the pages returned by .Site.Pages, so we need to
use .Site.RegularPages in order to test the type.

See: https://github.com/spf13/hugo/releases/tag/v0.18
See: https://gohugo.io/templates/variables#site-variables
2016-12-25 17:56:24 +02:00
61201274fb
layouts/_default/single.html: Allow disabling of comments
To disable comments for a single page, set "comments = false" in
its frontmatter.
2016-12-24 17:18:03 +02:00
Mathieu GAUTHIER-LAFAYE
89f87e050b the "Back on top" link is now translatable. 2016-12-09 15:37:53 +01:00
DeedleFake
d0c9781d74 Add Permalink as prefix to back to top link href. (#22) 2016-11-29 17:07:28 +02:00
b52fac69b1
layouts: retab after addition of modelines
Done in vim using `gg=G` and then `:retab`.
2016-11-24 14:39:39 +02:00
DeedleFake
663f3db2a0 Add Vim Modeline Comments to Files (#18)
* Add Vim modeline comments to all relevent template files.

* Add Vim modeline comments to a few other files.

* Move modeline comments inside the template definitions in list and single.

For some odd reason, putting them outside breaks the page generation.

* Use template comments for modeline comments in templates.

* Fix form 2 modelines.
2016-11-24 14:33:56 +02:00
DeedleFake
b83b1683a7 Add ability to insert custom code into the global <head>. (#17)
* Add ability to insert custom code into the global <head>.
* Fix indentation.
2016-11-22 21:11:50 +02:00
abfc8ad15c
Make "→" in "Read more" part of the i18n strings
Eventually I'd like to support right-to-left languages like Arabic
and we'd need the arrow to point the other way for that.
2016-11-20 12:14:46 +02:00
Rassie Smit
aa7bd11522 Add custom navbar support
- default behaviour is backward compatible: all non-post pages
- optionally enable custom navbar using hugo menu functionality
2016-11-17 10:04:14 +00:00
Bjørn Erik Pedersen
a6ebe0a0b3 Rename RSSlink to RSSLink
The former will be deprecated and eventually removed from Hugo.

Note: Currently both of them exist in Hugo, which is the reason for the cleanup.
2016-11-17 09:12:17 +01:00
a66be324cc
Add plumbing for cookie consent
Set the cookie_consent_info_url parameter in your site's config to
display a message about cookie usage to your users. See the config
in `exampleSite/config.toml` for more info.
2016-11-13 14:13:17 +02:00
1f14455b12
layouts/_default/baseof.html: Don't indent go blocks
They get indented doubly in the generated HTML and look funny.
2016-11-09 15:42:39 +02:00
929d2d976a
layouts/_default/baseof.html: Improve handling of RSS
We are explicitly using the site's RSS feed, but after reading the
Hugo RSS docs I think it's better if we use the contextual version
of the RSSlink. This will make the RSS plumbing show a feed for the
current category, tag, section, etc. The example code also adds a
bit of markup to help browsers find the content more easily.

See: https://gohugo.io/templates/rss/
2016-11-09 15:39:23 +02:00
Frank Tegtmeyer
b81d5c54da Disqus integration for single nodes. 2016-11-01 15:25:44 +01:00
9d4d062152
layouts/_default/baseof.html: Remove optional sidebar hiding
As it is right now, the sidebar gets hidden but the blog's main
content stays on the left. Gotta look at the CSS to make the
container responsive.
2016-10-18 23:06:19 -04:00
2abe8b1cd3
layouts/_default/list.html: Only show pagination if necessary 2016-10-18 22:53:14 -04:00
cdcae6c8a4
layouts: Don't assume date_format is defined
User can override the date format with date_format, but we should
have a default in the case that the user hasn't defined it.
2016-10-17 23:39:41 -04:00
c49fa721ec
layouts/_default/baseof.html: Add support for Google Analytics
Sites only need to add their Google Analytics tracking ID to their
config:

  googleAnalytics = "UA-123-45"

This uses the async version of the Google Analytics code.
2016-10-14 22:10:01 -04:00
6e84974d2a
layouts/_default/baseof.html: Add "back to top" link in footer 2016-10-09 13:45:38 +03:00
142d330048
layouts/_default/baseof.html: Give credit to @mdo for theme 2016-10-09 13:38:49 +03:00
77b2cf9955
layouts/_default/baseof.html: Allow configuration of footer text
Uses the "copyright" parameter from the site's config that is pretty
standard among Hugo themes. Content can contain Markdown.
2016-10-09 13:36:07 +03:00
577fdd75ce
layouts/_default/single.html: Markdownify page title
In a multilingual context a post's title could be "Title" in English
but «Title» in Bulgarian, and if we apply the Markdown filter to the
title tag, then the language's Black Friday configuration is used,
in this example it would be for the angled quotes.

We already do this everywhere else we can in the post's content, so
let's match it in the page title.
2016-10-06 15:05:44 +03:00
d6328c34df
Remove anchor titles
I had only added these for accessibility, but after some research
it seems that assistive technologies don't use these.
2016-10-06 14:21:30 +03:00
3a6bed5be7
layouts: Use Markdown filter on titles
This makes it possible to have Black Friday config options like
quote style also affect post titles.
2016-10-06 14:17:59 +03:00
36a8a28d4c
layouts/_default/list.html: Remove debug code from pagination 2016-10-05 17:28:08 +03:00
a8d694d08c
Add pagination logic + i18n strings for en 2016-10-05 17:21:53 +03:00
70b4844c63
layouts/_default/list.html: Use paginator for page lists instead of custom stuff
Hugo's own pagination stuff works just as well and probably covers
even more corner cases. Also, this is one less config variable to
have to check because you can just use Paginate (Default: 10).
2016-10-05 15:45:38 +03:00