1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-16 01:07:03 +01:00
Commit Graph

565 Commits

Author SHA1 Message Date
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
81a7431a0a
Regenerate style and SRI hashes 2017-03-16 15:41:50 +02:00
132d659955
source/scss/main.scss: Add style to blockquote tags
Bootstrap's default only styles blockquote tags that also have the
class "blockquote". As Hugo's Markdown syntax for blockquotes only
produces bare blockquote tags, we should apply the same style to
those as well, as this is most likely what users expect.
2017-03-16 15:38:59 +02:00
7c1502ff3e
README.md: Add note about being opinionated 2017-03-15 23:57:05 +02:00
e23619e6fb Merge pull request #49 from lpar/master
Add caching of last N posts in sidebar to improve performance
2017-03-12 12:28:15 +02:00
mathew
6d027091d4 Add caching of last N posts in sidebar to improve performance 2017-03-11 16:20:50 -06:00
04ff763688
Revert to using Hugo's own OpenGraph template
I had overridden Hugo's OpenGraph template to improve it, but those
changes have been upstreamed in Hugo 0.19. We can use theirs now.

See: https://github.com/spf13/hugo/pull/3073
2017-02-21 16:14:13 +02:00
18863075c5
Revert to Hugo's own Twitter Cards partial
I had overridden it in the theme to improve the metadata generated
by it. Hugo has accepted the changes upstream so we can use theirs
now.

See: https://github.com/spf13/hugo/pull/2984
2017-02-21 15:03:17 +02:00
7553a6f11d
theme.toml: Bump minimum version to 0.19 2017-02-21 08:27:36 +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
0e5937b1b7
package.json: Match node-sass version with Bootstrap
From the package.json used by the Bootstrap project, see:

    https://github.com/twbs/bootstrap/blob/v4-dev/package.json
2017-02-15 14:51:31 +02:00
0fd9fd6f28
Regenerate style.css and subresource integrity hashes 2017-02-15 12:39:56 +02:00
753d7f4ad9
package.json: Update clean-css and build scripts
Bootstrap had previously been staying with clean-css < 4.0 because
it introduced some backwards incompatible changes[0], but now I see
that they have started using the new version.

I have also updated the npm build scripts to take into account the
name change to "clean-css-cli" as well as the latest minification
options that are being used by Bootstrap themselves[1].

[0] https://github.com/jakubpawlowicz/clean-css#important-40-breaking-changes
[1] https://github.com/twbs/bootstrap/blob/v4-dev/package.json
2017-02-15 12:38:03 +02:00
ae207b8ba9
Use 1280x720 screenshot again
I don't know how to make this screenshot look nice on GitHub and
Hugo's theme showcase–it always looks blurry!
2017-02-01 08:45:13 +02:00
4852f14f42
screenshot.png: Try screenshot with 640x360 resolution 2017-01-31 20:27:03 +02:00
81859bdc5d
README.md: Replace screenshot with less blurry one 2017-01-31 20:04:06 +02:00
9a6b546e86
Update screenshot
Instead of taking the screenshot of the whole window, I used the
screenshot function in Firefox's responsive design mode to specify
the exact dimensions I wanted.
2017-01-31 15:49:50 +02:00
3bde18f456 Merge pull request #47 from ardianta/master
Add Indonesian language
2017-01-25 09:32:59 +02:00
Ardianta Pargo
74b5090312 Add Indonesian language 2017-01-25 11:55:58 +08:00
04e5bc56de
README.md: Remove npm packages badge
The image seems to be broken any time I look at it on the GitHub
repository page despite being fine if you click it and view the
original on david-dm.org.
2017-01-24 12:39:59 +02:00
70a35f3030
README.md: Add note about enableGitInfo 2017-01-23 15:10:53 +02:00
d22b29567a
exampleSite/config.toml: Add comments to twitter option 2017-01-23 14:58:29 +02:00
40864e252e
layouts/partials/twitter_cards.html: Remove twitter:domain
This apparently used to exist but is no longer mentioned on the doc
page for Twitter Cards markup.

See: https://dev.twitter.com/cards/markup
2017-01-23 14:52:27 +02:00
a709b3b6a2
Import Hugo's Twitter cards partial from tpl/template_embedded.go
I want to see if I can improve the metadata here.
2017-01-23 14:51:44 +02:00
527bc0d824
layouts/partials/opengraph.html: Fix date for nodes
.Site.LastChange is the date of the last modification on the entire
site, not necessarily on the node we're currently showing, such as
a taxonomy list.
2017-01-22 16:31:38 +02:00
64d8bdab83
layouts/partials/opengraph.html: Work on OpenGraph tags
Better use of dates for ALL nodes/pages. I wrote extensive comments
as a note for when I eventually submit this upstream to Hugo.
2017-01-22 15:48:21 +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
868b5b3c13 layouts/partials/opengraph.html: Adjust .Params.audio block
Bring it back on the same line as the above, to make it more like
the Hugo template that we stole it from.

See: tpl/template_embedded.go
2017-01-22 14:01:28 +02:00
64541ef84e layouts/partials/opengraph.html: Improve date handling
Both the Facebook and OpenGraph documentation specify the usage of
article:published_time and article:modified_time tags for articles.
For websites, however, the Facebook documentation recommends the
og:updated_time tag instead.

See: https://developers.facebook.com/docs/reference/opengraph/object-type/article
See: http://ogp.me
See: https://developers.facebook.com/docs/reference/opengraph/object-type/website
2017-01-22 14:01:28 +02:00
2e04a8ce26 Import opengraph partial from Hugo
Hugo's current handling of dates in the opengraph partial needs
nome work to be more correct—for example: the usage of published
and updated times. This comes verbatim from the Hugo source tree.

See: tpl/template_embedded.go
2017-01-22 14:01:28 +02:00
d42c67b731
README.md: Add devDependencies badge
From David, which watches your dependencies and generates a badge
to show their status.

See: https://david-dm.org/
2017-01-22 13:59:02 +02:00
6758d9b26c
README.md: Add note about disabling sharing icons 2017-01-22 13:53:18 +02:00
9418abfdea
exampleSite/config.toml: Adjust sharing icon setting 2017-01-21 19:28:38 +02:00
5fadea283d
layouts/partials/sharing-icons.html: Icons are no longer configurable 2017-01-21 19:26:40 +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
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