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

426 Commits

Author SHA1 Message Date
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
4b768d9da4
layouts/partials/sidebar.html: Use .Site.RegularPages instead of .Site.Pages
As of Hugo 0.18 .Site.Pages now returns all pages, including pages,
home, taxonomies, etc, and you are expected to filter them by their
"kind". There is a new variable .Site.RegularPages which returns a
range of "regular" pages like in pre-0.18 Hugo.

In this instance we are limiting the range to pages with the type
"post", so our current behavior works, but I'd rather be consistent
with other ranges we're using, like on the homepage and taxonomy
list pages.

See: https://github.com/spf13/hugo/releases/tag/v0.18
2017-01-19 15:08:55 +02:00
b1f07d1bbc
layouts/partials/head-meta.html: Trim whitespace around tags
It's the right thing to do.
2017-01-19 14:57:03 +02:00
113eac717b
layouts/partials/head-meta.html: Use with insted of if
This is a more Hugo-like construct.
2017-01-19 14:54:49 +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
683755f95d
Add tooling to generate SRI hashes for assets
Subresource integrity allows user agents to verify that a fetched
resource has been delivered without unexpected manipulation[0]. I
put theme assets in a json configuration file and save the hashes
to a TOML file that Hugo loads via its theme data mechanism[1].

[0] https://www.w3.org/TR/SRI/
[1] https://gohugo.io/extras/datafiles/
2017-01-11 10:32:43 +02:00
c2d9b1ad74
i18n/bg.yaml: Add translation for "links" 2017-01-09 17:25:13 +02:00
e4bcfee4e0 static/css/style.css: Regenerate 2017-01-09 16:54:20 +02:00
a6a384cc82 Update margin around sharing icons for Bootstrap v4 Alpha 6
As of Alpha 6 there is no longer .nav-inline, so we need to add our
own class and apply our own margin.
2017-01-09 16:54:20 +02:00
7d85c9a740 source/scss/style.scss: Import local overrides last
It seems this is actually the preferred way to do it, but something
in the Bootstrap v4 Alpha 6 release—perhaps the upgraded version of
Normalize.css with that release—caused our styles to be overridden
and now I realize that it should have never been working before!
2017-01-09 16:54:20 +02:00
a3bd024e29 layouts/partials/head-meta.html: Remove IE meta tags
Bootstrap v4 Alpha 6 removes support for IE 8 and 9 and these tags
are no longer necessary.

See: https://github.com/twbs/bootstrap/pull/21483
2017-01-09 16:54:20 +02:00
e9d05dd97d source/scss/style.scss: Remove unused variables
Flexbox is enabled in Bootstrap v4 Aplha 6 by default and has no
fallback so these variables are unnecessary.
2017-01-09 16:54:20 +02:00
859ce04e0c source/scss/bootstrap.scss: Update against v4 alpha 6
See: node_modules/bootstrap/scss/bootstrap.scss
2017-01-09 16:54:20 +02:00
9ef73ed070 package.json: Bump Bootstrap v4 to alpha 6 2017-01-09 16:54:20 +02:00
0c264bb421
README.md: Add GitHub flavored Markdown to code block 2017-01-09 13:25:54 +02:00
c6d2538fd2
static/css/style.css: Regenerate 2017-01-09 12:07:48 +02:00
efe4f34651
package.json: Update cleancss invocation
The Bootstrap project uses --skip-advanced, so we should too. This
increases the size of style.css by ~4KiB but should be safer.

See: https://github.com/twbs/bootstrap/blob/v4-dev/package.json
2017-01-09 12:06:36 +02:00
55248b6492
README.md: Change wording about config.toml to "recommended"
The theme really needs some config options in order to look decent,
so I will change the wording here from "optional" to "recommended".

Hopefully some users actually read this rather sparse readme, as
there have been several GitHub issues opened due to misconfigured
sites.
2017-01-09 00:32:37 +02:00
c9c5771782
layouts/partials/sidebar.html: Check before using sidebar params
If the user's config doesn't have [params.sidebar] defined they get
errors when trying to build the site. It's better if we just check
that this config block is defined before trying to use it, and then
add something to the docs telling people that the site looks really
bad without this defined.
2017-01-09 00:14:11 +02:00
bcbc28b32b
static/css/style.css: Regenerate 2017-01-08 18:27:46 +02:00
a637d26d78
package.json: Update node-sass invocation
Since we're using cleancss there is no need to compress or optimize
anything in the node-sass step. Also, the Bootstrap project itself
is using the expanded output style as well so we should too.
2017-01-08 18:25:56 +02:00
58b466e692
static/css/style.css: Regenerate 2017-01-08 17:59:19 +02:00
89cb2d2b49
package.json: Remove cssnano
Now using clean-css.
2017-01-08 17:59:01 +02:00
aedf9f16db
package.json: Use clean-css to minify
The Bootstrap project itself uses this, so I think we should just
use it as well. As an added bonus we actually even save 2KiB from
the size of the generated style.css.
2017-01-08 17:57:36 +02:00
c85e8278b7
source/scss/style.scss: No file extensions in @import
sass-lint says you shouldn't use file extensions in @import.
2017-01-08 15:54:34 +02:00
1c1d7ee169
static/css/style.css: Regenerate 2017-01-07 21:47:40 +02:00
528f75fb0f
source/scss/font-awesome.scss: Add fa-rss-square 2017-01-07 21:46:59 +02:00
62f650a1eb
package.json: Peg Bootstrap v4 Alpha 5
Alpha v6 just came out and breaks everything, so let's just peg the
exact version we want for now.
2017-01-07 21:43:41 +02:00
e9747dd2f6
static/css/style.css: Regenerate 2017-01-07 21:43:11 +02:00
8236d92ac8
source/scss/font-awesome.scss: Add fa-rss 2017-01-07 21:39:13 +02:00
26459d378a
static/css/style.css: Regenerate style 2017-01-07 11:32:22 +02:00
25e5232a98
source/scss/main.scss: Add top margin to Disqus
When both sharing and Disqus blocks are present, the Disqus block
needs a top margin. Otherwise, if sharing is hidden, then the hr
following the blog post's article tag already provides enough of
a bottom margin.
2017-01-07 11:28:25 +02:00
325c5977c1
layouts/partials/sharing-icons.html: Adjust sharing block
Now the sharing block is siblings with the Disqus block and needs
to share its header.
2017-01-07 11:23:54 +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
61f08c0941
Regenerate cookieconsent assets 2017-01-04 13:17:38 +02:00
d91a73137f
package.json: Update cookieconsent to 3.0.4 2017-01-04 13:13:52 +02:00
567fa9d3dc
theme.toml: Update minimum Hugo version to 0.18 2016-12-25 17:59:27 +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
08a93fc71e
README.md: Add note about disabling comments on a post 2016-12-24 17:21:26 +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
03c2adb74c Merge pull request #29 from fte378/update_german
update for german translation
2016-12-11 21:01:34 +02:00
Frank Tegtmeyer
47d257e007 update for german translation 2016-12-11 19:04:55 +01:00
ff9dfdc266 Merge pull request #27 from gauthierl/i18n_fr
add french translation
2016-12-09 17:39:52 +02:00
6e753267d6 Merge pull request #28 from gauthierl/links
links in sidebar is not tranlatable
2016-12-09 17:38:03 +02:00
Mathieu GAUTHIER-LAFAYE
65b9847333 links in sidebar is now tranlatable 2016-12-09 16:35:13 +01:00
3d25006a4e Merge pull request #25 from gauthierl/back_to_top_link
the "Back on top" link is not translatable.
2016-12-09 17:03:05 +02:00