1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2025-05-10 14:36:01 +02:00

64 Commits

Author SHA1 Message Date
ce3e6a933f CHANGELOG.md: Release v1.4.0 2020-01-28 11:01:34 +02:00
22001d38ea CHANGELOG.md: Update notes for unreleased version 2020-01-28 10:59:46 +02:00
d4ece493ba layouts/partials/meta-terms.html: Trailing slash
Hard code a trailing slash in URLs for categories and tags to avoid
an HTTP 301 redirect at the very least, and an HTTP 404 at the very
worst (depending on web server configuration).

This is a workaround for a problem caused by our manual construction
of URLs using the categories and tags strings in post front matter.
Hugo's own taxonomy tooling always uses a trailing slash.

See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/issues/128
2020-01-28 10:50:31 +02:00
3ab60bddea Use Font Awesome SVGs via JavaScript
This is a bit of "one step forward, two steps back" in that we are
now using the much more lean SVG icons—and only the ones we are ac
tually using—instead of having to download the two ~70KiB web font
files, but it means we need to use JavaScript.

This approache was inspired by the work @xekon did in #127.

See: https://fontawesome.com/how-to-use/on-the-web/advanced/svg-javascript-core
See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/127
2020-01-27 18:17:35 +02:00
06113fcd44 CHANGELOG.md: Add note about Font Awesome 5 2020-01-25 21:24:50 +02:00
769c25e2c2 Regenerate static assets 2020-01-25 21:22:31 +02:00
4c5ce590f2 Update to Font Awesome 5
Nothing really new as far as how we're using Font Awesome, but it is
good to keep up with the times and the tooling. Users that have used
custom fonts in their content or layouts will need to update their
icon prefixes from "fa" to "fas" or "fab" depending on which font
their icon comes from.

See: https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
2020-01-25 21:20:44 +02:00
9b35f3b1dc Regenerate static assets 2020-01-25 16:42:52 +02:00
ba6358ca48 source/scss/font-awesome.scss: Remove Google+ icon 2020-01-25 16:42:08 +02:00
77e240280a CHANGELOG.md: Add note about Google Plus 2020-01-25 16:07:18 +02:00
32af219491 layouts: Remove a few more references to GooglePlus
The sharing icons were removed in 2019, but these remained.
2020-01-25 16:05:51 +02:00
1fdd332862 .build.yml: Use Node.js v12 2020-01-23 20:16:15 +02:00
a5c50f69c2 theme.toml: Increase minimum Hugo version to 0.55
I think the new subresource integrity (SRI) stuff requires this.

See: https://gohugo.io/hugo-pipes/fingerprint/
2020-01-23 20:06:43 +02:00
d2ea109b47 README.md: Update comment about Node.js version
I've been using version 10 for a year or so. Looking at the Node.js
LTS schedule I see that version 12 is the latest LTS release so I
guess I'll start using that locally at least.

See: https://nodejs.org/en/about/releases/
2020-01-23 20:02:38 +02:00
5c3ffa7868 add summaryLength to example config, for faster learning and prototyping. 2020-01-23 20:01:05 +02:00
3047cfe356 Regenerate static assets 2020-01-23 19:55:37 +02:00
44861dfc36 source/scss/bootstrap.scss: Copy new version number
Otherwise it is very confusing because the generated style.css has
the wrong version number.
2020-01-23 19:55:15 +02:00
553af337c1 Run npm update
New minor versions of a few libraries.
2020-01-23 19:52:23 +02:00
63241061dd layouts/_default/baseof.html: Fix comment about RTL
It's not just Arabic anymore now that I added Farsi strings!
2020-01-23 19:46:21 +02:00
13449f1519 package.json: Fix typo in build script
This builds the right-to-left version of the stylesheet (RTL).
2020-01-23 19:44:54 +02:00
341bff9891 CHANGELOG.md: Add note about subresource integrity 2020-01-23 19:43:32 +02:00
c41364cf19 Remove custom generatesri tooling
We are now using Hugo's built in SRI support, which is magical and
seamless, and also gives us the bonus of acting as a cache buster.
2020-01-23 19:40:49 +02:00
44e8c677a6 Use Hugo's built-in subresource integrity support
We can use Hugo's built-in SRI support instead of using our custom
SRI generator script (as cool as it was at the time). This is more
clean and gives us the added benefit of adding fingerprints to the
CSS and JS filenames, which acts as a cache buster.

See: https://gohugo.io/hugo-pipes/introduction/
See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/issues/120
2020-01-23 19:34:21 +02:00
6e36b66fab CHANGELOG.md: Add note about typo in README.md 2020-01-22 09:15:57 +02:00
90a04b31d4 Merge pull request #118 from xekon/fix-readme
Update README.md
2020-01-22 09:14:39 +02:00
70c475f490 Update README.md 2020-01-21 15:40:57 -08:00
1eb8d9009a CHANGELOG.md: Bootstrap 4.4.1 2019-12-09 10:06:49 +02:00
293c7dff8c Regenerate static assets 2019-12-09 09:37:24 +02:00
6117301edd Bootstrap 4.4.1 2019-12-09 09:37:05 +02:00
f2dab16881 CHANGELOG.md: Add note about Farsi i18n strings 2019-12-04 09:57:36 +02:00
b2ea655810 layouts: Use right-to-left text for Farsi 2019-12-04 09:56:41 +02:00
df1ec1df21 i18n/fa.yaml: Add Farsi strings 2019-12-04 09:56:26 +02:00
80e17a5ffd Version 1.3.3 2019-12-02 10:25:40 +02:00
14417a8153 CHANGELOG.md: Add unreleased changes 2019-12-02 10:24:42 +02:00
cdf886b4e8 Regenerate static assets 2019-12-02 10:23:49 +02:00
7fa92fb2f3 Update node-sass and rtlcss 2019-12-02 10:22:41 +02:00
be563c6a9f CHANGELOG.md: Add notes about new unreleased changes 2019-10-28 13:09:26 +02:00
41c88a200f Move content/post to content/posts
This aligns closer to the Hugo Quick Start.

See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/117
See: https://gohugo.io/getting-started/quick-start/#step-4-add-some-content
2019-10-28 13:07:18 +02:00
bcc164bc4a Merge pull request #117 from sboots/patch-1
Update config.toml
2019-10-28 13:05:08 +02:00
9d6d5f21c0 Update config.toml
Small fix to correctly set the posts permalink setting
2019-10-27 12:37:34 -07:00
b7059a88dc CHANGELOG.md: Add note about home link
Thanks to @phofman.

See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/115
2019-10-11 11:15:40 +03:00
92cab738dd Fixed invalid URL if blog is not in domain root 2019-10-11 11:06:23 +03:00
1aedf82cf8 Bump version to 1.3.2 2019-06-20 14:22:15 +03:00
7b649e8717 CHANGELOG.md: Move unreleased changes to v1.3.2 2019-06-20 14:22:01 +03:00
9bf1c85346 CHANGELOG.md: Add note about date formatting fix
Special characters in the unquoted date string get escaped and may
hurt SEO as this causes malformed JSON-lD. Fix contributed by user
@TommySprat.

See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/111
2019-06-20 14:18:11 +03:00
63e36db2d5 Merge pull request #111 from TommySprat/dateformat-escape-fix
Do not escape characters in formatted date
2019-06-20 14:16:35 +03:00
c1b3e978b7 Remove escape characters in formatted date
Without the quotes in the template the '+' character will no longer
needlessly be escaped as '\x2b'
2019-06-13 00:07:36 +02:00
4ab2e0da8c package-lock.json: Run npm audit fix
So GitHub stops complaining about security vulnerabilities.
2019-06-05 10:34:08 +03:00
23203082f6 CHANGELOG.md: Add note about absURL change
See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/110
2019-06-05 10:30:53 +03:00
b4c3e06143 Merge pull request #110 from TommySprat/trailing-slash-agnostic-baseurl
Support baseurl without trailing slash
2019-06-05 10:26:18 +03:00
8da12539f3 Support baseurl without trailing slash 2019-06-04 00:26:09 +02:00
c17a7d229f CHANGELOG.md: Add note about recents block in sidebar 2019-05-26 10:30:36 +03:00
26e0a9a259 layouts/partials/recent.html: Only list "Regular" pages
This makes Hugo only list "Regular" pages in the sidebar. Otherwise
if you have very few posts, for example, you might see one entry in
the list called "Posts".

See: https://gohugo.io/functions/where/#mainsections
2019-05-26 10:28:31 +03:00
1faeef487b Bump version to 1.3.1 2019-05-05 12:37:56 +03:00
8d6b318a63 CHANGELOG.md: Move unreleased changes to v1.3.1 2019-05-05 12:36:17 +03:00
cca6636809 CHANGELOG.md: Add note about package.json 2019-05-05 12:30:56 +03:00
d6a099a5cd package.json: Run npm update 2019-05-05 12:30:15 +03:00
70e79a60fa CHANGELOG.md: Add note about Twitter link 2019-05-05 12:21:37 +03:00
ed69bec464 layouts: Update Twitter sharing link
Use the new (?) sharing intent and add the page title as Tweet text.
2019-05-05 12:20:21 +03:00
aed40fe2d3 CHANGELOG.md: Add note about SourceHut CI 2019-04-23 16:48:50 +03:00
81c64c55dd README.md: Add SourceHut build badge 2019-04-23 16:48:02 +03:00
480f31074d .build.yml: Add SourceHut CI script 2019-04-23 16:46:29 +03:00
947ec526cd README.md: Add note about RTL language support 2019-04-22 19:19:57 +03:00
633321fb66 README.md: Fix capitalization 2019-04-22 19:19:08 +03:00
41 changed files with 4100 additions and 2932 deletions

15
.build.yml Normal file
View File

@ -0,0 +1,15 @@
image: archlinux
packages:
- nodejs-lts-erbium
- npm
sources:
- https://git.sr.ht/~alanorth/hugo-theme-bootstrap4-blog
tasks:
- setup: |
id
node -v
cd hugo-theme-bootstrap4-blog
npm install
- test: |
cd hugo-theme-bootstrap4-blog
npm run build

View File

@ -4,6 +4,48 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [[1.4.0]] - 2020-01-28
### Added
- Farsi strings for user interface
## Updated
- bootstrap 4.4.1
- Fix typo in README.md (@xekon, #118)
- Font Awesome 5 (make sure you [update](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4) any custom icons you might be using in your content, site layouts, partials, etc).
## Changed
- Use Hugo's built-in subresource integrity support instead of the generatesri
tooling that I wrote by hand a few years ago (#120, @alanorth)
- Use Font Awesome SVGs via JavaScript instead of web fonts (@alanorth)
- Category and tag links now have a trailing slash (#128, @alanorth)
## Removed
- Several references to Google Plus (@xekon, #122)
## [[1.3.3]] - 2019-12-02
### Fixed
- "Home" link for blogs that are not at the root of the domain (@phofman #115)
### Changed
- Use "posts" instead of "post" in exampleSite to align closer with Hugo quick start docs (@sboots #117)
### Updated
- node-sass 4.13.0 and rtlcss 2.4.1
## [[1.3.2]] - 2019-06-20
### Changed
- Only list "Regular" pages in recent posts in sidebar (@alanorth)
- Use absURL instead of baseURL to be more robust with different site configurations (@TommySprat)
- Quote date in post metadata so it does not get escaped (@TommySprat #111)
## [1.3.1] - 2019-05-05
### Added
- SourceHut CI configuration (@alanorth)
### Updated
- Twitter sharing button (@alanorth)
- Dependencies in package.json (@alanorth)
## [1.3.0] - 2019-04-22 ## [1.3.0] - 2019-04-22
### Added ### Added
- Arabic translation (@alanorth) - Arabic translation (@alanorth)

View File

@ -1,4 +1,4 @@
# Hugo Bootstrap v4 Blog [![Build Status](https://travis-ci.org/alanorth/hugo-theme-bootstrap4-blog.svg?branch=master)](https://travis-ci.org/alanorth/hugo-theme-bootstrap4-blog) # Hugo Bootstrap v4 Blog [![Build Status](https://travis-ci.org/alanorth/hugo-theme-bootstrap4-blog.svg?branch=master)](https://travis-ci.org/alanorth/hugo-theme-bootstrap4-blog) [![builds.sr.ht status](https://builds.sr.ht/~alanorth/hugo-theme-bootstrap4-blog.svg)](https://builds.sr.ht/~alanorth/hugo-theme-bootstrap4-blog?)
A simple but opinionated [Hugo](https://gohugo.io) theme geared towards blog-style content. Based on the older two-column [Bootstrap blog example](https://v4-alpha.getbootstrap.com/examples/blog/) that was used for several Bootstrap versions, but has now been retired in favor of a "snarky" (their words) new example as of version [4.0.0's final release](https://blog.getbootstrap.com/2018/01/18/bootstrap-4/). A simple but opinionated [Hugo](https://gohugo.io) theme geared towards blog-style content. Based on the older two-column [Bootstrap blog example](https://v4-alpha.getbootstrap.com/examples/blog/) that was used for several Bootstrap versions, but has now been retired in favor of a "snarky" (their words) new example as of version [4.0.0's final release](https://blog.getbootstrap.com/2018/01/18/bootstrap-4/).
![Screenshot](https://raw.githubusercontent.com/alanorth/hugo-theme-bootstrap4-blog/master/screenshot.png "Screenshot") ![Screenshot](https://raw.githubusercontent.com/alanorth/hugo-theme-bootstrap4-blog/master/screenshot.png "Screenshot")
@ -11,14 +11,14 @@ See [picturingjordan.com](https://picturingjordan.com) for an example of this th
- Uses Bootstrap v4's [native system font stack](https://getbootstrap.com/docs/4.0/content/reboot/#native-font-stack) to load quickly and look good on all platforms - Uses Bootstrap v4's [native system font stack](https://getbootstrap.com/docs/4.0/content/reboot/#native-font-stack) to load quickly and look good on all platforms
- Excellent [structured data](https://developers.google.com/search/docs/guides/intro-structured-data) (JSON-LD), [OpenGraph](http://ogp.me), and [Twitter Card](https://dev.twitter.com/cards/types) metadata support - Excellent [structured data](https://developers.google.com/search/docs/guides/intro-structured-data) (JSON-LD), [OpenGraph](http://ogp.me), and [Twitter Card](https://dev.twitter.com/cards/types) metadata support
- robots.txt linking to XML sitemap (disabled by default, see [Hugo docs](https://gohugo.io/extras/robots-txt/)) - robots.txt linking to XML sitemap (disabled by default, see [Hugo docs](https://gohugo.io/extras/robots-txt/))
- Basic support for [multi-lingual content](https://gohugo.io/content-management/multilingual/) (added in Hugo 0.17) and user interface translation (i18n) - Basic support for [multi-lingual content](https://gohugo.io/content-management/multilingual/) (added in Hugo 0.17) and user interface translation (i18n), including RTL languages like Arabic
- Supports Google, Bing, and Yandex site verification via meta tags - Supports Google, Bing, and Yandex site verification via meta tags
- Supports Google Analytics (async version), see [Hugo docs](https://gohugo.io/extras/analytics/) - Supports Google Analytics (async version), see [Hugo docs](https://gohugo.io/extras/analytics/)
- Supports Disqus comments, see [Hugo docs](https://gohugo.io/extras/comments/) - Supports Disqus comments, see [Hugo docs](https://gohugo.io/extras/comments/)
- Can show a message about cookie usage to the user, see [`exampleSite/config.toml`](https://github.com/alanorth/hugo-theme-bootstrap4-blog/blob/master/exampleSite/config.toml) - Can show a message about cookie usage to the user, see [`exampleSite/config.toml`](https://github.com/alanorth/hugo-theme-bootstrap4-blog/blob/master/exampleSite/config.toml)
- Allow addition of custom `<head>` code in site's `layouts/partial/head-custom.html` (see [#17](https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/17)) - Allow addition of custom `<head>` code in site's `layouts/partials/head-custom.html` (see [#17](https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/17))
- Configurable display of summaries of content in list templates. - Configurable display of summaries of content in list templates.
- configurable keywords for every post - Configurable keywords for every post
## Usage ## Usage
Clone the repository to your site's `themes` directory. Refer to [`exampleSite/config.toml`](https://github.com/alanorth/hugo-theme-bootstrap4-blog/blob/master/exampleSite/config.toml) for recommended configuration values. Clone the repository to your site's `themes` directory. Refer to [`exampleSite/config.toml`](https://github.com/alanorth/hugo-theme-bootstrap4-blog/blob/master/exampleSite/config.toml) for recommended configuration values.
@ -38,7 +38,7 @@ A few suggestions to help you get a good looking site quickly:
See the source code and structure of [picturingjordan.com](https://github.com/alanorth/picturingjordan.com) to get more ideas. See the source code and structure of [picturingjordan.com](https://github.com/alanorth/picturingjordan.com) to get more ideas.
## Building (For Developers) ## Building (For Developers)
This theme uses the [Bootstrap](https://getbootstrap.com/) framework. A static version of this is already included, but if you want to bump the version, tweak the style, etc, you'll need to rebuild the assets. Make sure you have NodeJS >= v6 installed, and then run the following from inside the theme's directory: This theme uses the [Bootstrap](https://getbootstrap.com/) framework. A static version of this is already included, but if you want to bump the version, tweak the style, etc, you'll need to rebuild the assets. Make sure you have NodeJS >= v10 installed, and then run the following from inside the theme's directory:
```console ```console
$ npm install $ npm install

6
assets/css/style.css Normal file

File diff suppressed because one or more lines are too long

6
assets/css/style.rtl.css Normal file

File diff suppressed because one or more lines are too long

1
assets/js/fontawesome.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +0,0 @@
{
"style": "static/css/style.css",
"stylertl": "static/css/style.rtl.css",
"cookieconsentcss": "static/css/cookieconsent.min.css",
"cookieconsentjs": "static/js/cookieconsent.min.js"
}

View File

@ -1,23 +0,0 @@
// Adapted from: https://gist.github.com/jmervine/ae1bace0fe37dce75b90ec3e9592771c
var crypto = require('crypto');
var fs = require('fs');
var assets = require('./assets.json');
var generate384 = function (file) {
var enc = 'utf8';
var body = fs.readFileSync(file, { encoding: enc });
var hash = crypto.createHash('sha384').update(body, enc);
var sha = hash.digest('base64');
return 'sha384-' + sha;
}
for (var asset in assets) {
var path = assets[asset];
var hash = generate384(path);
console.log(asset + ' = "' + hash + '"');
}
// vim: set ts=2 sw=2 et:

View File

@ -1,4 +0,0 @@
style = "sha384-G5B34w7DFTumWTswxYzTX7NWfbvQEg1HbFFEg6ItN03uTAAoS2qkPS/fu3LhuuSA"
stylertl = "sha384-wxZc+CAOuj0Z/AJqCKfxerYzFw93KXl6wI/vGBVOmdqRyBrIv3STXmzcnBdyQK9C"
cookieconsentcss = "sha384-6iYDyQZuuNT7DcPJGXx241czdv2+GDGUcXRiqw1iXrjgYMTorSetxFP3JCMQMwnR"
cookieconsentjs = "sha384-PDjg2ZdS3khPzd53i18+7tzB32JVQfFMrTXYo21RqPgUmEVAPwIhxOUF/8sP79CS"

View File

@ -6,13 +6,15 @@ title = "Hugo Bootstrap v4 Blog"
theme = "hugo-theme-bootstrap4-blog" theme = "hugo-theme-bootstrap4-blog"
# number of posts to show on home/category/tag pages (Default: 10) # number of posts to show on home/category/tag pages (Default: 10)
paginate = 5 paginate = 5
# number of words to use for summary on home/category/tag pages (Default: 70)
summaryLength = 50
# optionally override the site's footer with custom copyright text # optionally override the site's footer with custom copyright text
# copyright = "Except where otherwise noted, content on this site is licensed under a [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/)." # copyright = "Except where otherwise noted, content on this site is licensed under a [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/)."
#googleAnalytics = "UA-123-45" #googleAnalytics = "UA-123-45"
#disqusShortname = "XYW" #disqusShortname = "XYW"
[permalinks] [permalinks]
post = "/:year/:month/:title/" posts = "/:year/:month/:title/"
page = "/:slug/" page = "/:slug/"
[[menu.sidebar]] [[menu.sidebar]]

47
i18n/fa.yaml Normal file
View File

@ -0,0 +1,47 @@
- id: about
translation: "درباره من"
- id: home
translation: "صفحه اصلی"
- id: recentPosts
translation: "مطالب تازه"
- id: readMore
translation: "بیشتر بخوانید ←"
- id: translations
translation: "ترجمه"
- id: share
translation: "به اشتراک گذاشتن"
- id: paginatorPrevious
translation: "صفحه قبلی"
- id: paginatorNext
translation: "صفحه بعدی"
- id: cookieMessage
translation: "در این سایت از کوکیز استفاده میشود"
- id: cookieLink
translation: ".بیشتر بدانید"
- id: cookieDismiss
translation: "!متوجه شدم"
- id: backToTop
translation: "برگشت به بالا"
- id: links
translation: "لینکها"
- id: authoredBy
translation: "بوسیله"
- id: postedIn
translation: "در"
- id: comma
translation: "،"

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ .Lang }}" {{ if eq .Lang "ar" }}dir="rtl"{{ end }}> <html lang="{{ .Lang }}" {{ if or (eq .Lang "ar") (eq .Lang "fa") }}dir="rtl"{{ end }}>
<head> <head>
{{ partial "head-meta.html" . }} {{ partial "head-meta.html" . }}
@ -12,14 +12,20 @@
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title> <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ if eq .Lang "ar" }} {{ if or (eq .Lang "ar") (eq .Lang "fa") }}
{{ "<!-- ar -->" | safeHTML }} {{ "<!-- RTL -->" | safeHTML }}
<link href="{{ .Site.BaseURL }}css/style.rtl.css" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.styleltr}}" crossorigin="anonymous"{{ end }}> {{ $styleRtl := resources.Get "css/style.rtl.css" | resources.Fingerprint }}
<link href="{{ $styleRtl.Permalink }}" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ $styleRtl.Data.Integrity }}" crossorigin="anonymous"{{ end }}>
{{ else }} {{ else }}
{{ "<!-- combined, minified CSS -->" | safeHTML }} {{ "<!-- combined, minified CSS -->" | safeHTML }}
<link href="{{ .Site.BaseURL }}css/style.css" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.style}}" crossorigin="anonymous"{{ end }}> {{ $style := resources.Get "css/style.css" | resources.Fingerprint }}
<link href="{{ $style.Permalink }}" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous"{{ end }}>
{{ end }} {{ end }}
{{ "<!-- minified Font Awesome for SVG icons -->" | safeHTML }}
{{ $fontawesome := resources.Get "js/fontawesome.min.js" | resources.Fingerprint }}
<script defer src="{{ $fontawesome.Permalink }}" integrity="{{ $fontawesome.Data.Integrity }}" crossorigin="anonymous"></script>
{{ "<!-- RSS 2.0 feed -->" | safeHTML }} {{ "<!-- RSS 2.0 feed -->" | safeHTML }}
{{ with .OutputFormats.Get "rss" -}} {{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
@ -55,7 +61,7 @@
{{ if (ne .Site.Params.header_visible false) }} {{ if (ne .Site.Params.header_visible false) }}
<header class="blog-header"> <header class="blog-header">
<div class="container"> <div class="container">
<h1 class="blog-title" dir="auto"><a href="{{ .Site.BaseURL }}" rel="home">{{ .Site.Title | safeHTML }}</a></h1> <h1 class="blog-title" dir="auto"><a href="{{ .Site.BaseURL | absURL }}" rel="home">{{ .Site.Title | safeHTML }}</a></h1>
{{ if .Site.Params.description }}<p class="lead blog-description" dir="auto">{{ .Site.Params.description | markdownify }}</p>{{ end }} {{ if .Site.Params.description }}<p class="lead blog-description" dir="auto">{{ .Site.Params.description | markdownify }}</p>{{ end }}
</div> </div>
</header> </header>

View File

@ -12,10 +12,7 @@
}, },
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- if not .Date.IsZero }} {{- if not .Date.IsZero }}
"dateModified": "{{ .Date.Format $ISO8601 }}", "dateModified": {{ .Date.Format $ISO8601 }},
{{- end }}
{{- with .Site.Social.GooglePlus }}
"publisher": "{{ printf "%s" . }}",
{{- end }} {{- end }}
{{- /* all of the site's categories/tags, from Hugo's tpl/template_embedded.go */}} {{- /* all of the site's categories/tags, from Hugo's tpl/template_embedded.go */}}
"keywords": "{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}" "keywords": "{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}"

View File

@ -25,15 +25,12 @@
"wordCount": "{{ .WordCount }}", "wordCount": "{{ .WordCount }}",
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- if not .PublishDate.IsZero }} {{- if not .PublishDate.IsZero }}
"datePublished": "{{ .PublishDate.Format $ISO8601 }}", "datePublished": {{ .PublishDate.Format $ISO8601 }},
{{- else }} {{- else }}
"datePublished": "{{ .Date.Format $ISO8601 }}", "datePublished": {{ .Date.Format $ISO8601 }},
{{- end }} {{- end }}
{{- if not .Lastmod.IsZero }} {{- if not .Lastmod.IsZero }}
"dateModified": "{{ .Lastmod.Format $ISO8601 }}", "dateModified": {{ .Lastmod.Format $ISO8601 }},
{{- end }}
{{- with .Site.Social.GooglePlus }}
"publisher": "{{ printf "%s" . }}",
{{- end }} {{- end }}
"author": { "author": {
"@type": "Person", "@type": "Person",

View File

@ -1,5 +1,7 @@
<link href="{{ .Site.BaseURL }}css/cookieconsent.min.css" rel="stylesheet" type="text/css"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentcss }}" crossorigin="anonymous"{{ end }}> {{ $cookieConsentStyle := resources.Get "css/cookieconsent.min.css" | resources.Fingerprint }}
<script src="{{ .Site.BaseURL }}js/cookieconsent.min.js"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentjs }}" crossorigin="anonymous"{{ end }} async></script> <link href="{{ $cookieConsentStyle.Permalink }}" rel="stylesheet" type="text/css"{{ if not .Site.Params.disable_sri }} integrity="{{ $cookieConsentStyle.Data.Integrity }}" crossorigin="anonymous"{{ end }}>
{{ $cookieConsentScript := resources.Get "js/cookieconsent.min.js" | resources.Fingerprint }}
<script src="{{ $cookieConsentScript.Permalink }}"{{ if not .Site.Params.disable_sri }} integrity="{{ $cookieConsentScript.Data.Integrity }}" crossorigin="anonymous"{{ end }} async></script>
<script> <script>
window.addEventListener("load", function(){ window.addEventListener("load", function(){

View File

@ -1,8 +1,8 @@
{{ if .Params.categories }} {{ if .Params.categories }}
<i class="fa fa-folder" aria-hidden="true"></i>&nbsp;{{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" rel="category tag">{{ . }}</a>{{ end }} <span class="fas fa-folder" aria-hidden="true"></span>&nbsp;{{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}/" rel="category tag">{{ . }}</a>{{ end }}
{{ end }} {{ end }}
{{ if .Params.tags }} {{ if .Params.tags }}
<i class="fa fa-tag" aria-hidden="true"></i>&nbsp;{{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" rel="tag">{{ . }}</a>{{ end }} <span class="fas fa-tag" aria-hidden="true"></span>&nbsp;{{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}/" rel="tag">{{ . }}</a>{{ end }}
{{ end }} {{ end }}
{{- /* vim: set ts=2 sw=2 et: */}} {{- /* vim: set ts=2 sw=2 et: */}}

View File

@ -2,7 +2,7 @@
<h4>{{ i18n "recentPosts" }}</h4> <h4>{{ i18n "recentPosts" }}</h4>
<ol class="list-unstyled"> <ol class="list-unstyled">
{{ $num_recent_posts := (index .Site.Params.sidebar "num_recent_posts" | default 5) }} {{ $num_recent_posts := (index .Site.Params.sidebar "num_recent_posts" | default 5) }}
{{ range first $num_recent_posts (where .Site.Pages "Section" "in" .Site.Params.mainSections) }} {{ range first $num_recent_posts (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
<li><a href="{{.RelPermalink}}">{{.Title | markdownify }}</a></li> <li><a href="{{.RelPermalink}}">{{.Title | markdownify }}</a></li>
{{ end }} {{ end }}
</ol> </ol>

View File

@ -1,9 +1,9 @@
<section> <section>
<h4>{{ i18n "share" }}</h4> <h4>{{ i18n "share" }}</h4>
<nav class="nav sharing-icons"> <nav class="nav sharing-icons">
<a class="nav-item" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" title="Share on Facebook"><span class="fa fa-facebook fa-2x" aria-hidden="true"></span></a> <a class="nav-item" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" title="Share on Facebook"><span class="fab fa-facebook-f fa-2x" aria-hidden="true"></span></a>
<a class="nav-item" href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{ .Permalink }}" title="Share on LinkedIn"><span class="fa fa-linkedin fa-2x" aria-hidden="true"></span></a> <a class="nav-item" href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{ .Permalink }}" title="Share on LinkedIn"><span class="fab fa-linkedin-in fa-2x" aria-hidden="true"></span></a>
<a class="nav-item" href="https://twitter.com/home?status={{ .Permalink }}" title="Tweet this"><span class="fa fa-twitter fa-2x"></span></a> <a class="nav-item" href="https://twitter.com/intent/tweet?url={{ .Permalink }}&amp;text={{ .Title }}" title="Tweet this"><span class="fab fa-twitter fa-2x"></span></a>
</nav> </nav>
</section> </section>

View File

@ -1,3 +1,3 @@
Sitemap: {{ .Site.BaseURL }}sitemap.xml Sitemap: {{ "sitemap.xml" | absURL }}
User-agent: * User-agent: *

4034
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +1,32 @@
{ {
"name": "hugo-theme-bootstrap4-blog", "name": "hugo-theme-bootstrap4-blog",
"version": "1.3.0", "version": "1.3.3",
"description": "A Bootstrap v4 theme for the Hugo static site generator.", "description": "A Bootstrap v4 theme for the Hugo static site generator.",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/alanorth/hugo-theme-bootstrap4-blog.git" "url": "https://github.com/alanorth/hugo-theme-bootstrap4-blog.git"
}, },
"scripts": { "scripts": {
"build:css": "node-sass --output-style expanded --precision 6 source/scss/style.scss static/css/style.css.tmp && cleancss --level 1 static/css/style.css.tmp -o static/css/style.css", "build:css": "node-sass --output-style expanded --precision 6 source/scss/style.scss assets/css/style.css.tmp && cleancss --level 1 assets/css/style.css.tmp -o assets/css/style.css",
"build:ltrcss": "rtlcss -s static/css/style.css.tmp static/css/style.rtl.css.tmp && cleancss --level 1 static/css/style.rtl.css.tmp -o static/css/style.rtl.css", "build:rtlcss": "rtlcss -s assets/css/style.css.tmp assets/css/style.rtl.css.tmp && cleancss --level 1 assets/css/style.rtl.css.tmp -o assets/css/style.rtl.css",
"build:fonts": "cp node_modules/font-awesome/fonts/* static/fonts", "build:cookieconsent": "cp node_modules/cookieconsent/build/cookieconsent.min.css assets/css && cp node_modules/cookieconsent/build/cookieconsent.min.js assets/js",
"build:cookieconsent": "cp node_modules/cookieconsent/build/cookieconsent.min.css static/css && cp node_modules/cookieconsent/build/cookieconsent.min.js static/js", "build:js": "webpack",
"build:generatesri": "node build/sri.js > data/sri.toml", "build": "npm run build:css && npm run build:rtlcss && npm run build:js && npm run build:cookieconsent && npm run clean",
"build": "npm run build:css && npm run build:ltrcss && npm run build:fonts && npm run build:cookieconsent && npm run build:generatesri && npm run clean", "clean": "rm assets/css/style.css.tmp assets/css/style.rtl.css.tmp"
"clean": "rm static/css/style.css.tmp static/css/style.rtl.css.tmp"
}, },
"keywords": "hugo", "keywords": "hugo",
"author": "Alan Orth", "author": "Alan Orth",
"license": "CC-BY-3.0", "license": "CC-BY-3.0",
"devDependencies": { "devDependencies": {
"bootstrap": "~4.3.1", "@fortawesome/fontawesome-svg-core": "^1.2.26",
"@fortawesome/free-brands-svg-icons": "^5.12.0",
"@fortawesome/free-solid-svg-icons": "^5.12.0",
"bootstrap": "~4.4.1",
"clean-css-cli": "^4.3.0", "clean-css-cli": "^4.3.0",
"cookieconsent": "3.0.4", "cookieconsent": "3.0.4",
"font-awesome": "^4.7.0", "node-sass": "^4.13.1",
"node-sass": "^4.11.0", "rtlcss": "^2.4.1",
"rtlcss": "^2.4.0" "webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
} }
} }

13
source/js/fontawesome.js Normal file
View File

@ -0,0 +1,13 @@
import { library, dom } from '@fortawesome/fontawesome-svg-core'
import { faFolder, faTag } from '@fortawesome/free-solid-svg-icons'
import { faFacebookF, faTwitter, faLinkedinIn } from '@fortawesome/free-brands-svg-icons'
// Add solid icons to our library
library.add(faFolder, faTag)
// Add brand icons to our library
library.add(faFacebookF, faTwitter, faLinkedinIn)
// Replace any existing <i> tags with <svg> and set up a MutationObserver to
// continue doing this as the DOM changes.
dom.watch()

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap v4.3.1 (https://getbootstrap.com/) * Bootstrap v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors * Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc. * Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)

View File

@ -1,35 +0,0 @@
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "node_modules/font-awesome/scss/variables";
@import "node_modules/font-awesome/scss/mixins";
@import "node_modules/font-awesome/scss/path";
@import "node_modules/font-awesome/scss/core";
@import "node_modules/font-awesome/scss/larger";
@import "node_modules/font-awesome/scss/fixed-width";
//@import "list";
//@import "bordered-pulled";
//@import "animated";
//@import "rotated-flipped";
//@import "stacked";
//@import "icons";
// selectively import icons we need from font-awesome
// see: node_modules/font-awesome/scss/_icons.scss
.#{$fa-css-prefix}-tag:before { content: $fa-var-tag; }
.#{$fa-css-prefix}-folder:before { content: $fa-var-folder; }
.#{$fa-css-prefix}-facebook:before { content: $fa-var-facebook; }
.#{$fa-css-prefix}-google-plus:before { content: $fa-var-google-plus; }
.#{$fa-css-prefix}-linkedin:before { content: $fa-var-linkedin; }
.#{$fa-css-prefix}-rss:before { content: $fa-var-rss; }
.#{$fa-css-prefix}-rss-square:before { content: $fa-var-rss-square; }
.#{$fa-css-prefix}-twitter:before { content: $fa-var-twitter; }
.#{$fa-css-prefix}-y-combinator-square:before,
.#{$fa-css-prefix}-yc-square:before,
.#{$fa-css-prefix}-hacker-news:before { content: $fa-var-hacker-news; }
.#{$fa-css-prefix}-reddit:before { content: $fa-var-reddit; }
.#{$fa-css-prefix}-reddit-square:before { content: $fa-var-reddit-square; }
.#{$fa-css-prefix}-stumbleupon-circle:before { content: $fa-var-stumbleupon-circle; }
.#{$fa-css-prefix}-stumbleupon:before { content: $fa-var-stumbleupon; }
@import "node_modules/font-awesome/scss/screen-reader";

View File

@ -1,7 +1,3 @@
// selectively import components we need from font-awesome
// see: node_modules/font-awesome/scss/font-awesome.scss
@import 'source/scss/font-awesome';
// selectively import components we need from bootstrap // selectively import components we need from bootstrap
// see: node_modules/bootstrap/scss/bootstrap.scss // see: node_modules/bootstrap/scss/bootstrap.scss
@import 'source/scss/bootstrap'; @import 'source/scss/bootstrap';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

View File

@ -5,7 +5,7 @@ description = "A simple Hugo theme based on the Bootstrap v4 blog example."
homepage = "https://github.com/alanorth/hugo-theme-bootstrap4-blog" homepage = "https://github.com/alanorth/hugo-theme-bootstrap4-blog"
tags = ["bootstrap", "blog", "font awesome"] tags = ["bootstrap", "blog", "font awesome"]
features = ["responsive", "blog"] features = ["responsive", "blog"]
min_version = 0.25 min_version = 0.55
[author] [author]
name = "Alan Orth" name = "Alan Orth"

10
webpack.config.js Normal file
View File

@ -0,0 +1,10 @@
const path = require('path');
module.exports = {
entry: './source/js/fontawesome.js',
output: {
path: path.resolve(__dirname, 'assets/js'),
filename: 'fontawesome.min.js'
},
mode: 'production'
};